How do you attach scan and test results to an image so later stages can verify them?
IntermediateScenarioSupply Chain Security
Answer
Situation read → Evidence should travel with the artifact and be verifiable, so deploy-time policy can use it.
What I'd do →
- Produce the result predicate:
trivy image --format cosign-vuln -o vuln.json app@sha256:.... - Attach it:
cosign attest --yes --predicate vuln.json --type vuln app@sha256:.... - At admission, Kyverno
attestationscondition checks the attestation was signed by CI and has no critical findings. - Do the same for SBOM and provenance.
Why → Policy can say "only images with a recent passing scan from our pipeline may run".
Interview tip → Attestations are in-toto statements signed with the same identity.
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