GKE Service Account Modified RBAC Objects
Description
Detects write operations performed by GKE service accounts against RBAC resources (Roles, ClusterRoles, RoleBindings, ClusterRoleBindings). Service accounts typically do not manage RBAC directly; this activity may indicate token abuse or unauthorized privilege escalation.
Query · kuery
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and client.user.email:(system\:serviceaccount\:* and not ( "system:serviceaccount:kube-system:clusterrole-aggregation-controller" or "system:serviceaccount:kube-system:generic-garbage-collector" )) and event.action:( "io.k8s.authorization.rbac.v1.clusterrolebindings.create" or "io.k8s.authorization.rbac.v1.clusterrolebindings.delete" or "io.k8s.authorization.rbac.v1.clusterrolebindings.patch" or "io.k8s.authorization.rbac.v1.clusterrolebindings.update" or "io.k8s.authorization.rbac.v1.clusterroles.create" or "io.k8s.authorization.rbac.v1.clusterroles.delete" or "io.k8s.authorization.rbac.v1.clusterroles.patch" or "io.k8s.authorization.rbac.v1.clusterroles.update" or "io.k8s.authorization.rbac.v1.rolebindings.create" or "io.k8s.authorization.rbac.v1.rolebindings.delete" or "io.k8s.authorization.rbac.v1.rolebindings.patch" or "io.k8s.authorization.rbac.v1.rolebindings.update" or "io.k8s.authorization.rbac.v1.roles.create" or "io.k8s.authorization.rbac.v1.roles.delete" or "io.k8s.authorization.rbac.v1.roles.patch" or "io.k8s.authorization.rbac.v1.roles.update" )
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 to be compatible with this rule.
Known false positives
- In-cluster controllers, operators, and CI jobs may legitimately reconcile RBAC manifests. Baseline known automation service accounts before tuning.
Analyst notes
Investigating GKE Service Account Modified RBAC Objects
This rule detects service accounts performing allowed write actions on RBAC resources. Stolen or over-privileged service account tokens can silently alter authorization to gain or retain elevated access.
Possible investigation steps
- Review
client.user.email,event.action, andgcp.audit.resource_name. - Trace the acting service account to its owning workload and inspect recent image changes or exec activity.
- Correlate with change tickets or GitOps commits for the same RBAC object.
False positive analysis
- Platform operators and GitOps controllers running in-cluster commonly create or patch RBAC objects.
Response and remediation
- Revert unauthorized RBAC changes, rotate the service account credentials, and tighten RBAC for the workload.