Interview Prep/DevSecOps/Supply chain: signing, SBOM and dependencies

`cosign verify` fails with `Error: no matching signatures` for an image CI says it signed

BeginnerTroubleshootingSupply chain: signing, SBOM and dependencies
Answer

Likely causes → CI signed a different digest (the tag was re-pushed after signing), signed a per-platform manifest while you verify the index, or pushed the signature to a different repo (COSIGN_REPOSITORY).

Diagnose →

crane digest ghcr.io/acme/api:1.4
cosign tree ghcr.io/acme/api:1.4
cosign triangulate ghcr.io/acme/api:1.4   # where cosign looks for the .sig

Fix → Sign by digest straight after push using the digest output of the build step:

cosign sign --yes ghcr.io/acme/api@${DIGEST}

Verify the same digest.

Prevent → Never sign tags; pass steps.build.outputs.digest through the pipeline and deploy by digest.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Supply chain: signing, SBOM and dependencies