AWS EKS Admission Webhook Created or Modified


Description

Detects creation, modification, or deletion of Kubernetes MutatingWebhookConfigurations or ValidatingWebhookConfigurations by non-system identities. Admission webhooks intercept every API request matching their rules before persistence, giving an attacker powerful capabilities: injecting malicious sidecars into every new pod via a mutating webhook, blocking security tooling deployments via a validating webhook, or silently exfiltrating pod specifications to an external server. Webhook manipulation is a stealthy persistence and defense evasion technique because the webhook configuration itself looks benign in kubectl output while actively modifying or intercepting all matching Kubernetes API traffic.

Query · kuery

data_stream.dataset:"aws.eks_audit" and
aws.eks.audit.objectRef.resource:("mutatingwebhookconfigurations" or "validatingwebhookconfigurations") and
aws.eks.audit.verb:("create" or "update" or "patch" or "delete") and
aws.eks.audit.annotations.authorization_k8s_io/decision:"allow" and
user.name:(* and not
  (system\:kube-controller-manager or
  system\:kube-scheduler or
  system\:serviceaccount\:kube-system\:* or
  eks\:* or
  system\:serviceaccount\:cert-manager\:* or
  system\:serviceaccount\:gatekeeper-system\:* or
  system\:serviceaccount\:kyverno\:* or
  system\:serviceaccount\:*\:*-operator)
) and
aws.eks.audit.objectRef.name:(* and not (pod-identity-webhook or vpc-resource-mutating-webhook)) and
not (aws.eks.audit.user.groups:"system:serviceaccounts:flux-system" and aws.eks.audit.objectRef.name:"k8tz")

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 operators and GitOps automation may legitimately install or upgrade admission controllers (e.g. cert-manager, Gatekeeper, Kyverno, service mesh components). Validate change tickets and approved controllers before tuning.

Analyst notes

Investigating AWS EKS Admission Webhook Created or Modified

Admission webhooks can mutate or validate resources before they are persisted. A malicious webhook can inject sidecars, alter securityContext, block defensive workloads, or exfiltrate pod specs. This rule alerts on allowed changes to MutatingWebhookConfiguration and ValidatingWebhookConfiguration objects by identities outside common system patterns.

Possible investigation steps

  • Confirm the webhook resource and operation:
  • aws.eks.audit.objectRef.resource and aws.eks.audit.verb
  • aws.eks.audit.objectRef.name (the webhook configuration name)
  • Attribute the actor and access path:
  • user.name (human vs service account vs node identity)
  • source.ip and user_agent.original
  • In cloud-managed clusters, map the identity to IAM/Entra principal data present in aws.eks.audit.user.extra.*.
  • Extract the webhook destination and review for external exfiltration:
  • aws.eks.audit.requestObject.webhooks.clientConfig.url (suspicious when pointing to the public internet)
  • aws.eks.audit.requestObject.webhooks.clientConfig.service.* (in-cluster service; still validate namespace/name)
  • Review impact-driving webhook settings:
  • failurePolicy (e.g., Ignore can make malicious webhooks stealthier by avoiding obvious outages)
  • namespaceSelector / objectSelector targeting (e.g., excluding kube-system while targeting everything else)
  • rules.operations and rules.resources (e.g., CREATE pods is consistent with broad sidecar injection)
  • sideEffects, timeoutSeconds, matchPolicy, reinvocationPolicy
  • Scope blast radius and follow-on activity:
  • Hunt for pods created/updated after the webhook change that include unexpected containers, initContainers, env vars, volume mounts, or securityContext changes.
  • Check for concurrent RBAC changes, token creation, or secret access from the same identity and source IP.

False positive analysis

  • GitOps upgrades or controller installs can legitimately change admission webhooks. Validate the change against:
  • approved Helm/Git commits, change tickets, and expected controller namespaces
  • known controller identities (cert-manager, Gatekeeper, Kyverno, service mesh controllers)

Response and remediation

  • If unauthorized, revert or delete the webhook configuration from a known-good source (GitOps/Helm), then block the actor identity and rotate any credentials it used.
  • If the webhook targeted pod creation, assume workload impact: identify affected namespaces/workloads, redeploy from trusted manifests/images, and validate that new pods are no longer being mutated.
  • If an external clientConfig.url was used, treat it as potential data exfiltration and review egress/DNS logs for the destination around the alert window.
Raw source AWS EKS Admission Webhook Created or 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/21"

