Interview Prep/DevSecOps/Kubernetes Security

Falco alerts "Terminal shell in container" on a production payments pod at 3 a.m. Walk through your response.

IntermediateScenarioKubernetes Security
Answer

Situation read → Could be an engineer debugging or an attacker with RCE. Verify fast, preserve evidence.

What I'd do →

  1. Check the alert fields: user, command line, parent process, pod and node.
  2. Check audit logs for a matching pods/exec by a known human: if found, confirm with that person.
  3. If no exec in audit logs, the shell came from inside the app: treat it as RCE.
  4. Isolate: apply a deny-all NetworkPolicy to the pod label, cordon the node, but do not delete the pod yet.
  5. Capture evidence (process list, network connections, container filesystem diff), then rotate the pod's secrets and redeploy from a known-good image.

Why → Audit logs tell you if the shell came through the API or from an exploit.

Interview tip → "Isolate, don't delete" keeps evidence for forensics.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security