You must run customer-submitted code in your platform. What isolation do you choose?
AdvancedScenarioContainer and IaC Security
Answer
Situation read → Standard containers share a kernel, which is not a strong enough boundary for hostile code.
What I'd do →
- Use microVMs (Firecracker, Kata Containers) or a user-space kernel (gVisor) through a Kubernetes
RuntimeClass. - Place them on a dedicated node pool with taints.
- Deny egress by default with NetworkPolicy; allow only needed endpoints.
- Set CPU, memory, pid and time limits; short-lived pods.
- No cloud credentials: block IMDS and use no service account token (
automountServiceAccountToken: false).
Why → Defence rests on the smallest possible kernel attack surface plus no useful credentials.
Interview tip → Compare the trade-off: gVisor has syscall overhead, Kata needs virtualisation.
More on Container and IaC Security
A team asks whether to use `ubuntu`, `alpine` or a distroless base image. How do you advise?Beginner`trivy image` shows 300 vulnerabilities in your app image. How do you bring this down?BeginnerA Dockerfile runs the app as root. How do you fix it and prove the fix?IntermediateCheckov fails a Terraform PR because an S3 bucket allows public access. What do you change?BeginnerHow do you set up image scanning so nothing vulnerable reaches production?IntermediateAn image passed scanning three weeks ago and runs in production. A new critical CVE is published today. What happens next?Intermediate