AWS EKS Sensitive RBAC Change Followed by Workload Modification
Detects a sequence where a principal creates or modifies a Role/ClusterRole to include high-risk permissions (e.g., wildcard access or escalation verbs) and then creates or patches a workload resource (DaemonSet, Deployment, or CronJob) shortly after, which may indicate RBAC-based privilege escalation followed by payload deployment. This pattern is often used by adversaries to gain unauthorized access to sensitive resources and deploy malicious payloads.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/08/03"
3integration = ["aws"]
4maturity = "production"
5min_stack_comments = "The AWS integration adds the aws.eks_audit data stream in package 8.9.0, which requires Kibana 9.6.0 or later."
6min_stack_version = "9.6.0"
7updated_date = "2026/10/21"
8
9[rule]
10author = ["Elastic"]
11description = """
12Detects a sequence where a principal creates or modifies a Role/ClusterRole to include high-risk permissions (e.g.,
13wildcard access or escalation verbs) and then creates or patches a workload resource (DaemonSet, Deployment, or CronJob)
14shortly after, which may indicate RBAC-based privilege escalation followed by payload deployment. This pattern is often
15used by adversaries to gain unauthorized access to sensitive resources and deploy malicious payloads.
16"""
17from = "now-6m"
18index = ["logs-aws.eks_audit-*"]
19language = "eql"
20license = "Elastic License v2"
21name = "AWS EKS Sensitive RBAC Change Followed by Workload Modification"
22note = """## Triage and analysis
23
24> **Disclaimer**:
25> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
26
27### Investigating AWS EKS Sensitive RBAC Change Followed by Workload Modification
28This rule detects when a user grants or broadens high-risk permissions in a Role/ClusterRole and then quickly creates or patches a DaemonSet, Deployment, or CronJob, a strong signal of RBAC-driven privilege escalation followed by payload deployment. Attackers often add wildcard access or escalation verbs to a new role, bind it to their identity, then patch a workload to run a malicious container across nodes or on a schedule to establish persistence.
29
30### Possible investigation steps
31
32- Review the Role/ClusterRole change diff to identify newly granted wildcard resources/verbs or escalation permissions (e.g., bind, impersonate, escalate) and determine the effective access increase for the actor.
33- Identify any RoleBinding/ClusterRoleBinding creations or updates around the same time to see whether the modified role was bound to the same principal or a newly created service account.
34- Inspect the subsequent DaemonSet/Deployment/CronJob spec changes for malicious indicators such as new images, added initContainers, elevated securityContext (privileged/hostPID/hostNetwork), hostPath mounts, or suspicious command/args.
35- Correlate pod runtime activity from the modified workload (image pulls, container starts, outbound connections, and access to secrets/configmaps) to confirm execution and scope of impact.
36- Validate the actor’s legitimacy by checking whether the request originated from expected IP/user-agent and whether the identity is associated with approved CI/CD automation or an unusual interactive session.
37
38### False positive analysis
39
40- A platform engineer performing an urgent, legitimate RBAC adjustment (e.g., expanding a Role/ClusterRole for a new feature rollout) and then immediately patching or deploying a DaemonSet/Deployment/CronJob as part of the same change window can match this sequence.
41- A CI/CD pipeline or GitOps-style workflow using a non-system:masters identity may update RBAC manifests and then apply workload updates within minutes during routine releases, producing this pattern without malicious intent.
42
43### Response and remediation
44
45- Immediately revoke or roll back the risky Role/ClusterRole changes and remove any new/updated RoleBinding/ClusterRoleBinding that ties the elevated permissions to the triggering user or service account.
46- Quarantine the modified Deployment/DaemonSet/CronJob by scaling it to zero or deleting it and cordon/drain affected nodes if pods ran privileged, used hostPath mounts, or executed on many nodes.
47- Rotate credentials and access paths exposed through the workload (service account tokens, kubeconfig files, mounted secrets, cloud keys) and invalidate any newly issued tokens tied to the actor.
48- For eradication and recovery, redeploy workloads from trusted Git/registry sources, block the suspicious images/digests in admission controls, and verify no persistence remains via CronJobs, DaemonSets, webhook configurations, or additional RBAC bindings.
49- Escalate to incident response and platform leadership if the RBAC change included wildcard permissions or escalation verbs, if the workload ran privileged/hostNetwork/hostPID, or if sensitive secrets were accessed or exfiltration is suspected.
50- Harden by enforcing least-privilege RBAC, requiring peer approval for RBAC changes, restricting workload mutations via GitOps-only service accounts, and using admission policies to deny privileged pods, hostPath mounts, and unapproved registries."""
51references = [
52 "https://heilancoos.github.io/research/2025/12/16/kubernetes.html#overly-permissive-role-based-access-control",
53]
54risk_score = 47
55rule_id = "ec47ee94-cb26-593f-87b2-ab7037626cb7"
56setup = """This rule reads EKS control-plane audit logs collected by the AWS integration
57into `logs-aws.eks_audit-*`, where the AWS EKS audit ingest
58pipelines normalize each audit record under `aws.eks.audit.*`.
59
60Enable the `audit` control-plane log type on the EKS cluster, send its
61CloudWatch log group through the AWS integration, and confirm events carry
62`data_stream.dataset: aws.eks_audit` and
63`cloud.provider: aws` before enabling this rule.
64"""
65severity = "medium"
66tags = [
67 "Domain: Cloud",
68 "Domain: Containers",
69 "Platform: AWS",
70 "Platform: Kubernetes",
71 "Data Source: AWS",
72 "Data Source: Amazon Web Services",
73 "Data Source: Kubernetes API Server Audit Logs",
74 "Service: AWS EKS",
75 "Use Case: Threat Detection",
76 "Tactic: Privilege Escalation",
77 "Tactic: Persistence",
78 "Rule Type: Event Correlation (EQL)",
79 "Resources: Investigation Guide",
80 "Profile: Beta",
81]
82timestamp_override = "event.ingested"
83type = "eql"
84
85query = '''
86sequence by orchestrator.cluster.name, user.name with maxspan=5m
87 [any where data_stream.dataset == "aws.eks_audit" and
88 `aws.eks.audit.annotations.authorization_k8s_io/decision` == "allow" and
89 aws.eks.audit.objectRef.resource in ("roles", "clusterroles") and
90 aws.eks.audit.verb in ("create", "update", "patch") and
91 not startsWith(user.name, "eks:")]
92 [any where data_stream.dataset == "aws.eks_audit" and
93 `aws.eks.audit.annotations.authorization_k8s_io/decision` == "allow" and
94 aws.eks.audit.objectRef.resource in ("daemonsets", "deployments", "cronjobs") and
95 aws.eks.audit.verb in ("create", "patch") and
96 /* skip controller status writes and HPA / kubectl scale patches */
97 not aws.eks.audit.objectRef.subresource in ("status", "scale") and
98 /* reduce control-plane / bootstrap noise */
99 not aws.eks.audit.user.groups == "system:masters" and
100 not startsWith(user.name, "eks:")
101 ]
102'''
103
104
105[[rule.threat]]
106framework = "MITRE ATT&CK"
107[[rule.threat.technique]]
108id = "T1098"
109name = "Account Manipulation"
110reference = "https://attack.mitre.org/techniques/T1098/"
111[[rule.threat.technique.subtechnique]]
112id = "T1098.006"
113name = "Additional Container Cluster Roles"
114reference = "https://attack.mitre.org/techniques/T1098/006/"
115
116
117
118[rule.threat.tactic]
119id = "TA0004"
120name = "Privilege Escalation"
121reference = "https://attack.mitre.org/tactics/TA0004/"
122[[rule.threat]]
123framework = "MITRE ATT&CK"
124[[rule.threat.technique]]
125id = "T1098"
126name = "Account Manipulation"
127reference = "https://attack.mitre.org/techniques/T1098/"
128[[rule.threat.technique.subtechnique]]
129id = "T1098.006"
130name = "Additional Container Cluster Roles"
131reference = "https://attack.mitre.org/techniques/T1098/006/"
132
133
134
135[rule.threat.tactic]
136id = "TA0003"
137name = "Persistence"
138reference = "https://attack.mitre.org/tactics/TA0003/"
Triage and analysis
Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
Investigating AWS EKS Sensitive RBAC Change Followed by Workload Modification
This rule detects when a user grants or broadens high-risk permissions in a Role/ClusterRole and then quickly creates or patches a DaemonSet, Deployment, or CronJob, a strong signal of RBAC-driven privilege escalation followed by payload deployment. Attackers often add wildcard access or escalation verbs to a new role, bind it to their identity, then patch a workload to run a malicious container across nodes or on a schedule to establish persistence.
Possible investigation steps
- Review the Role/ClusterRole change diff to identify newly granted wildcard resources/verbs or escalation permissions (e.g., bind, impersonate, escalate) and determine the effective access increase for the actor.
- Identify any RoleBinding/ClusterRoleBinding creations or updates around the same time to see whether the modified role was bound to the same principal or a newly created service account.
- Inspect the subsequent DaemonSet/Deployment/CronJob spec changes for malicious indicators such as new images, added initContainers, elevated securityContext (privileged/hostPID/hostNetwork), hostPath mounts, or suspicious command/args.
- Correlate pod runtime activity from the modified workload (image pulls, container starts, outbound connections, and access to secrets/configmaps) to confirm execution and scope of impact.
- Validate the actor’s legitimacy by checking whether the request originated from expected IP/user-agent and whether the identity is associated with approved CI/CD automation or an unusual interactive session.
False positive analysis
- A platform engineer performing an urgent, legitimate RBAC adjustment (e.g., expanding a Role/ClusterRole for a new feature rollout) and then immediately patching or deploying a DaemonSet/Deployment/CronJob as part of the same change window can match this sequence.
- A CI/CD pipeline or GitOps-style workflow using a non-system:masters identity may update RBAC manifests and then apply workload updates within minutes during routine releases, producing this pattern without malicious intent.
Response and remediation
- Immediately revoke or roll back the risky Role/ClusterRole changes and remove any new/updated RoleBinding/ClusterRoleBinding that ties the elevated permissions to the triggering user or service account.
- Quarantine the modified Deployment/DaemonSet/CronJob by scaling it to zero or deleting it and cordon/drain affected nodes if pods ran privileged, used hostPath mounts, or executed on many nodes.
- Rotate credentials and access paths exposed through the workload (service account tokens, kubeconfig files, mounted secrets, cloud keys) and invalidate any newly issued tokens tied to the actor.
- For eradication and recovery, redeploy workloads from trusted Git/registry sources, block the suspicious images/digests in admission controls, and verify no persistence remains via CronJobs, DaemonSets, webhook configurations, or additional RBAC bindings.
- Escalate to incident response and platform leadership if the RBAC change included wildcard permissions or escalation verbs, if the workload ran privileged/hostNetwork/hostPID, or if sensitive secrets were accessed or exfiltration is suspected.
- Harden by enforcing least-privilege RBAC, requiring peer approval for RBAC changes, restricting workload mutations via GitOps-only service accounts, and using admission policies to deny privileged pods, hostPath mounts, and unapproved registries.
References
Related rules
- AWS EKS Service Account Modified RBAC Objects
- AWS EKS Unusual Kubernetes Sensitive Workload Modification
- AWS EKS Authentication Configuration Modified
- AWS EKS Client Certificate Signing Request Created or Approved
- AWS EKS Cluster-Admin Role Binding Created