Interview Prep/DevSecOps/Kubernetes Security

A cluster's nodes are suddenly at 100% CPU and you find pods running `xmrig` in a namespace nobody owns. How do you respond?

IntermediateScenarioKubernetes Security
Answer

Situation read → Cryptomining is often the first visible sign of a compromise. Find the entry point, not just the miner.

What I'd do →

  1. Save the pod specs: kubectl get pod -n x -o yaml > evidence.yaml, note the creator from audit logs (user.username on the create event).
  2. Isolate with a deny-all NetworkPolicy and scale the workloads down; block the mining pool domains at egress.
  3. Find the entry point: exposed dashboard, anonymous API access, leaked kubeconfig, vulnerable app with RCE, or a compromised CI token.
  4. Revoke the credential used, check for other persistence (DaemonSets, CronJobs, new RBAC bindings, mutating webhooks).
  5. Rebuild affected nodes if any pod was privileged or used hostPath.

Why → Deleting the miner without closing the hole means it is back in an hour.

Interview tip → Mention checking for malicious webhooks and CronJobs as persistence.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security