Kubernetes RBAC Wildcard Elevation on Existing Role

Last updated 6 days ago on 2026-04-27
Created 6 days ago on 2026-04-27

About

Flags an existing Role or ClusterRole being changed (patch or update) so the effective rules become cluster-admin-like: wildcard on every API resource and wildcard on every verb. That is usually a deliberate privilege expansion, not a typo. RequestResponse audit and the response body are required so the detection reads the merged role after apply; loopback source IPs are ignored.
Tags
Data Source: KubernetesDomain: KubernetesUse Case: Threat DetectionTactic: Privilege EscalationLanguage: esql
Severity
high
Risk Score
73
MITRE ATT&CK™

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

False Positive Examples
Platform installers, GitOps controllers, and emergency break-glass roles sometimes ship or widen wildcard ClusterRoles; correlate with change records and narrow by user or service account when baselined.
License
Elastic License v2(external, opens in a new tab or window)

Definition

Integration Pack
Prebuilt Security Detection Rules
Related Integrations

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

Query
text code block:
from logs-kubernetes.audit_logs-* metadata _id, _index, _version | where kubernetes.audit.objectRef.resource in ("roles", "clusterroles") and kubernetes.audit.verb in ("update", "patch") and `kubernetes.audit.annotations.authorization_k8s_io/decision` == "allow" and kubernetes.audit.level == "RequestResponse" and kubernetes.audit.stage == "ResponseComplete" and kubernetes.audit.sourceIPs is not null and not kubernetes.audit.sourceIPs in ("::1", "127.0.0.1") and KQL(""" kubernetes.audit.responseObject.rules.verbs:"*" and kubernetes.audit.responseObject.rules.resources:"*" """) | keep user.name, user_agent.original, event.action, source.ip, kubernetes.audit.verb, kubernetes.audit.objectRef.resource, kubernetes.audit.objectRef.name, kubernetes.audit.requestURI, kubernetes.audit.user.username, kubernetes.audit.user.groups, `kubernetes.audit.annotations.authorization_k8s_io/decision`, event.original, _id, _version, _index, data_stream.namespace

Install detection rules in Elastic Security

Detect Kubernetes RBAC Wildcard Elevation on Existing 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).