Container Security for DevSecOpss
Container security reduces the risk in images and running containers. It covers using minimal, trusted base images, scanning images for vulnerable packages, avoiding secrets in layers, running as non-root with dropped capabilities, signing images and monitoring runtime behaviour so that a compromised container has little to exploit.
Stage: Cloud, Containers and Runtime · Part of the DevSecOps roadmap · Last reviewed 19 November 2026
What to learn in Container Security
- Choose minimal or distroless base images and explain the benefit
- Scan an image with Trivy or Grype and interpret results
- Keep secrets out of image layers using build secrets
- Run with a read-only root filesystem and dropped capabilities
- Sign images with Cosign and verify before deployment
- Rebuild images regularly to pick up patched base layers
Container Security interview questions
Why can secrets in Dockerfiles be dangerous?
Every instruction creates a layer stored in the image, so a secret copied or exported in one step remains retrievable even if later deleted. Use build secrets, runtime injection or a secrets manager, and rotate any secret that was exposed.
What does a distroless image offer?
A distroless image contains the application and its runtime dependencies but no shell or package manager. That shrinks the attack surface and the number of vulnerable packages, though debugging is harder, so teams use ephemeral debug containers.
Where Container Security fits in the DevSecOps roadmap
Container Security belongs to the Cloud, Containers and Runtime stage (intermediate level), which takes about 6 hours. Harden where it runs.
Other units in this stage
Back to the full DevSecOps roadmap