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 →

  1. 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
  1. Collect evidence: pod spec, image digest, logs, and a node snapshot (EBS) for forensics.
  2. 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.
  3. Check the audit log for who created the pod and which service account it used.
  4. Rotate credentials the attacker could have touched (service account tokens, cloud credentials via IMDS, secrets in that namespace).
  5. Replace the affected nodes rather than cleaning them.
  6. 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.

All Real-World Interview questions Roadmap: Interview readiness

More on Security incidents