AWS EKS Creation or Modification of Sensitive Role

Last updated 2 days ago on 2026-10-21
Created 3 months ago on 2026-08-03

About

Detects the creation or modification of Kubernetes Roles or ClusterRoles that grant high-risk permissions, such as wildcard access or RBAC escalation verbs (e.g., bind, escalate, impersonate), which may enable privilege escalation or unauthorized access within the cluster.
Tags
Domain: CloudDomain: ContainersPlatform: AWSPlatform: KubernetesData Source: AWSData Source: Amazon Web ServicesData Source: Kubernetes API Server Audit LogsService: AWS EKSUse Case: Threat DetectionTactic: PersistenceTactic: Privilege EscalationRule Type: ES|QLProfile: BetaLanguage: esql
Severity
medium
Risk Score
47
MITRE ATT&CK™

Persistence (TA0003)(external, opens in a new tab or window)

Privilege Escalation (TA0004)(external, opens in a new tab or window)

License
Elastic License v2(external, opens in a new tab or window)

Definition

Integration Pack
Prebuilt Security Detection Rules
Related Integrations

aws(external, opens in a new tab or window)

Query
text code block:
FROM logs-aws.eks_audit-* metadata _id, _index, _version | WHERE aws.eks.audit.objectRef.resource in ("roles", "clusterroles") and aws.eks.audit.verb in ("create", "update", "patch") and `aws.eks.audit.annotations.authorization_k8s_io/decision` == "allow" and aws.eks.audit.level == "RequestResponse" and aws.eks.audit.stage == "ResponseComplete" and not aws.eks.audit.sourceIPs in ("::1", "127.0.0.1") and not user.name like "eks:*" and not (user.name == "system:serviceaccount:kube-system:clusterrole-aggregation-controller" and aws.eks.audit.objectRef.name in ("admin", "edit") and event.action == "patch") and ( // using requestObject KQL(""" aws.eks.audit.requestObject.rules.verbs:("*" or "escalate" or "bind" or "impersonate") """) or KQL(""" aws.eks.audit.requestObject.rules.verbs: ("*" or "create" or "patch" or "update") and aws.eks.audit.requestObject.rules.resources:("*" or "clusterroles" or "clusterrolebindings" or "roles" or "rolebindings" or "pods/exec" or "serviceaccounts/token" or "nodes/proxy" or "daemonsets") """) or KQL(""" aws.eks.audit.requestObject.rules.verbs: ("*" or "get" or "list") and aws.eks.audit.requestObject.rules.resources:("*" or "secrets") """) or // using responseObject KQL(""" aws.eks.audit.responseObject.rules.verbs:("*" or "escalate" or "bind" or "impersonate") """) or KQL(""" aws.eks.audit.responseObject.rules.verbs: ("*" or "create" or "patch" or "update") and aws.eks.audit.responseObject.rules.resources:("*" or "clusterroles" or "clusterrolebindings" or "roles" or "rolebindings" or "pods/exec" or "serviceaccounts/token" or "nodes/proxy" or "daemonsets") """) or KQL(""" aws.eks.audit.responseObject.rules.verbs: ("*" or "get" or "list") and aws.eks.audit.responseObject.rules.resources:("*" or "secrets") """) ) | keep user.name, user_agent.original, event.action, source.ip, aws.eks.audit.verb, aws.eks.audit.objectRef.resource, aws.eks.audit.objectRef.name, aws.eks.audit.requestURI, aws.eks.audit.user.username, aws.eks.audit.user.groups, `aws.eks.audit.annotations.authorization_k8s_io/decision`, event.original, _id, _version, _index, data_stream.namespace

Install detection rules in Elastic Security

Detect AWS EKS Creation or Modification of Sensitive Role in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).