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.