Why should you "build once, promote the same artifact" across environments?
IntermediateScenarioSupply Chain Security
Answer
Situation read → Rebuilding per environment means production runs something that was never tested or scanned.
What I'd do →
- Build and push one image tagged with commit SHA, record the digest.
- Scan, sign and attest it once.
- Promote by deploying the same digest through dev, staging and prod via GitOps PRs.
- Keep environment differences in config, not in builds.
- Admission policy checks the signature in every environment.
Why → What you tested and signed is exactly what runs in production.
Interview tip → Rebuilding for prod breaks the chain of evidence.
More on Supply Chain Security
What is an SBOM, and at which point in the pipeline do you generate it?BeginnerA customer asks for an SBOM for your product. What do you give them?BeginnerHow do you sign container images in GitHub Actions without managing private keys?IntermediateYou signed images in CI. How do you make sure the cluster only runs signed images?IntermediateLeadership wants "SLSA compliance". What do you propose?IntermediateWhat is typosquatting and how do you protect developers from it?Beginner