Skip to content

Lesson 11 of 14 · 14m

Sigstore: Signatures Without Key Files

OIDC-bound ephemeral certs, Fulcio, and the Rekor transparency log make 'this workflow built these bytes' verifiable.

The problem with signatures was always the keys

PGP package signing has existed for decades and protected almost nothing — not because the math failed, but because key management did. Long-lived private keys get lost, stolen, synced to laptops, mailed around. Verification required knowing whose key to trust, which meant web-of-trust rituals nobody performed. The signature ceremony collapsed under its own operations.

Sigstore's answer, GA since October 2022, is to delete the long-lived key. In cosign's keyless flow, your CI workload authenticates via OIDC — a GitHub Actions job token, say, bound to repo:org/repo:ref:refs/tags/v1.4.2. Fulcio, sigstore's CA, issues a short-lived certificate binding that identity to an ephemeral keypair. You sign, then publish the signature, cert, and payload digest to Rekor — an append-only transparency log with a signed tree head. The keypair dies with the job. There is nothing on disk to steal.

Verification becomes concrete:

cosign verify app@sha256:... \
  --certificate-identity-regexp 'https://github.com/org/repo/.github/workflows/release.yml@.*' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

That checks the Fulcio cert chain, the Rekor entry (so the signature event is witnessed and timestamped publicly — silent re-signing or backdating shows), and the claimed identity. Not "is this signed" but "is this signed by the release workflow of this repo." The failure mode is just as useful: a valid signature from refs/heads/main on a branch you didn't release fails the regexp, and unsigned artifacts fail closed.

Where this already runs

npm. Since April 2023, npm publish --provenance on GitHub Actions attaches a sigstore bundle linking the published version to the Actions run. The registry also generates ECDSA signatures over package attestations, and npm audit signatures (npm ≥9) verifies the dist.signatures in your installed tree — a swapped tarball on the CDN fails the check.

PyPI. Trusted Publishers (launched April 2023) let a GitHub Actions job exchange its OIDC token for a short-lived PyPI publish token — no stored API token exists to phish. Combined with PyPI's mandatory 2FA rollout, the "stolen credential publishes malware" class that hit ctx shrinks dramatically. PEP 740 adds index-hosted attestations so the attestation travels with the artifact on the index itself.

Containers. cosign sign pushes signatures as OCI artifacts next to the image; admission controllers (Kyverno, sigstore policy-controller) can refuse unsigned images.

The mechanics worth internalizing: Fulcio's certificate carries the OIDC identity in its SAN — the verify flags match that string, so --certificate-identity-regexp is the whole "who" of the check. Rekor's contribution is witness: an attacker who somehow re-signed can't hide the event, because the log is append-only with a signed tree head — entries are forever, and auditors diff the tree.

The wrong mental model

Two of them. First, "signatures prove safety" — they prove provenance: which identity signed which bytes. event-stream's payload would have passed a signature check; the malicious maintainer had publish rights. Signatures answer "same artifact the builder produced," not "good artifact." Pair them with review and provenance, not worship.

Second, "keyless is weird, give me a real keyfile" — the ephemeral key is the upgrade. A key that exists for ninety seconds inside a CI job is a key that cannot be stolen later, cannot be committed to git by accident, and cannot sign outside its bound OIDC identity.

Practice

  • Sign release artifacts with cosign sign (keyless in CI) and verify in deploy with the identity/issuer flags.
  • npm publish --provenance; PyPI via Trusted Publishers (the official pypa/gh-action-pypi-publish action does it).
  • npm audit signatures periodically on installed trees; gh attestation verify where attestations exist.

The question a signature should answer isn't "trusted key" — it's "this exact workflow produced these exact bytes, publicly witnessed." Sigstore makes that the default instead of a ceremony.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.