Keyless `cosign verify` fails: `none of the expected identities matched what was in the certificate`
IntermediateTroubleshootingSupply chain: signing, SBOM and dependencies
Answer
Likely causes → --certificate-identity does not exactly match the Fulcio cert SAN, which for GitHub Actions is the workflow ref, e.g. https://github.com/acme/api/.github/workflows/release.yml@refs/tags/v1.4.0, or the issuer is wrong.
Diagnose →
cosign verify ghcr.io/acme/api@sha256:... \
--certificate-identity-regexp '.*' --certificate-oidc-issuer-regexp '.*' -o json \
| jq -r '.[0].optional | {Issuer, Subject}'
Fix → Use the real values, with a constrained regexp for tags:
cosign verify ghcr.io/acme/api@sha256:... \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity-regexp '^https://github.com/acme/api/.github/workflows/release.yml@refs/tags/v.*$'
Prevent → Keep the identity in one policy file used by CI verification and the admission controller. Never ship the .* debug regexps.
More on Supply chain: signing, SBOM and dependencies
`cosign verify` fails with `Error: no matching signatures` for an image CI says it signedBeginner`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 imageAdvancedAfter enabling signature verification, pods fail because the manifest uses `image: api:1.4` and the policy mutates it to a digest the registry rejectsAdvanced