Interview Prep/DevSecOps/Supply Chain, SBOM, Signing and Image/IaC Scanning

Show the commands to sign and verify an image with Cosign.

IntermediateConceptSupply Chain, SBOM, Signing and Image/IaC Scanning
Answer
# sign by digest (keyless in CI)
cosign sign --yes registry.example.com/app@sha256:<digest>

# verify, pinning who is allowed to have signed
cosign verify registry.example.com/app@sha256:<digest> \
  --certificate-identity-regexp 'https://github.com/acme/app/.github/workflows/release.yml@refs/tags/.*' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

Always sign and verify the digest, never a mutable tag.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Supply Chain, SBOM, Signing and Image/IaC Scanning