AWS EKS CoreDNS or Kube-DNS Configuration Modified
Detects modifications to the CoreDNS or kube-dns ConfigMap in the kube-system namespace. These ConfigMaps control cluster DNS resolution for all pods. An attacker who modifies the CoreDNS Corefile can redirect internal service DNS names to attacker-controlled IP addresses, enabling man-in-the-middle attacks against the Kubernetes API server, database services, and other internal endpoints. Pods that resolve service names via cluster DNS will transparently connect to the attacker instead of the legitimate service, allowing interception of service account tokens, database credentials, and API traffic. DNS poisoning at the cluster level is particularly dangerous because it affects every pod in every namespace simultaneously and does not require any modification to the victim workloads. CoreDNS configuration changes are rare in normal operations and any unexpected modification should be investigated immediately.
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/09"
8
9[rule]
10author = ["Elastic"]
11description = '''
12Detects modifications to the CoreDNS or kube-dns ConfigMap in the kube-system namespace. These ConfigMaps control
13cluster DNS resolution for all pods. An attacker who modifies the CoreDNS Corefile can redirect internal service
14DNS names to attacker-controlled IP addresses, enabling man-in-the-middle attacks against the Kubernetes API server,
15database services, and other internal endpoints. Pods that resolve service names via cluster DNS will transparently
16connect to the attacker instead of the legitimate service, allowing interception of service account tokens, database
17credentials, and API traffic. DNS poisoning at the cluster level is particularly dangerous because it affects every
18pod in every namespace simultaneously and does not require any modification to the victim workloads. CoreDNS
19configuration changes are rare in normal operations and any unexpected modification should be investigated immediately.
20'''
21false_positives = [
22 '''
23 Cluster administrators may legitimately update CoreDNS configuration for forwarding, stub domains, or cluster DNS
24 troubleshooting. Baseline approved operators and automation identities; tune exclusions for known change pipelines.
25''',
26]
27from = "now-9m"
28index = ["logs-aws.eks_audit-*"]
29language = "kuery"
30license = "Elastic License v2"
31name = "AWS EKS CoreDNS or Kube-DNS Configuration Modified"
32note = '''
33## Triage and analysis
34
35### Investigating AWS EKS CoreDNS or Kube-DNS Configuration Modified
36Identify who performed the change (user.name, groups), from where (source.ip), and which ConfigMap was modified.
37If request/response capture is available, review the changed Corefile content for upstream redirection, wildcard
38rewrites, or unexpected forward/proxy targets.
39
40### Possible investigation steps
41
42- Confirm the actor is authorized to modify kube-system DNS configuration and whether the change aligns with a change window.
43- Review the ConfigMap diff for added rewrite rules, hosts entries, or forwarding to external or unexpected internal IPs.
44- Correlate with follow-on suspicious activity such as secret reads, token minting, or RBAC modifications.
45- Check for cluster-wide symptoms: service connection failures, TLS errors, or sudden endpoint changes across namespaces.
46
47### Response and remediation
48
49- Revert the ConfigMap to a known-good version and restart DNS pods if required by your deployment.
50- Restrict RBAC permissions that allow update/patch/delete on kube-system DNS ConfigMaps and investigate the source identity.'''
51references = [
52 "https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/",
53 "https://coredns.io/plugins/rewrite/",
54]
55risk_score = 73
56rule_id = "f574d1ce-4601-56bd-a456-05390b092e4e"
57setup = '''
58This rule reads EKS control-plane audit logs collected by the AWS integration
59into `logs-aws.eks_audit-*`, where the AWS EKS audit ingest
60pipelines normalize each audit record under `aws.eks.audit.*`.
61
62Enable the `audit` control-plane log type on the EKS cluster, send its
63CloudWatch log group through the AWS integration, and confirm events carry
64`data_stream.dataset: aws.eks_audit` and
65`cloud.provider: aws` before enabling this rule.
66'''
67severity = "high"
68tags = [
69 "Domain: Cloud",
70 "Domain: Containers",
71 "Platform: AWS",
72 "Platform: Kubernetes",
73 "Data Source: AWS",
74 "Data Source: Amazon Web Services",
75 "Data Source: Kubernetes API Server Audit Logs",
76 "Service: AWS EKS",
77 "Use Case: Threat Detection",
78 "Tactic: Impact",
79 "Rule Type: Custom Query (KQL)",
80 "Resources: Investigation Guide",
81 "Profile: Beta",
82]
83timestamp_override = "event.ingested"
84type = "query"
85query = '''
86data_stream.dataset:"aws.eks_audit" and
87aws.eks.audit.objectRef.resource:"configmaps" and
88aws.eks.audit.objectRef.name:"coredns" and
89aws.eks.audit.objectRef.namespace:"kube-system" and
90aws.eks.audit.verb:("update" or "patch" or "delete") and
91aws.eks.audit.annotations.authorization_k8s_io/decision:"allow" and
92not user.name:(
93 system\:serviceaccount\:kube-system\:coredns or
94 system\:node\:* or
95 eks\:*
96)
97'''
98
99[[rule.threat]]
100framework = "MITRE ATT&CK"
101
102[rule.threat.tactic]
103id = "TA0040"
104name = "Impact"
105reference = "https://attack.mitre.org/tactics/TA0040/"
106
107[[rule.threat.technique]]
108id = "T1565"
109name = "Data Manipulation"
110reference = "https://attack.mitre.org/techniques/T1565/"
111
112[[rule.threat.technique.subtechnique]]
113id = "T1565.001"
114name = "Stored Data Manipulation"
115reference = "https://attack.mitre.org/techniques/T1565/001/"
Triage and analysis
Investigating AWS EKS CoreDNS or Kube-DNS Configuration Modified
Identify who performed the change (user.name, groups), from where (source.ip), and which ConfigMap was modified. If request/response capture is available, review the changed Corefile content for upstream redirection, wildcard rewrites, or unexpected forward/proxy targets.
Possible investigation steps
- Confirm the actor is authorized to modify kube-system DNS configuration and whether the change aligns with a change window.
- Review the ConfigMap diff for added rewrite rules, hosts entries, or forwarding to external or unexpected internal IPs.
- Correlate with follow-on suspicious activity such as secret reads, token minting, or RBAC modifications.
- Check for cluster-wide symptoms: service connection failures, TLS errors, or sudden endpoint changes across namespaces.
Response and remediation
- Revert the ConfigMap to a known-good version and restart DNS pods if required by your deployment.
- Restrict RBAC permissions that allow update/patch/delete on kube-system DNS ConfigMaps and investigate the source identity.
References
Related rules
- AWS EKS Admission Webhook Created or Modified
- AWS EKS Authentication Configuration Modified
- AWS EKS Client Certificate Signing Request Created or Approved
- AWS EKS Cluster-Admin Role Binding Created
- AWS EKS Creation of a RoleBinding Referencing a ServiceAccount