PIVTR-D
RAWS playbook · Compute and containers

EKS cluster compromise

The attacker reaches the cluster through an exposed workload, a stolen kubeconfig or an IAM principal mapped into Kubernetes role-based access control (RBAC). A typical run opens a shell in a pod, reads Kubernetes secrets, and calls AWS with the pod's role from IAM roles for service accounts (IRSA) or Pod Identity, or with the node role. Save the cluster's access configuration and turn on control plane logging first, because audit logs start only when you enable them.

Look here

LogSearch for
EKS audit and authenticator logs (CloudWatch Logs)Control plane audit and sign-in records, empty until the log types are enabled: group /aws/eks/<cluster>/cluster, streams kube-apiserver-audit-* and authenticator-*
Logs Insights, aws-authChanges to the aws-auth ConfigMap: filter @logStream like "kube-apiserver-audit" | filter verb in ["update", "patch"] | filter objectRef.name = "aws-auth"
Logs Insights, shellsShells opened in pods: filter objectRef.subresource = "exec"
CloudTrail, EKS APIChanges to cluster access and configuration: UpdateClusterConfig, CreateAccessEntry, AssociateAccessPolicy, CreatePodIdentityAssociation
CloudTrail, pod credentialsPod role credentials used from source IPs outside the VPC: AssumeRoleWithWebIdentity (IRSA) and AssumeRoleForPodIdentity (Pod Identity). For the node role, see Stolen EC2 instance role credentials
GuardDuty EKS Protection, audit monitoringFindings from audit monitoring, which needs no control plane logging: CredentialAccess:Kubernetes/AnomalousBehavior.SecretsAccessed, Execution:Kubernetes/AnomalousBehavior.ExecInPod, PrivilegeEscalation:Kubernetes/AnomalousBehavior.WorkloadDeployed!PrivilegedContainer
GuardDuty Runtime MonitoringFindings from the runtime agent, which needs the aws-guardduty-agent add-on and does not cover Fargate. The correlated finding is AttackSequence:EKS/CompromisedCluster. Runtime findings: Execution:Runtime/ReverseShell, PrivilegeEscalation:Runtime/RuncContainerEscape
Cluster settingsEndpoint access and authenticationMode: aws eks describe-cluster --name <cluster>
Access entriesIAM principals with cluster access: aws eks list-access-entries --cluster-name <cluster>
aws-auth ConfigMapIAM principals mapped into RBAC: kubectl describe configmap -n kube-system aws-auth

Contain

#Item
1Save the aws-auth ConfigMap, the access entries and the cluster settings before any change. See Evidence
2Turn on every control plane log type. Logs start at that moment, and the update needs up to five free IP addresses per subnet: aws eks update-cluster-config --name <cluster> --logging '{"clusterLogging":[{"types":["api","audit","authenticator","controllerManager","scheduler"],"enabled":true}]}'
3Close the public API endpoint. To limit it to responder addresses, keep public access on and set publicAccessCidrs=<cidr> in the same option: aws eks update-cluster-config --name <cluster> --resources-vpc-config endpointPublicAccess=false,endpointPrivateAccess=true
4Delete attacker access entries of type STANDARD destructive: aws eks delete-access-entry --cluster-name <cluster> --principal-arn <arn>
5Edit attacker lines out of aws-auth, and deny a compromised IAM principal as in Leaked IAM user access keys
6Apply a deny-all ingress and egress NetworkPolicy to each suspect pod, then relabel the pod so its controller replaces it and its Service stops routing to it: kubectl label pod <pod> --namespace <ns> <key>=quarantine --overwrite
7Capture memory and disks of the node with Compromised EC2 instance, then cordon the node: kubectl cordon <node>
8Revoke older sessions on each IRSA, Pod Identity and node role in use: aws iam put-role-policy --role-name <role> --policy-name AWSRevokeOlderSessions --policy-document file://revoke.json
9Block pods from the node role by setting the metadata hop limit to 1: aws ec2 modify-instance-metadata-options --instance-id <id> --http-tokens required --http-put-response-hop-limit 1
10Stop the compromised workload after capture destructive: kubectl scale deployment <name> --replicas=0 --namespace <ns>

Eradicate and recover

#Item
1Rotate Kubernetes secrets and service account tokens the attacker could read. For AWS secrets in reach, open Stolen Secrets Manager and Parameter Store secrets
2List bindings, DaemonSets and CronJobs, diff them against your manifests, and delete objects created in the window: kubectl get clusterrolebindings,rolebindings,daemonsets,cronjobs --all-namespaces
3Create an access entry for every legitimate principal in aws-auth, then switch the cluster to access entries plus the ConfigMap: aws eks update-cluster-config --name <cluster> --access-config authenticationMode=API_AND_CONFIG_MAP
4Once every principal works through access entries, use access entries only: aws eks update-cluster-config --name <cluster> --access-config authenticationMode=API
5List the Pod Identity associations: aws eks list-pod-identity-associations --cluster-name <cluster>
6Delete each unknown Pod Identity association: aws eks delete-pod-identity-association --cluster-name <cluster> --association-id <id>
7Replace touched nodes destructive from a known-good AMI, with IMDSv2 required and hop limit 1 in the launch template
8Rebuild images from source and check ECR images. Turn on the aws-guardduty-agent add-on
Watch out
  • A pod reaches the node role when the hop limit is 2, and a pod with hostNetwork: true always does. The node role stays available behind IRSA and Pod Identity credentials.
  • A NetworkPolicy restricts nothing until the VPC CNI enableNetworkPolicy feature or another enforcing plugin is on.
  • On a CONFIG_MAP cluster the creator identity has system:masters outside aws-auth, so deny it in IAM. Deleting a non-STANDARD access entry can break the cluster. The authentication mode cannot return to one without access entries.

AWS documentation: EKS control plane logs, access entries, aws-auth, authentication mode, IRSA, Pod Identity; EKS best practices for IAM, auditing and incident response; CLI eks commands; EC2 instance metadata options; VPC CNI network policy; GuardDuty EKS Protection, Runtime Monitoring and attack sequence findings. Checked September 2026.

Adapts material from Dynamic Incident Response: A Framework for Security Teams by Joshua Wright, © 2026 The Escal Institute of Advanced Technologies, Inc. d/b/a SANS Institute, licensed under CC BY 4.0. Figures reproduced under that license. Changes were made. Not published by, endorsed by, or affiliated with the SANS Institute.