Skip to content

Signing and Provenance

github-actions[bot] edited this page Nov 29, 2026 · 1 revision

Last reviewed: 2026-11-28 (key-based Cosign signing and attestation observed in supply-chain lab CI run 46226817429 with no transparency log; keyless and SLSA verifier statements are from upstream documentation only)

Prerequisites: SBOM & dependency analysis ยท Software supply-chain assessment ยท Cryptographic hashes & signed artifacts.

๐ŸŽฏ Purpose

Explain what signatures, attestations and SLSA provenance prove, how to produce and verify them with Sigstore Cosign, and how to write a verification policy that checks more than "a signature exists".

โš™๏ธ Function

Covers keyed and keyless signing, the transparency log, in-toto attestations, the SLSA v1.2 Build and Source tracks, GitHub artifact attestations and slsa-verifier, with each command marked as observed in the lab or taken from upstream documentation.

๐Ÿ† Goal

Let a reader decide which signing model fits, verify an artifact against an explicit identity and predicate type, and avoid treating a valid signature as proof that a build was trustworthy.

๐Ÿ“‹ When To Use

  • Adding signing or provenance to a release pipeline
  • Writing admission or deployment policy that checks signatures
  • Assessing a supplier's claim that releases are "signed" or "SLSA compliant"

๐Ÿ“‹ Table Of Contents


What Each Layer Proves

Layer Answers Does not answer
Digest (SHA-256) Is this the same bytes I recorded? Who produced it, or whether it is safe
Signature Did the holder of this key or identity sign these bytes? How the bytes were built
Attestation (in-toto Statement) Did this signer make this typed claim about this digest? Whether the claim is true
SLSA provenance Which builder, build type and parameters produced the digest Whether the source code is benign, or whether the builder was honest
Policy Do the identity, subject and predicate meet my requirements? Anything you did not write a rule for

A verifier must check each layer. The attestation-layers section of the assessment guide shows the same split as a figure.

Cosign v3 Basics

The lab pinned Cosign v3.1.6 (asset cosign-linux-amd64, SHA-256 318a99ade4156a0c4113aa983b46c0a0830fa7896a096c63121ee47b610a94c6, checked against cosign_checksums.txt). Changes in v3 that affect scripts written for v2, from the Cosign CHANGELOG (v3.0.0 to v3.0.3):

  • The protobuf bundle format (application/vnd.dev.sigstore.bundle.v0.3+json in the lab) is the default, and --bundle is required. Without it, sign-blob and attest-blob return must specify --bundle with --new-bundle-format (from signblob.go and attest_blob.go at v3.1.6; not a lab case).
  • Service URLs come from the TUF-distributed signing config by default. With no network, plain cosign sign-blob --key ... failed while fetching the signing config from tuf-repo-cdn.sigstore.dev (lab case documented-sign-default-needs-sigstore). Online, that config includes the public Rekor log, so a key-based signature is uploaded to the public transparency log unless you say otherwise.
  • --tlog-upload=false is deprecated (v3.0.3 CHANGELOG). When a signing config is in use, which is the v3 default, the source returns --tlog-upload=false is not supported with --signing-config or --use-signing-config (signcommon/common.go at v3.1.6; not a lab case). The supported way to sign without a log is a signing config with no log services (below).

Keyed Signing

Use keys when there is no OIDC identity to bind to (air-gapped builds, offline release ceremonies) or when policy requires an organisation-held key. The key then becomes the thing to protect, rotate and revoke.

# Generate an encrypted key pair (writes cosign.key and cosign.pub)
COSIGN_PASSWORD='<from a secret store>' cosign generate-key-pair

# Signing config with no transparency log or timestamp authority (runs offline)
cosign signing-config create --out no-tlog-signing-config.json

# Sign (lab case signing-sign-blob-no-tlog, rc 0)
cosign sign-blob --yes --key cosign.key \
  --signing-config no-tlog-signing-config.json \
  --bundle artifact.bundle.json artifact.txt

# Verify (lab case signing-verify-blob, rc 0, "Verified OK")
cosign verify-blob --key cosign.pub --bundle artifact.bundle.json \
  --insecure-ignore-tlog=true artifact.txt

Observed in CI:

  • The signing config had empty rekorTlogConfig and tsaConfig, and the bundle's verificationMaterial held only publicKey.
  • A tampered blob and an unrelated public key both failed with invalid signature when validating ASN.1 encoded signature (rc 1).
  • A wrong COSIGN_PASSWORD failed with reading key: decrypt: encrypted: decryption failed (rc 1).
  • Without --insecure-ignore-tlog=true, verify-blob tried to fetch the public trusted root (getting trusted root from TUF for new bundle verification) and failed offline.

Warning

--insecure-ignore-tlog=true prints "Skipping tlog verification is an insecure practice that lacks transparency and auditability verification". It is acceptable only when you deliberately signed without a log, as above. For anything signed against the public log, verify the log entry.

Keyless Signing & The Transparency Log

In keyless signing, per the Sigstore overview, the client creates a one-time key pair, proves its identity with an OpenID Connect (OIDC) token, and the Fulcio certificate authority "issues a short-lived certificate bound to the provided identity and public key". The signature and certificate are recorded in Rekor, "an immutable, append-only ledger". There is no long-lived private key to steal, but the trust question moves to "which identity is allowed to sign".

A keyless verification must pin both the identity and the issuer. From cosign verify-blob --help (v3.1.6):

