How do you prevent a `latest` or unscanned image from reaching the cluster?
AdvancedProductionImage Security & Hardening
Answer
Admission control: Kyverno or OPA Gatekeeper policies that require images from approved registries, pinned by digest, signed by cosign, with a recent scan attestation. Example Kyverno verifyImages rule with the CI's OIDC identity. Pair with ECR repository policies that block pushes without required tags.
More on Image Security & Hardening
Why should containers not run as root, and how do you enforce it?BeginnerWhat is a distroless image and what are the trade-offs?BeginnerHow do you scan an image with Trivy and fail a CI build on serious findings?BeginnerHow do you manage Trivy false positives and accepted risks?IntermediateWhich `docker run` flags make up a hardened runtime baseline?BeginnerWhat does `no-new-privileges` protect against?Beginner