GKE Creation of a RoleBinding Referencing a ServiceAccount
Description
Detects creation of a GKE RoleBinding or ClusterRoleBinding that grants permissions to a ServiceAccount, which may indicate privilege delegation or RBAC misconfiguration leading to elevated access.
Query · kuery
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and event.action:( "io.k8s.authorization.rbac.v1.rolebindings.create" or "io.k8s.authorization.rbac.v1.clusterrolebindings.create" ) and gcp.audit.request.subjects.kind:"ServiceAccount" and not client.user.email:( "system:apiserver" or "gcp:kube-bootstrap" )
Investigation fields
Pivot points the source recommends for triage.
@timestampclient.user.emailsource.ipuser_agent.originalevent.actionevent.outcomegcp.audit.resource_namegcp.audit.request.roleRef.namegcp.audit.request.roleRef.kindgcp.audit.request.subjects.namegcp.audit.request.subjects.namespacedata_stream.namespace
Implementation guide
The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule.
Known false positives
- GitOps, namespace onboarding, and workload deployment commonly create RoleBindings for service accounts. Default bootstrap bindings from `system:apiserver` and GKE node bootstrap from `gcp:kube-bootstrap` are excluded.
Analyst notes
Investigating GKE Creation of a RoleBinding Referencing a ServiceAccount
This rule detects creation of a RoleBinding or ClusterRoleBinding whose subject is a ServiceAccount. Attackers often bind over-privileged roles to an existing workload service account to operate with elevated rights.
Possible investigation steps
- Review
client.user.email,source.ip,gcp.audit.request.roleRef, andgcp.audit.request.subjects. - Determine which workloads run under the bound service account and whether the referenced role is cluster-scoped.
- Correlate with secret access, exec, or additional RBAC changes from the same actor.
False positive analysis
- Legitimate deployments and operators create service account bindings during routine releases.
Response and remediation
- Remove unauthorized bindings, rotate the service account credentials, and tighten who can create RoleBindings.