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

`cosign verify-attestation --type cyclonedx` returns `none of the attestations matched the predicate type`

IntermediateTroubleshootingSupply chain: signing, SBOM and dependencies
Answer

Likely causes → The attestation was created with a different predicate type (e.g. spdxjson, or a custom URI) or attached to a different digest.

Diagnose →

cosign tree ghcr.io/acme/api@sha256:...
cosign download attestation ghcr.io/acme/api@sha256:... | jq -r '.payload' | base64 -d | jq -r .predicateType

Fix → Verify with the type that was used, or regenerate:

syft ghcr.io/acme/api@sha256:... -o cyclonedx-json > sbom.cdx.json
cosign attest --yes --type cyclonedx --predicate sbom.cdx.json ghcr.io/acme/api@sha256:...

Prevent → Standardise predicate types in the release template.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Supply chain: signing, SBOM and dependencies