Detect Additional Container Cluster Roles in Google Chronicle
An adversary may add additional roles or permissions to an adversary-controlled user or service account to maintain persistent access to a container orchestration system. For example, an adversary with sufficient permissions may create a RoleBinding or ClusterRoleBinding to bind a Role or ClusterRole to a Kubernetes account. Where ABAC is in use, an adversary may modify a Kubernetes ABAC policy to give the target account additional permissions. This technique may also be used in conjunction with cloud-based RBAC assignments in managed Kubernetes services such as GKE, EKS, and AKS.
MITRE ATT&CK
- Tactic
- Persistence Privilege Escalation
- Technique
- T1098 Account Manipulation
- Sub-technique
- T1098.006 Additional Container Cluster Roles
- Canonical reference
- https://attack.mitre.org/techniques/T1098/006/
YARA-L Detection Query
rule kubernetes_rbac_binding_creation_t1098_006 {
meta:
author = "Argus Detection Engineering"
description = "Detects creation or modification of Kubernetes RBAC role bindings and cluster role bindings, indicating potential persistent access establishment via T1098.006. Covers GKE audit logs and generic Kubernetes audit sources ingested into Chronicle."
mitre_attack_tactic = "Persistence"
mitre_attack_technique = "T1098.006"
mitre_attack_technique_name = "Additional Container Cluster Roles"
severity = "HIGH"
confidence = "MEDIUM"
priority = "HIGH"
platform = "Kubernetes, GKE, EKS, AKS"
created = "2025-01-01"
version = "1.0"
events:
$e.metadata.event_type = "RESOURCE_WRITTEN"
$e.target.resource.type in (
"clusterrolebindings",
"rolebindings",
"clusterroles",
"roles"
)
$e.security_result.action = "ALLOW"
$e.network.http.response_code >= 200
$e.network.http.response_code < 300
$e.network.http.method in ("POST", "PUT", "PATCH")
(
not re.match($e.principal.user.userid, `^system:`)
or re.match($e.principal.user.userid, `^system:serviceaccount:`)
)
condition:
$e
} Chronicle YARA-L 2.0 rule detecting Kubernetes RBAC binding and role creation or modification events. Matches RESOURCE_WRITTEN events against known RBAC resource types with successful HTTP response codes. Filters out kube-system internal components while retaining service account mutations which may indicate workload-level privilege escalation. Designed for GKE audit logs ingested via Cloud Logging and generic Kubernetes audit sources mapped to Chronicle UDM.
Data Sources
Required Tables
False Positives & Tuning
- GKE Autopilot and node auto-provisioning operations that create and bind roles for managed infrastructure components automatically during node pool scaling events
- Google Config Connector, Crossplane, or other cloud resource controllers that create RBAC resources when provisioning cloud-native Kubernetes resources
- Legitimate break-glass or incident response procedures where on-call engineers temporarily grant elevated cluster permissions, which should be tracked via a parallel change management system
Other platforms for T1098.006
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Create Privileged ClusterRoleBinding for Service Account
Expected signal: Kubernetes API server audit log: verb=create, objectRef.resource=clusterrolebindings, objectRef.name=attacker-cluster-admin-binding, responseStatus.code=201. Second audit event for serviceaccounts create. The requestObject will contain roleRef.name=cluster-admin and subjects referencing the service account.
- Test 2Create Namespace-Scoped RoleBinding for External User
Expected signal: Kubernetes API server audit log: verb=create, objectRef.resource=rolebindings, objectRef.namespace=attacker-test-ns, objectRef.name=attacker-ns-admin-binding, responseStatus.code=201. The requestObject includes roleRef.name=admin and subjects with kind=User and [email protected].
- Test 3Modify Existing ClusterRole to Add Wildcard Permissions
Expected signal: Kubernetes API server audit log: verb=patch, objectRef.resource=clusterroles, objectRef.name=attacker-test-role, responseStatus.code=200. The requestObject contains JSON patch operations adding wildcard rules. This differs from 'create' operations and may be missed by detections that only look for verb=create.
- Test 4Create ABAC Policy Entry via ConfigMap Modification
Expected signal: Kubernetes API server audit log: verb=create, objectRef.resource=configmaps, objectRef.name=attacker-abac-policy. If this were a real kube-system ABAC policy modification: verb=update/patch, objectRef.resource=configmaps, objectRef.namespace=kube-system. The ConfigMap data contains ABAC policy JSON granting wildcard permissions.
References (12)
- https://attack.mitre.org/techniques/T1098/006/
- https://kubernetes.io/docs/reference/access-authn-authz/rbac/
- https://kubernetes.io/docs/reference/access-authn-authz/abac/
- https://kubernetes.io/docs/concepts/security/rbac-good-practices/
- https://blog.aquasec.com/leveraging-kubernetes-rbac-to-backdoor-clusters
- https://cloud.google.com/kubernetes-engine/docs/how-to/iam
- https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html
- https://learn.microsoft.com/en-us/azure/aks/concepts-identity
- https://learn.microsoft.com/en-us/azure/aks/monitor-aks
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1098.006/T1098.006.md
- https://www.cncf.io/blog/2021/07/06/practical-approach-to-kubernetes-audit-logging/
- https://cheatsheetseries.owasp.org/cheatsheets/Kubernetes_Security_Cheat_Sheet.html
Unlock Pro Content
Get the full detection package for T1098.006 including response playbook, investigation guide, and atomic red team tests.