You find pods in your cluster running a crypto miner. What do you do?
AdvancedScenarioSecurity incidents
Answer
Situation read → This is a compromise, not a performance issue. Keep evidence, contain without tipping off the attacker more than needed, and find the entry point, or they'll be back.
What I'd do →
- Isolate: apply a deny-all NetworkPolicy to the pod's labels and cordon the node. Don't delete the pod yet.
kubectl cordon ip-10-0-3-17.ap-south-1.compute.internal
kubectl get pod miner-xyz -n default -o yaml > evidence/pod.yaml
- Collect evidence: pod spec, image digest, logs, and a node snapshot (EBS) for forensics.
- Find the entry point. Common ones: an exposed dashboard or kubelet, a leaked kubeconfig or CI token, a vulnerable public app, or a malicious image.
- Check the audit log for who created the pod and which service account it used.
- Rotate credentials the attacker could have touched (service account tokens, cloud credentials via IMDS, secrets in that namespace).
- Replace the affected nodes rather than cleaning them.
- Harden: Pod Security Standards
restricted, only allow images from your registry, block IMDS from pods, and add runtime detection (Falco, GuardDuty EKS Runtime Monitoring).
Why → Deleting the pod without finding the entry point just restarts the cycle.
Interview tip → Mention the Kubernetes audit log to find who created the workload; it shows forensic thinking.
More on Security incidents
An AWS access key for a production IAM user was pushed to a public GitHub repo 20 minutes ago. What do you do in the first 30 minutes?AdvancedA critical CVE is announced in a library you use. You have 200 images across 40 repos. How do you find and patch everything fast?IntermediateGuardDuty reports an EC2 instance talking to a known command-and-control IP. What do you do?AdvancedYou discover an S3 bucket with customer data has been public for three months. What now?IntermediateAn engineer left the company three weeks ago and you find their access key was used yesterday. How do you respond and fix the process?BeginnerA secret was printed in plain text in a CI job log. What do you do?Beginner