Interview Prep/DevSecOps/Container and IaC Security

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 →

  1. Tag with an immutable version or commit SHA, and enable tag immutability in the registry (ECR imageTagMutability=IMMUTABLE).
  2. Deploy by digest: image: registry.example.com/myapp@sha256:....
  3. Enforce with a Kyverno policy that rejects :latest and tags without digest.
  4. 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.

All DevSecOps questions Roadmap: Policy as code

More on Container and IaC Security