← Back to Explore
elasticmediumTTP
GKE Service Account Modified RBAC Objects
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.
Detection Query
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"
)
Author
Elastic
Created
2026/07/10
Data Sources
GCPGoogle Cloud Platformlogs-gcp.audit-*
References
Tags
Domain: CloudDomain: KubernetesData Source: GCPData Source: Google Cloud PlatformUse Case: Threat DetectionTactic: Privilege EscalationTactic: PersistenceResources: Investigation Guide
Raw Content
[metadata]
creation_date = "2026/07/10"
integration = ["gcp"]
maturity = "production"
updated_date = "2026/07/10"
[rule]
author = ["Elastic"]
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.
"""
false_positives = [
"""
In-cluster controllers, operators, and CI jobs may legitimately reconcile RBAC manifests. Baseline known automation
service accounts before tuning.
""",
]
from = "now-6m"
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE Service Account Modified RBAC Objects"
note = """## Triage and analysis
### 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`, and `gcp.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.
"""
setup = "The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule."
references = [
"https://kubernetes.io/docs/reference/access-authn-authz/rbac/",
"https://heilancoos.github.io/research/2025/12/16/kubernetes.html#overly-permissive-role-based-access-control",
]
risk_score = 47
rule_id = "c41e9854-3df3-465a-8234-4d625084ff86"
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: Kubernetes",
"Data Source: GCP",
"Data Source: Google Cloud Platform",
"Use Case: Threat Detection",
"Tactic: Privilege Escalation",
"Tactic: Persistence",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
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"
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.006"
name = "Additional Container Cluster Roles"
reference = "https://attack.mitre.org/techniques/T1098/006/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.006"
name = "Additional Container Cluster Roles"
reference = "https://attack.mitre.org/techniques/T1098/006/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[rule.investigation_fields]
field_names = [
"@timestamp",
"client.user.email",
"source.ip",
"user_agent.original",
"event.action",
"event.outcome",
"gcp.audit.resource_name",
"gcp.audit.request.kind",
"data_stream.namespace",
]