`cosign sign` in GitHub Actions fails with `getting signer: getting key from Fulcio: ... no OIDC token`
BeginnerTroubleshootingSupply chain: signing, SBOM and dependencies
Answer
Likely causes → The job lacks id-token: write, so it cannot request the GitHub OIDC token for keyless signing.
Diagnose → Check permissions: and that ACTIONS_ID_TOKEN_REQUEST_URL is set in the job env.
Fix →
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: sigstore/cosign-installer@v3
- run: cosign sign --yes ghcr.io/acme/api@${{ steps.build.outputs.digest }}
Prevent → Grant id-token: write only to the release job, not workflow-wide.
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`IntermediateKey-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