[rule]
author = ["Elastic"]
description = """
Detects creation, modification, or deletion of Kubernetes MutatingWebhookConfigurations or
ValidatingWebhookConfigurations by non-system identities. Admission webhooks intercept every API request matching their
rules before persistence, giving an attacker powerful capabilities: injecting malicious sidecars into every new pod via
a mutating webhook, blocking security tooling deployments via a validating webhook, or silently exfiltrating pod
specifications to an external server. Webhook manipulation is a stealthy persistence and defense evasion technique
because the webhook configuration itself looks benign in kubectl output while actively modifying or intercepting all
matching Kubernetes API traffic.
"""
false_positives = [
    """
    Cluster operators and GitOps automation may legitimately install or upgrade admission controllers (e.g.
    cert-manager, Gatekeeper, Kyverno, service mesh components). Validate change tickets and approved controllers before
    tuning.
    """,
]
from = "now-9m"
index = ["logs-aws.eks_audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS EKS Admission Webhook Created or Modified"
note = """## Triage and analysis

### Investigating AWS EKS Admission Webhook Created or Modified
Admission webhooks can mutate or validate resources before they are persisted. A malicious webhook can inject sidecars,
alter securityContext, block defensive workloads, or exfiltrate pod specs. This rule alerts on allowed changes to
MutatingWebhookConfiguration and ValidatingWebhookConfiguration objects by identities outside common system patterns.

### Possible investigation steps

- Confirm the webhook resource and operation:
  - aws.eks.audit.objectRef.resource and aws.eks.audit.verb
  - aws.eks.audit.objectRef.name (the webhook configuration name)
- Attribute the actor and access path:
  - user.name (human vs service account vs node identity)
  - source.ip and user_agent.original
  - In cloud-managed clusters, map the identity to IAM/Entra principal data present in aws.eks.audit.user.extra.*.
- Extract the webhook destination and review for external exfiltration:
  - aws.eks.audit.requestObject.webhooks.clientConfig.url (suspicious when pointing to the public internet)
  - aws.eks.audit.requestObject.webhooks.clientConfig.service.* (in-cluster service; still validate namespace/name)
- Review impact-driving webhook settings:
  - failurePolicy (e.g., Ignore can make malicious webhooks stealthier by avoiding obvious outages)
  - namespaceSelector / objectSelector targeting (e.g., excluding kube-system while targeting everything else)
  - rules.operations and rules.resources (e.g., CREATE pods is consistent with broad sidecar injection)
  - sideEffects, timeoutSeconds, matchPolicy, reinvocationPolicy
- Scope blast radius and follow-on activity:
  - Hunt for pods created/updated after the webhook change that include unexpected containers, initContainers, env vars,
    volume mounts, or securityContext changes.
  - Check for concurrent RBAC changes, token creation, or secret access from the same identity and source IP.

### False positive analysis

- GitOps upgrades or controller installs can legitimately change admission webhooks. Validate the change against:
  - approved Helm/Git commits, change tickets, and expected controller namespaces
  - known controller identities (cert-manager, Gatekeeper, Kyverno, service mesh controllers)

### Response and remediation

- If unauthorized, revert or delete the webhook configuration from a known-good source (GitOps/Helm), then block the
  actor identity and rotate any credentials it used.
- If the webhook targeted pod creation, assume workload impact: identify affected namespaces/workloads, redeploy from
  trusted manifests/images, and validate that new pods are no longer being mutated.
- If an external clientConfig.url was used, treat it as potential data exfiltration and review egress/DNS logs for the
  destination around the alert window."""
risk_score = 47
rule_id = "82f48bb2-bb1b-582b-8cf5-c8172f1e3da9"
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 = "medium"
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: Persistence",
    "Tactic: Defense Evasion",
    "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:("mutatingwebhookconfigurations" or "validatingwebhookconfigurations") and
aws.eks.audit.verb:("create" or "update" or "patch" or "delete") and
aws.eks.audit.annotations.authorization_k8s_io/decision:"allow" and
user.name:(* and not
  (system\:kube-controller-manager or
  system\:kube-scheduler or
  system\:serviceaccount\:kube-system\:* or
  eks\:* or
  system\:serviceaccount\:cert-manager\:* or
  system\:serviceaccount\:gatekeeper-system\:* or
  system\:serviceaccount\:kyverno\:* or
  system\:serviceaccount\:*\:*-operator)
) and
aws.eks.audit.objectRef.name:(* and not (pod-identity-webhook or vpc-resource-mutating-webhook)) and
not (aws.eks.audit.user.groups:"system:serviceaccounts:flux-system" and aws.eks.audit.objectRef.name:"k8tz")
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"


[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"


[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

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.