Privilege Escalation (TA0004)(external, opens in a new tab or window)
Persistence (TA0003)(external, opens in a new tab or window)
text code block:sequence by user.name with maxspan=5m [any where event.dataset == "kubernetes.audit_logs" and `kubernetes.audit.annotations.authorization_k8s_io/decision` == "allow" and kubernetes.audit.objectRef.resource in ("roles", "clusterroles") and kubernetes.audit.verb in ("create", "update", "patch")] [any where event.dataset == "kubernetes.audit_logs" and `kubernetes.audit.annotations.authorization_k8s_io/decision` == "allow" and kubernetes.audit.objectRef.resource in ("daemonsets", "deployments", "cronjobs") and kubernetes.audit.verb in ("create", "patch") and /* reduce control-plane / bootstrap noise */ not kubernetes.audit.user.groups == "system:masters" ]
Install detection rules in Elastic Security
Detect Kubernetes Sensitive RBAC Change Followed by Workload Modification 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).