AWS EKS CoreDNS or Kube-DNS Configuration Modified


Description

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.

Query · kuery

data_stream.dataset:"aws.eks_audit" and
aws.eks.audit.objectRef.resource:"configmaps" and
aws.eks.audit.objectRef.name:"coredns" and
aws.eks.audit.objectRef.namespace:"kube-system" and
aws.eks.audit.verb:("update" or "patch" or "delete") and
aws.eks.audit.annotations.authorization_k8s_io/decision:"allow" and
not user.name:(
  system\:serviceaccount\:kube-system\:coredns or
  system\:node\:* or
  eks\:*
)

Implementation guide

This rule reads EKS control-plane audit logs collected by the AWS integration into logs-aws.eks_audit-*, where the AWS EKS audit ingest pipelines normalize each audit record under aws.eks.audit.*.

Enable the audit control-plane log type on the EKS cluster, send its CloudWatch log group through the AWS integration, and confirm events carry data_stream.dataset: aws.eks_audit and cloud.provider: aws before enabling this rule.

Known false positives

  • Cluster administrators may legitimately update CoreDNS configuration for forwarding, stub domains, or cluster DNS troubleshooting. Baseline approved operators and automation identities; tune exclusions for known change pipelines.

Analyst notes

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.
Raw source AWS EKS CoreDNS or Kube-DNS Configuration Modified · Elastic TOML
Esc
Published by elastic/detection-rules ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[metadata]
creation_date = "2026/08/03"
integration = ["aws"]
maturity = "production"
min_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."
min_stack_version = "9.6.0"
updated_date = "2026/10/09"

[rule]
author = ["Elastic"]
description = '''
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.
'''
false_positives = [
    '''
    Cluster administrators may legitimately update CoreDNS configuration for forwarding, stub domains, or cluster DNS
    troubleshooting. Baseline approved operators and automation identities; tune exclusions for known change pipelines.
''',
]
from = "now-9m"
index = ["logs-aws.eks_audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS EKS CoreDNS or Kube-DNS Configuration Modified"
note = '''
## 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 = [
    "https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/",
    "https://coredns.io/plugins/rewrite/",
]
risk_score = 73
rule_id = "f574d1ce-4601-56bd-a456-05390b092e4e"
setup = '''
This rule reads EKS control-plane audit logs collected by the AWS integration
into `logs-aws.eks_audit-*`, where the AWS EKS audit ingest
pipelines normalize each audit record under `aws.eks.audit.*`.

Enable the `audit` control-plane log type on the EKS cluster, send its
CloudWatch log group through the AWS integration, and confirm events carry
`data_stream.dataset: aws.eks_audit` and
`cloud.provider: aws` before enabling this rule.
'''
severity = "high"
tags = [
    "Domain: Cloud",
    "Domain: Containers",
    "Platform: AWS",
    "Platform: Kubernetes",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: Kubernetes API Server Audit Logs",
    "Service: AWS EKS",
    "Use Case: Threat Detection",
    "Tactic: Impact",
    "Rule Type: Custom Query (KQL)",
    "Resources: Investigation Guide",
    "Profile: Beta",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:"aws.eks_audit" and
aws.eks.audit.objectRef.resource:"configmaps" and
aws.eks.audit.objectRef.name:"coredns" and
aws.eks.audit.objectRef.namespace:"kube-system" and
aws.eks.audit.verb:("update" or "patch" or "delete") and
aws.eks.audit.annotations.authorization_k8s_io/decision:"allow" and
not user.name:(
  system\:serviceaccount\:kube-system\:coredns or
  system\:node\:* or
  eks\:*
)
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[rule.threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"

[[rule.threat.technique]]
id = "T1565"
name = "Data Manipulation"
reference = "https://attack.mitre.org/techniques/T1565/"

[[rule.threat.technique.subtechnique]]
id = "T1565.001"
name = "Stored Data Manipulation"
reference = "https://attack.mitre.org/techniques/T1565/001/"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.