diff --git a/rules/integrations/gcp/privilege_escalation_gcp_kubernetes_rolebindings_created_or_patched.toml b/rules/integrations/gcp/privilege_escalation_gcp_kubernetes_rolebindings_created_or_patched.toml new file mode 100644 index 000000000..1db17dc8c --- /dev/null +++ b/rules/integrations/gcp/privilege_escalation_gcp_kubernetes_rolebindings_created_or_patched.toml @@ -0,0 +1,47 @@ +[metadata] +creation_date = "2021/06/06" +maturity = "production" +updated_date = "2021/10/14" +integration = "gcp" + +[rule] +author = ["Elastic", "Austin Songer"] +description = """ +Identifies the creation or patching of potential malicious rolebinding. You can assign these roles to Kubernetes subjects +(users, groups, or service accounts) with role bindings and cluster role bindings. +""" +from = "now-20m" +index = ["filebeat-*", "logs-gcp*"] +language = "kuery" +license = "Elastic License v2" +name = "GCP Kubernetes Rolebindings Created or Patched " +note = """## Config + +The GCP Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.""" +references = [ + "https://cloud.google.com/kubernetes-engine/docs/how-to/audit-logging", + "https://unofficial-kubernetes.readthedocs.io/en/latest/admin/authorization/rbac/", + "https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control", +] +risk_score = 47 +rule_id = "2f0bae2d-bf20-4465-be86-1311addebaa3" +severity = "medium" +tags = ["Elastic", "Cloud", "GCP", "Continuous Monitoring", "SecOps", "Configuration Audit"] +timestamp_override = "event.ingested" +type = "query" + +query = ''' +event.dataset:(googlecloud.audit or gcp.audit) and event.action:(io.k8s.authorization.rbac.v*.clusterrolebindings.create or +io.k8s.authorization.rbac.v*.rolebindings.create or io.k8s.authorization.rbac.v*.clusterrolebindings.patch or +io.k8s.authorization.rbac.v*.rolebindings.patch) and event.outcome:success +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" + +[rule.threat.tactic] +id = "TA0004" +name = "Privilege Escalation" +reference = "https://attack.mitre.org/tactics/TA0004/" +