A manifest uses `image: myapp:latest`. Why is this a security problem and what do you use instead?
IntermediateScenarioContainer and IaC Security
Answer
Situation read → latest is mutable. You cannot tell what runs, cannot roll back reliably, and cannot link a running pod to a scan or signature.
What I'd do →
- Tag with an immutable version or commit SHA, and enable tag immutability in the registry (ECR
imageTagMutability=IMMUTABLE). - Deploy by digest:
image: registry.example.com/myapp@sha256:.... - Enforce with a Kyverno policy that rejects
:latestand tags without digest. - Let GitOps tooling (Argo CD Image Updater, Renovate) bump digests through PRs.
Why → Digests make deployments reproducible and verifiable.
Interview tip → Signatures and scan results are tied to digests, not tags.
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