How do you secure a containerized environment?
⚡
Quick Answer
Use minimal, trusted base images; scan images for vulnerabilities; run as non-root with a read-only filesystem and dropped capabilities; enforce RBAC and network policies in Kubernetes; and manage secrets outside the image.
Detailed Answer
Defense in depth spans build, ship, and run: harden and scan images (Trivy/Grype) and sign them, enforce admission policies (Kyverno/OPA), restrict pod privileges (Pod Security Standards, seccomp), segment traffic with NetworkPolicies, and monitor runtime behavior. Least privilege at every layer is the throughline.
💡
Interview Tip
Structure the answer as build/ship/run defense-in-depth — a checklist framing shows systematic thinking.
containerssecuritykubernetes