T1098.006 Splunk · SPL

Detect Additional Container Cluster Roles in Splunk

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/

SPL Detection Query

Splunk (SPL)
spl
index=kubernetes sourcetype=kube:apiserver:audit OR sourcetype="kube-audit"
| spath input=_raw
| eval verb=lower(coalesce(verb, 'unknown'))
| eval resource=lower(coalesce('objectRef.resource', 'unknown'))
| eval resourceName=coalesce('objectRef.name', 'unknown')
| eval namespace=coalesce('objectRef.namespace', 'cluster-scoped')
| eval username=coalesce('user.username', 'unknown')
| eval sourceIP=coalesce('sourceIPs{}'.'sourceIPs[0]', sourceIPs, 'unknown')
| eval userAgent=coalesce(userAgent, 'unknown')
| eval responseCode=coalesce('responseStatus.code', 0)
| eval requestObject=coalesce(requestObject, '')
| where verb IN ("create", "update", "patch")
| where resource IN ("clusterrolebindings", "rolebindings", "clusterroles", "roles")
| where responseCode >= 200 AND responseCode < 300
| eval IsSensitiveRole=if(match(requestObject, "(?i)(cluster-admin|system:masters|cluster-admin|admin|system:node-admin)"), 1, 0)
| eval IsServiceAccount=if(match(username, "^system:serviceaccount:"), 1, 0)
| eval IsSystemComponent=if(match(username, "^system:") AND NOT match(username, "^system:serviceaccount:"), 1, 0)
| eval IsClusterScoped=if(resource="clusterrolebindings" OR resource="clusterroles", 1, 0)
| where IsSystemComponent=0
| eval RiskScore=IsSensitiveRole*3 + IsClusterScoped*2 + IsServiceAccount
| table _time, verb, resource, resourceName, namespace, username, sourceIP, userAgent, IsSensitiveRole, IsServiceAccount, IsClusterScoped, RiskScore, requestObject
| sort - RiskScore, - _time
high severity medium confidence

Detects Kubernetes RBAC privilege escalation by monitoring API server audit logs for creation or modification of ClusterRoleBindings, RoleBindings, ClusterRoles, and Roles. Assigns a risk score based on sensitivity (binding to cluster-admin), scope (cluster-wide vs namespaced), and subject type (service account). Filters system components to reduce noise. Requires Kubernetes API server audit logs forwarded to Splunk.

Data Sources

Kubernetes API Server Audit Logskube-apiserver auditCloud Provider Kubernetes Audit Logs

Required Sourcetypes

kube:apiserver:auditkube-audit

False Positives & Tuning

  • Legitimate cluster administrators creating or updating RBAC bindings as part of normal operations or infrastructure-as-code deployments (Terraform, Helm, ArgoCD)
  • CI/CD pipelines (GitHub Actions, Jenkins, GitLab CI) that apply RBAC manifests during application deployment
  • Kubernetes operators and controllers (e.g., cert-manager, Prometheus operator) that create their own service account role bindings during installation
  • Cluster upgrades or managed add-on installations by the cloud provider that temporarily create or modify RBAC objects
Download portable Sigma rule (.yml)

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.

  1. 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.

  2. 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].

  3. 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.

  4. 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.

Unlock Pro Content

Get the full detection package for T1098.006 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections