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

`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.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Supply chain: signing, SBOM and dependencies