Skip to content
ecdsa.com
Sigstore cosign 2.x/3.xOther tools

Error message

--certificate-identity or --certificate-identity-regexp is required for verification in keyless mode

Also printed as

  • Error: --certificate-identity or --certificate-identity-regexp is required for verification in keyless mode

cosign also requires `--certificate-oidc-issuer` (or `--certificate-oidc-issuer-regexp`); the identity flag is checked first. cosign 1.x accepted keyless verification without these flags.

Sigstore cosign 2.x/3.x — verify / verify-blob / verify-attestation without --key

What it means

Without `--key`, cosign verifies "keyless" signatures: a short-lived certificate from Fulcio binds the signature to an OIDC identity (a CI workflow, an email). A valid keyless signature only proves that *someone* with *some* identity signed — so cosign 2.0 and later require you to say whose signature you accept. The command stops before reading the bundle until you name the expected identity and issuer.

Why it happens

How to fix it

  1. 1.

    Pin the workflow identity and the issuer

    For GitHub Actions the issuer is `https://token.actions.githubusercontent.com` and the identity is the workflow file at a ref.

    bash
    # Artifacts signed in GitHub Actions: identity = workflow file at a ref, issuer = GitHub's OIDC issuer
    cosign verify-blob \
      --bundle app.sigstore.json \
      --certificate-identity "https://github.com/acme/app/.github/workflows/release.yml@refs/tags/v1.4.2" \
      --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
      app.tar.gz
  2. 2.

    Use an anchored regular expression for ranges

    `--certificate-identity-regexp` lets you accept every tag of one workflow. Anchor it, or a fork's workflow may match.

    bash
    # Any release tag of that workflow - anchor the expression
    cosign verify ghcr.io/acme/app:1.4.2 \
      --certificate-identity-regexp '^https://github\.com/acme/app/\.github/workflows/release\.yml@refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$' \
      --certificate-oidc-issuer https://token.actions.githubusercontent.com
  3. 3.

    Read the identity from the certificate

    The Subject Alternative Name of the bundle's certificate is the value to pin — after you decide that this identity is the one you trust.

    bash
    # Read the identity recorded in the signing certificate of a bundle
    jq -r '.verificationMaterial.certificate.rawBytes' app.sigstore.json | base64 -d \
      | openssl x509 -inform DER -noout -ext subjectAltName

Related errors

Browse the full signature error database