GKE Creation or Modification of Sensitive Role
Detects creation or modification of GKE Roles or ClusterRoles that grant high-risk permissions, such as wildcard access or RBAC escalation verbs (bind, escalate, impersonate), which may enable privilege escalation or unauthorized access within the cluster.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/07/10"
3integration = ["gcp"]
4maturity = "production"
5updated_date = "2026/07/10"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects creation or modification of GKE Roles or ClusterRoles that grant high-risk permissions, such as wildcard
11access or RBAC escalation verbs (bind, escalate, impersonate), which may enable privilege escalation or unauthorized
12access within the cluster.
13"""
14false_positives = [
15 """
16 Platform installers, GitOps controllers, and RBAC refactoring may legitimately create roles with broad permissions.
17 Baseline approved automation and tune exclusions for known operators.
18 """,
19]
20from = "now-6m"
21index = ["logs-gcp.audit-*"]
22language = "kuery"
23license = "Elastic License v2"
24name = "GKE Creation or Modification of Sensitive Role"
25note = """## Triage and analysis
26
27### Investigating GKE Creation or Modification of Sensitive Role
28
29This rule detects allowed create, update, or patch actions on Roles and ClusterRoles that introduce high-risk RBAC
30permissions, including wildcard access and escalation verbs like bind, escalate, or impersonate.
31
32### Possible investigation steps
33
34- Identify `client.user.email`, `source.ip`, and `user_agent.original`.
35- Review `gcp.audit.resource_name`, `event.action`, and `gcp.audit.request` for the changed role.
36- Enumerate RoleBindings or ClusterRoleBindings that reference the role and hunt for follow-on secret or exec activity.
37
38### False positive analysis
39
40- GitOps or platform bootstrap may create broad roles during onboarding. `system:addon-manager` patch reconciliation on built-in Roles and ClusterRoles is excluded.
41
42### Response and remediation
43
44- Revert unauthorized roles, remove unexpected bindings, and restrict RBAC change permissions to governed pipelines.
45
46"""
47setup = "The GCP Fleet integration with GKE audit logs enabled is required. Request body capture on RBAC resources is required."
48references = [
49 "https://kubernetes.io/docs/reference/access-authn-authz/rbac/",
50 "https://heilancoos.github.io/research/2025/12/16/kubernetes.html#overly-permissive-role-based-access-control",
51]
52risk_score = 47
53rule_id = "2af7f1d7-d02c-476f-a130-e17ea4e556e6"
54severity = "medium"
55tags = [
56 "Domain: Cloud",
57 "Domain: Kubernetes",
58 "Data Source: GCP",
59 "Data Source: Google Cloud Platform",
60 "Use Case: Threat Detection",
61 "Tactic: Persistence",
62 "Tactic: Privilege Escalation",
63 "Resources: Investigation Guide",
64]
65timestamp_override = "event.ingested"
66type = "query"
67
68query = '''
69data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
70event.action:(
71 "io.k8s.authorization.rbac.v1.roles.create" or
72 "io.k8s.authorization.rbac.v1.roles.update" or
73 "io.k8s.authorization.rbac.v1.roles.patch" or
74 "io.k8s.authorization.rbac.v1.clusterroles.create" or
75 "io.k8s.authorization.rbac.v1.clusterroles.update" or
76 "io.k8s.authorization.rbac.v1.clusterroles.patch"
77) and not source.ip:("::1" or "127.0.0.1") and not (
78 client.user.email:"system:serviceaccount:kube-system:clusterrole-aggregation-controller" and
79 gcp.audit.request.metadata.name:(admin or edit) and
80 event.action:"io.k8s.authorization.rbac.v1.clusterroles.patch"
81) and not (
82 client.user.email:"system:addon-manager" and
83 event.action:(
84 "io.k8s.authorization.rbac.v1.roles.patch" or
85 "io.k8s.authorization.rbac.v1.clusterroles.patch"
86 )
87) and (
88 gcp.audit.request.rules.verbs:("*" or escalate or bind or impersonate) or
89 (
90 gcp.audit.request.rules.verbs:("*" or create or patch or update) and
91 gcp.audit.request.rules.resources:(
92 "*" or clusterroles or clusterrolebindings or roles or rolebindings or
93 pods/exec or serviceaccounts/token or nodes/proxy or daemonsets
94 )
95 ) or
96 (
97 gcp.audit.request.rules.verbs:("*" or get or list) and
98 gcp.audit.request.rules.resources:("*" or secrets)
99 ) or
100 gcp.audit.response.rules.verbs:("*" or escalate or bind or impersonate) or
101 (
102 gcp.audit.response.rules.verbs:("*" or create or patch or update) and
103 gcp.audit.response.rules.resources:(
104 "*" or clusterroles or clusterrolebindings or roles or rolebindings or
105 pods/exec or serviceaccounts/token or nodes/proxy or daemonsets
106 )
107 ) or
108 (
109 gcp.audit.response.rules.verbs:("*" or get or list) and
110 gcp.audit.response.rules.resources:("*" or secrets)
111 )
112)
113'''
114
115[[rule.threat]]
116framework = "MITRE ATT&CK"
117
118[[rule.threat.technique]]
119id = "T1098"
120name = "Account Manipulation"
121reference = "https://attack.mitre.org/techniques/T1098/"
122
123[[rule.threat.technique.subtechnique]]
124id = "T1098.006"
125name = "Additional Container Cluster Roles"
126reference = "https://attack.mitre.org/techniques/T1098/006/"
127
128[rule.threat.tactic]
129id = "TA0003"
130name = "Persistence"
131reference = "https://attack.mitre.org/tactics/TA0003/"
132
133[[rule.threat]]
134framework = "MITRE ATT&CK"
135
136[[rule.threat.technique]]
137id = "T1098"
138name = "Account Manipulation"
139reference = "https://attack.mitre.org/techniques/T1098/"
140
141[[rule.threat.technique.subtechnique]]
142id = "T1098.006"
143name = "Additional Container Cluster Roles"
144reference = "https://attack.mitre.org/techniques/T1098/006/"
145
146[rule.threat.tactic]
147id = "TA0004"
148name = "Privilege Escalation"
149reference = "https://attack.mitre.org/tactics/TA0004/"
150
151[rule.investigation_fields]
152field_names = [
153 "@timestamp",
154 "client.user.email",
155 "source.ip",
156 "user_agent.original",
157 "event.action",
158 "event.outcome",
159 "gcp.audit.resource_name",
160 "gcp.audit.request.kind",
161 "data_stream.namespace",
162]
Triage and analysis
Investigating GKE Creation or Modification of Sensitive Role
This rule detects allowed create, update, or patch actions on Roles and ClusterRoles that introduce high-risk RBAC permissions, including wildcard access and escalation verbs like bind, escalate, or impersonate.
Possible investigation steps
- Identify
client.user.email,source.ip, anduser_agent.original. - Review
gcp.audit.resource_name,event.action, andgcp.audit.requestfor the changed role. - Enumerate RoleBindings or ClusterRoleBindings that reference the role and hunt for follow-on secret or exec activity.
False positive analysis
- GitOps or platform bootstrap may create broad roles during onboarding.
system:addon-managerpatch reconciliation on built-in Roles and ClusterRoles is excluded.
Response and remediation
- Revert unauthorized roles, remove unexpected bindings, and restrict RBAC change permissions to governed pipelines.
References
Related rules
- GKE Cluster-Admin Role Binding Created or Modified
- GKE Creation of a RoleBinding Referencing a ServiceAccount
- GKE Service Account Modified RBAC Objects
- GKE Unusual Sensitive Workload Modification
- GKE RBAC Wildcard Elevation on Existing Role