TExcelTAD
Home › Software Supply Chain Security: SBOM, SLSA & Sigstore › Keyless Signing: Fulcio, Rekor & OIDC

Keyless Signing: Fulcio, Rekor & OIDC

Long-lived signing keys are a liability: they must be stored, rotated, protected in CI and revoked when they leak, and a leaked key can sign anything for as long as anyone trusts it. Sigstore's keyless mode replaces the key with an identity: the signer proves who they are through OpenID Connect (a CI workflow's token, or a person's Google/GitHub/Microsoft login), gets a certificate valid for ten minutes, signs, records the signature in a public log, and throws the key away.

"Keyless" is a slight misnomer: there is a key pair, it just lives for one signature.

Note: Keyless signing needs Sigstore's public services (Fulcio, Rekor, the timestamp authority and the TUF root) or a private Sigstore deployment, so the commands in this lesson are shown as non-run samples. The key-pair sessions in the previous lessons exercise the same storage and verification code paths.

The flow

text
 CI job (GitHub Actions, GitLab CI, Buildkite, …)
  1. requests an OIDC token for audience "sigstore"           ── identity provider ──►  JWT: repo, workflow, ref, …
  2. generates an ephemeral key pair (in memory)
  3. sends public key + proof of possession + token  ───────────►  Fulcio (certificate authority)
                                                     ◄───────────  X.509 cert, 10 min validity, SAN = workflow identity,
                                                                    extensions = issuer, repo, commit, trigger, …
  4. signs the artifact digest with the ephemeral key
  5. uploads signature + cert  ─────────────────────────────────►  Rekor (transparency log)
                                                     ◄───────────  log entry: index, inclusion proof, signed timestamp
  6. stores a Sigstore bundle (sig + cert + log entry) next to the artifact; discards the private key

The certificate expires ten minutes later, but the signature stays verifiable forever, because Rekor (or a timestamp authority) proves it was made while the certificate was valid.

Signing and verifying, keyless

bash
# in a GitHub Actions job with  permissions: id-token: write
cosign sign --yes ghcr.io/acme/shop@sha256:4c6f…          # no --key: keyless

# anywhere, later
cosign verify ghcr.io/acme/shop@sha256:4c6f… \
  --certificate-identity "https://github.com/acme/shop/.github/workflows/release.yml@refs/tags/v1.4.2" \
  --certificate-oidc-issuer "https://token.actions.githubusercontent.com"
text
Verification for ghcr.io/acme/shop@sha256:4c6f… --
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - Existence of the claims in the transparency log was verified offline
  - The code-signing certificate was verified using trusted certificate authority certificates

