SBOM generated in CI does not match what scanners find in the running image
IntermediateTroubleshootingSupply chain: signing, SBOM and dependencies
Answer
Likely causes → The SBOM came from source (syft dir:.) or the lockfile, not the built image; the image includes OS packages and build-time additions the source SBOM lacks, or the image was rebuilt after SBOM generation.
Diagnose →
syft ghcr.io/acme/api@sha256:... -o cyclonedx-json > image.cdx.json
jq -r '.components[] | "\(.name)@\(.version)"' sbom-ci.cdx.json | sort > a.txt
jq -r '.components[] | "\(.name)@\(.version)"' image.cdx.json | sort > b.txt
diff a.txt b.txt | head
Fix → Generate the SBOM from the final image digest and attach it as an attestation to that digest.
Prevent → One pipeline step: build → push → SBOM by digest → attest → sign, all keyed on the same digest.
More on Supply chain: signing, SBOM and dependencies
`cosign verify` fails with `Error: no matching signatures` for an image CI says it signedBeginnerKeyless `cosign verify` fails: `none of the expected identities matched what was in the certificate`Intermediate`cosign sign` in GitHub Actions fails with `getting signer: getting key from Fulcio: ... no OIDC token`BeginnerKey-based `cosign verify --key cosign.pub` fails after a key rotation for older imagesIntermediate`cosign verify-attestation --type cyclonedx` returns `none of the attestations matched the predicate type`IntermediateKyverno `verifyImages` rejects pods: `failed to verify image ... : no signatures found` for a signed private ECR imageAdvanced