cosign verify-blob --bundle artifact.sigstore.json \
  --certificate-identity '<expected signer identity>' \
  --certificate-oidc-issuer '<expected OIDC issuer>' artifact.bin

Either --certificate-identity or --certificate-identity-regexp "must be set for keyless flows". For artifacts signed in GitHub Actions the issuer is https://token.actions.githubusercontent.com (GitHub OIDC reference), and cosign verify also accepts --certificate-github-workflow-repository, --certificate-github-workflow-ref, --certificate-github-workflow-trigger and related flags to pin certificate extensions. A loose --certificate-identity-regexp (unanchored, or matching any repository or branch) is a common mistake: it can let another repository or a feature branch sign as you.

Note

Keyless signing and Rekor verification were not exercised in this repository. Both need the public Sigstore services, and the lab runs with no network.

Attestations

An attestation is a signed in-toto Statement: a list of subjects (names and digests), a predicateType and a predicate. Cosign's --type accepts slsaprovenance, slsaprovenance02, slsaprovenance1, link, spdx, spdxjson, cyclonedx, vuln, openvex, custom or a URI.

# Lab case attest-blob-slsa-provenance, rc 0
cosign attest-blob --yes --key cosign.key \
  --signing-config no-tlog-signing-config.json \
  --type slsaprovenance1 --predicate slsa-provenance-predicate.json \
  --bundle attestation.bundle.json artifact.txt

# Lab case attest-verify, rc 0, "Verified OK"
cosign verify-blob-attestation --key cosign.pub \
  --bundle attestation.bundle.json --insecure-ignore-tlog=true \
  --type slsaprovenance1 artifact.txt

Observed in CI:

  • The bundle held a DSSE envelope with payload type application/vnd.in-toto+json. The Statement _type was https://in-toto.io/Statement/v0.1 (not v1), the predicate type https://slsa.dev/provenance/v1, and the subject the artifact's basename and SHA-256.
  • Verifying with --type spdxjson failed: invalid predicate type, expected spdxjson got https://slsa.dev/provenance/v1. Always pass the type you expect.
  • A changed artifact failed with provided artifact digests do not match digests in statement.

Whether --statement with an in-toto v1 Statement changes the _type was not tested.

SLSA v1.2

SLSA v1.2 is the current release (tag v1.2 in slsa-framework/slsa; no later tag existed on 2026-11-28). It adds a Source Track alongside the Build Track.

Build Track

From build-track-basics:

Level Requirement Focus
Build L0 None n/a
Build L1 Provenance showing how the package was built Mistakes, documentation
Build L2 Signed provenance, generated by a hosted build platform Tampering after the build
Build L3 Hardened build platform Tampering during the build

Source Track

From source-requirements:

Level Requirement
Source L1 Use a version control system
Source L2 Preserve change history and generate source provenance
Source L3 Enforce organizational technical controls
Source L4 Require code review (two-party review)

Provenance Format

Per build-provenance, the predicate type is https://slsa.dev/provenance/v1: it carries only the major version and does not change with minor spec versions. Build L1 requires buildDefinition (with buildType and externalParameters) and runDetails (with builder.id). The lab's synthetic predicate has these required fields on example.test values, plus an empty internalParameters, an empty resolvedDependencies and a runDetails.metadata.invocationId.

Important

A level is a property of the build platform and process, not of a JSON file. Anyone can write a provenance predicate by hand, as the lab did, and sign it. That shows the signer made the claim, not that Build L2 or L3 was met.

Verifying Provenance

SLSA's verifying-artifacts page lists what to check: the builder identity (from a trusted root for that builder), the canonical source repository, the buildType, and the externalParameters, so an attacker cannot build the right code on the wrong platform, from a fork, or with injected parameters.

Tools that do this for specific builders (documented upstream, not run here):

  • slsa-verifier v2.7.1: slsa-verifier verify-artifact <artifact> --provenance-path <file>.intoto.jsonl --source-uri github.com/ORG/REPO [--source-tag <tag>]. Only GitHub source URIs are supported. Release assets have no checksums file; checksums are in the repository's SHA256SUM.md. During research an offline run failed at tuf refresh failed, because it needs Sigstore TUF and Rekor.
  • GitHub artifact attestations: gh attestation verify (gh 2.106.0 help) enforces predicate type https://slsa.dev/provenance/v1 by default, requires --owner or --repo, and recommends pinning the signer workflow with --signer-workflow or --cert-identity. If a reusable workflow produced the attestation, that reusable workflow is the signer and you must use --signer-workflow or --signer-repo. --bundle verifies a bundle on disk instead of fetching from the GitHub API.

Verification Policy

Write the policy down before you write the verifier command. For each artifact class, record:

  1. Subject: the digest being deployed, not a tag.
  2. Signer: the public key, or the exact certificate identity and OIDC issuer.
  3. Transparency: whether a log entry is required (it should be for keyless signatures).
  4. Predicate type: the exact URI, such as https://slsa.dev/provenance/v1.
  5. Predicate contents: builder ID, source repository, ref and buildType you accept.
  6. Failure mode: what happens when verification fails or a verifier service is unreachable. A policy that fails open during an outage provides no protection during that outage.

To enforce this at deploy time in Kubernetes, see image-signature admission.


See also

Related Files


โฌ…๏ธ Back to Master Index | ๐ŸŽฏ Role Navigation | Legal Notice


๐Ÿ“„ Source: ContainerSecurity/signing-and-provenance.md | โœ๏ธ Suggest an edit | โฌ…๏ธ Back to Container Security

Clone this wiki locally