The two flags are the whole security model: which identity (here, a specific workflow file at a specific tag) and which issuer (GitHub's OIDC provider) you trust. Use --certificate-identity-regexp for patterns (any tag of one workflow: ^https://github\.com/acme/shop/\.github/workflows/release\.yml@refs/tags/v), anchored, never .*. Further checks pin certificate extensions: --certificate-github-workflow-repository acme/shop, --certificate-github-workflow-trigger push.

For a person signing on a laptop, the identity is their email and the issuer their login provider (--certificate-identity alice@example.com --certificate-oidc-issuer https://accounts.google.com).

Bundles: what you keep

Whether keyless or not, cosign 3 writes a Sigstore bundle: one JSON document with everything needed to verify offline later. Here is a key-based bundle for a release file (this part runs):

bash · try it yourself
printf 'shop-web 1.4.2 release archive\n' > shop-web-1.4.2.tar.gz
cosign sign-blob --key /opt/keys/cosign.key --signing-config /opt/sigstore/offline-signing-config.json \
  --bundle shop-web-1.4.2.sigstore.json shop-web-1.4.2.tar.gz
jq '{mediaType, verificationMaterial: (.verificationMaterial | keys), messageSignature: (.messageSignature | keys), digest: .messageSignature.messageDigest.algorithm}' shop-web-1.4.2.sigstore.json
cosign verify-blob --key /opt/keys/cosign.pub --insecure-ignore-tlog --bundle shop-web-1.4.2.sigstore.json shop-web-1.4.2.tar.gz
Using payload from: shop-web-1.4.2.tar.gz
Signing artifact...
Wrote bundle to file shop-web-1.4.2.sigstore.json
{
  "mediaType": "application/vnd.dev.sigstore.bundle.v0.3+json",
  "verificationMaterial": [
    "publicKey"
  ],
  "messageSignature": [
    "messageDigest",
    "signature"
  ],
  "digest": "SHA2_256"
}
WARNING: Skipping tlog verification is an insecure practice that lacks transparency and auditability verification for the blob.
Verified OK

A keyless bundle has the same shape, with verificationMaterial holding the certificate and the tlogEntries (log index, integrated time, inclusion proof, signed entry timestamp) instead of a key hint.

Rekor: a transparency log

Rekor is an append-only Merkle tree of signing events, like Certificate Transparency for TLS. Anyone can monitor it. Its value is not secrecy but detectability: if your identity is ever used to sign something you didn't, the entry is public, and tools such as rekor-monitor can alert you. A log entry also fixes when a signature was made.

The model below builds a tiny RFC 6962-style Merkle tree (the hashing Rekor and Certificate Transparency use: leaves are hashed with a 0x00 prefix, inner nodes with 0x01) and checks an inclusion proof: given only an entry, a few sibling hashes and the published root, a verifier can confirm the entry is in the log.

python · try it yourself
import hashlib

def leaf_hash(data: bytes) -> bytes:
    return hashlib.sha256(b"\x00" + data).digest()

def node_hash(left: bytes, right: bytes) -> bytes:
    return hashlib.sha256(b"\x01" + left + right).digest()

entries = [b"sign app@sha256:aaa by release.yml@v1.4.1",
           b"sign app@sha256:bbb by release.yml@v1.4.2",
           b"sign lib@sha256:ccc by publish.yml@v2.0.0",
           b"sign app@sha256:ddd by alice@example.com"]

def build(level):
    levels = [level]
    while len(level) > 1:
        level = [node_hash(level[i], level[i + 1]) for i in range(0, len(level), 2)]
        levels.append(level)
    return levels

levels = build([leaf_hash(e) for e in entries])
root = levels[-1][0]

def proof(index):
    path = []
    for level in levels[:-1]:
        sibling = index ^ 1
        path.append(("L" if sibling < index else "R", level[sibling]))
        index //= 2
    return path

def verify(entry, path, root):
    h = leaf_hash(entry)
    for side, sibling in path:
        h = node_hash(sibling, h) if side == "L" else node_hash(h, sibling)
    return h == root

p = proof(1)
print("root:", root.hex()[:16], "...  proof length:", len(p), "hashes")
print("entry 1 included:          ", verify(entries[1], p, root))
print("altered entry included:    ", verify(b"sign app@sha256:evil by release.yml@v1.4.2", p, root))
print("entry 1 vs a forked root:  ", verify(entries[1], p, hashlib.sha256(b"other").digest()))
root: b2e831ad69e2fd4b ...  proof length: 2 hashes
entry 1 included:           True
altered entry included:     False
entry 1 vs a forked root:   False

The proof grows with the logarithm of the log size (Rekor's shards hold many millions of entries; a proof is a few dozen hashes), and the log operator publishes signed roots ("checkpoints") so that everybody can check they see the same tree.

Key pairs vs keyless

Key pair Keyless
Secret to protect the private key (or KMS access) none long-lived; the CI's OIDC token for minutes
What verifiers pin a public key an identity + issuer
Revocation rotate the key, re-sign, update every verifier nothing to revoke; stop trusting an identity
Works offline / air-gapped yes needs Sigstore services (public or private) at signing; verification can be offline with the bundle and a trusted root
Privacy nothing published identity (repo, workflow, email) is public in Rekor

Prefer keyless for CI signing of public software; use KMS-backed keys where you can't publish identities or can't reach Sigstore (Field Notes).

Test yourself

In keyless signing, why can a signature be verified after the 10-minute certificate has expired?

  1. Certificates are renewed automatically
  2. The transparency log (or a timestamp authority) proves the signature was made while the certificate was valid
  3. cosign ignores expiry
  4. The private key is stored in Rekor

Which two flags express what a verifier trusts in keyless verification?

  1. --key and --cert
  2. --certificate-identity and --certificate-oidc-issuer
  3. --insecure-ignore-tlog and --yes
  4. --type and --policy

What does a Merkle inclusion proof let you check without downloading the whole log?

  1. That the log is complete
  2. That a specific entry is part of the tree with a given root
  3. That the signature is valid
  4. That the artifact is safe