How would you detect a container escape or suspicious behaviour inside running containers?
AdvancedScenarioSecurity incidents
Answer
Situation read → Image scanning only covers what you shipped. Runtime detection watches what containers actually do: unexpected shells, writes to system paths, privilege changes.
What I'd do →
- Deploy Falco as a DaemonSet (eBPF driver) or enable GuardDuty EKS Runtime Monitoring.
- Start with high-signal rules: shell spawned in a container, write below
/etcor/usr/bin, reading/etc/shadow, unexpected outbound connections, mounting the host filesystem.
- rule: Shell in production container
condition: spawned_process and container and proc.name in (bash, sh) and k8s.ns.name = "prod"
output: "Shell in container (user=%user.name pod=%k8s.pod.name cmd=%proc.cmdline)"
priority: WARNING
- Route alerts with Falcosidekick to Slack and your SIEM; tune noisy rules for a couple of weeks.
- Reduce what's possible: read-only root filesystem, drop capabilities, seccomp, no host mounts, no privileged pods.
- Define the response: isolate the pod with a NetworkPolicy, snapshot, and replace the node.
Why → Prevention shrinks the attack surface; runtime detection catches what still gets through.
Interview tip → Mention tuning; untuned runtime alerts get ignored within a week.
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?AdvancedYou find pods in your cluster running a crypto miner. What do you do?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?Beginner