GKE Creation or Modification of Sensitive Role
Description
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.
Query · kuery
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
event.action:(
"io.k8s.authorization.rbac.v1.roles.create" or
"io.k8s.authorization.rbac.v1.roles.update" or
"io.k8s.authorization.rbac.v1.roles.patch" or
"io.k8s.authorization.rbac.v1.clusterroles.create" or
"io.k8s.authorization.rbac.v1.clusterroles.update" or
"io.k8s.authorization.rbac.v1.clusterroles.patch"
) and not source.ip:("::1" or "127.0.0.1") and not (
client.user.email:"system:serviceaccount:kube-system:clusterrole-aggregation-controller" and
gcp.audit.request.metadata.name:(admin or edit) and
event.action:"io.k8s.authorization.rbac.v1.clusterroles.patch"
) and not (
client.user.email:"system:addon-manager" and
event.action:(
"io.k8s.authorization.rbac.v1.roles.patch" or
"io.k8s.authorization.rbac.v1.clusterroles.patch"
)
) and (
gcp.audit.request.rules.verbs:("*" or escalate or bind or impersonate) or
(
gcp.audit.request.rules.verbs:("*" or create or patch or update) and
gcp.audit.request.rules.resources:(
"*" or clusterroles or clusterrolebindings or roles or rolebindings or
pods/exec or serviceaccounts/token or nodes/proxy or daemonsets
)
) or
(
gcp.audit.request.rules.verbs:("*" or get or list) and
gcp.audit.request.rules.resources:("*" or secrets)
) or
gcp.audit.response.rules.verbs:("*" or escalate or bind or impersonate) or
(
gcp.audit.response.rules.verbs:("*" or create or patch or update) and
gcp.audit.response.rules.resources:(
"*" or clusterroles or clusterrolebindings or roles or rolebindings or
pods/exec or serviceaccounts/token or nodes/proxy or daemonsets
)
) or
(
gcp.audit.response.rules.verbs:("*" or get or list) and
gcp.audit.response.rules.resources:("*" or secrets)
)
)
Investigation fields
Pivot points the source recommends for triage.
@timestampclient.user.emailsource.ipuser_agent.originalevent.actionevent.outcomegcp.audit.resource_namegcp.audit.request.kinddata_stream.namespace
Implementation guide
The GCP Fleet integration with GKE audit logs enabled is required. Request body capture on RBAC resources is required.
Known false positives
- Platform installers, GitOps controllers, and RBAC refactoring may legitimately create roles with broad permissions. Baseline approved automation and tune exclusions for known operators.
Analyst notes
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.