Sub topic 12
What provenance does and does not prove
This chapter assumes you have read the earlier chapters, so you know how a provenance attestation is generated and how gh attestation verify checks it. You should also be comfortable with GitHub Actions permissions and with the idea of a signed digest. Here we look at the limits of what a successful verification tells you, and how to write consumer policy that accounts for them.
What a successful verification establishes
When gh attestation verify exits with status 0, several specific facts hold:
- The file you hold has the SHA-256 digest named in the attestation's subject.
- A signature over that statement was made with a short-lived certificate. Fulcio issued that certificate in exchange for a GitHub Actions OIDC token.
- The certificate names a workflow identity. That identity includes the repository, the workflow file path, the ref, the commit, and the runner type.
- The signing event is recorded in a transparency log, so the signature was made while the certificate was valid.
- The signed predicate says that this workflow run produced the artifact from those inputs.
Verification therefore answers one question: which workflow run claims to have produced this digest? It does not say whether that run, its inputs, or the code it executed were trustworthy.
What provenance does not prove
The source code is not malicious
Provenance links an artifact to a commit. It does not review that commit. If an attacker with write access merges a backdoor, or a maintainer account is taken over, the next release is built from the backdoored commit. It is signed by the legitimate workflow and verifies cleanly. The attestation is accurate: the workflow did build that artifact. Defenses for this threat are code review, branch protection, and rulesets, which sit outside the attestation.
The dependencies are not malicious
The build pulls packages, base images, and actions from elsewhere. A basic provenance statement records the workflow and source commit. It does not vouch for each downloaded package. A poisoned package version installed during npm ci ends up in a correctly attested artifact. An SBOM attestation lists what went in, but a list is not a safety check. You still need lockfiles, hash pinning, and vulnerability scanning.
The workflow itself is trustworthy
The signing identity is only as good as the workflow file at that ref. Anyone who can change the workflow can make it do anything. That includes a step that fetches a prebuilt binary and then attests it. The attestation says "this workflow attested this file", not "this workflow compiled this file from source". Reviewing changes to .github/workflows/ matters as much as reviewing application code.
The build is reproducible
Two builds from the same commit usually produce different bytes, because of timestamps, paths, and tool versions. Provenance does not let a consumer rebuild and compare. It gives you a signed claim, and you cannot independently re-derive it unless the project builds reproducibly.
The artifact is free of vulnerabilities
An attested artifact can contain an old, vulnerable library. Provenance says where something came from, not whether it is safe to run.
Where the trust boundary leaks
Several setups make a valid attestation weaker than it looks.
Self-hosted and persistent runners
On GitHub-hosted runners, each job gets a fresh virtual machine. A self-hosted runner can keep state between jobs. An earlier job, possibly from a less trusted workflow, could leave a modified toolchain on the machine. The certificate records the runner environment, and gh attestation verify can reject self-hosted runners (shown below). This is the main reason that SLSA Build Level 3 needs isolated builds.
Signing step that attests too much
The provenance step signs whatever the subject-path glob matches. If the glob is broad, the job might attest files it never built, such as a downloaded tool or a file written by an earlier step.
# Risky: attests every file under dist/, including anything an earlier step dropped there
- uses: actions/attest-build-provenance@v2
with:
subject-path: 'dist/*'
# Better: attest only the named outputs of this build
- uses: actions/attest-build-provenance@v2
with:
subject-path: |
dist/app-linux-amd64
dist/app-linux-arm64Also keep the attest step close to the build. Every step between build and attestation is a place where the file could change before it is signed.
Untrusted triggers and inputs
Workflows triggered by pull_request_target, workflow_run, or workflow_dispatch with free-form inputs run with more privilege or take outside data. If such a workflow has id-token: write and builds code from a fork or from a script injection, an attacker can obtain a validly signed attestation for hostile output. The certificate then shows that the repository's workflow signed it, which is true and not reassuring. Keep attesting jobs on trusted triggers, such as tag pushes protected by rules, and do not pass untrusted text into run: steps.
Mutable references
The certificate records a ref such as refs/tags/v1.2.0 and also the commit SHA. If a policy checks only the tag name, a deleted and re-pushed tag could point to different code. Prefer to check the commit digest, and use protected tags so release tags cannot be moved.
Caches
A poisoned build cache restored by a trusted workflow can inject content into the build. The provenance records the run, not the cache's origin. Treat cache scope as part of your threat model.
What verification itself can get wrong
The quality of verification depends on the policy the consumer passes. Compare these three commands.
# Weak: any attestation from any workflow in the repository
gh attestation verify dist/app --repo OWNER/REPO
# Stronger: also pin the signing workflow and the release ref
gh attestation verify dist/app --repo OWNER/REPO \
--signer-workflow OWNER/REPO/.github/workflows/release.yml \
--source-ref refs/tags/v1.2.0 \
--deny-self-hosted-runners
# Machine-readable output for a policy script
gh attestation verify dist/app --repo OWNER/REPO \
--signer-workflow OWNER/REPO/.github/workflows/release.yml \
--format jsonThe first command accepts a file built by a test workflow, a nightly workflow, or a feature branch, because all of them are in the repository. Available flags depend on your gh version, so run gh attestation verify --help before relying on a flag in automation.
Other mistakes consumers make:
- Treating a missing attestation as acceptable. If your policy says "verify if an attestation exists", an attacker simply serves an artifact with no attestation. Verification must fail closed.
- Verifying a different file than the one you run. The attestation binds a digest. If you verify a downloaded archive and then run something extracted from a mirror, the check covered nothing relevant. Verify the exact bytes you deploy.
- Verifying a tag instead of a digest for images. A tag can move after you verify it. Resolve to a digest first, verify that digest, and deploy by digest.
- Ignoring the owner.
--owner OWNERaccepts any repository in the organization. That is acceptable for an internal platform and too loose for a single critical component.
Revocation, time, and private repositories
Fulcio certificates last only minutes, so there is no long-lived key to steal or revoke. This avoids a key-management failure. It also means there is no "revoke this attestation" button. If you later discover a build was compromised, existing signatures stay valid and verification continues to pass. Your response must be a separate signal, such as a published advisory, a denylist of digests, or a policy that rejects the affected release.
Verification relies on the transparency log timestamp to show the certificate was valid when the signature was made. For public repositories, entries go to the public Sigstore log. For private repositories, GitHub uses its own Sigstore instance, so a consumer needs access that matches the instance (the CLI handles trusted root retrieval). Offline or air-gapped verification needs the trusted root and the attestation bundle copied in advance.
Which SLSA level you actually have
A single attestation step does not grant a level by itself. The level depends on how the job is set up.
| Setup | What it gives you | Typical gap |
|---|---|---|
| Attest step in the same job that builds, hosted runner | Build Level 2: signed provenance from a hosted build platform | A step in the same job could alter the file before signing. The build can influence the signing step. |
| Build in a reusable workflow that the caller cannot modify, verified by `--signer-workflow` | Build Level 3: the signing material and logic are isolated from the build's own steps | Depends on you actually pinning the reusable workflow identity and ref in policy |
| Self-hosted runner without isolation | Provenance exists, but isolation claims are weak | Persistent state between jobs |
A level is also a claim about one build track. SLSA Build levels say nothing about source review, which belongs to the separate Source track.
Writing a realistic consumer policy
A policy that respects these limits states each expectation explicitly:
- The artifact digest matches what you deploy, and verification fails closed when no attestation exists.
- The repository and the signing workflow path are pinned, not just the owner.
- The ref matches a protected release tag, and the source commit is the one you reviewed.
- Runner type is hosted, unless you have vetted your self-hosted environment.
- Separate controls cover the things provenance omits: branch protection on the source, workflow-file review, dependency pinning, and scanning.
Exercise
A project's release workflow builds on a GitHub-hosted runner, signs with actions/attest-build-provenance, and a consumer verifies with gh attestation verify app --repo OWNER/REPO. A contributor with write access pushes a branch whose workflow downloads a trojaned binary, writes it to dist/app, and runs the same attest step. Will the consumer's check pass if they download that file, and how should the policy change?
Show answer
It can pass. The attestation is valid, and the certificate names a workflow in OWNER/REPO, which is all the weak policy asks for. The policy should add --signer-workflow for the release workflow path and --source-ref for a protected release tag, so a branch workflow is rejected. Protected branches and workflow-file review should also stop the malicious workflow from being merged or run on release refs.
Exercise
Why does a short certificate lifetime not let you revoke an attestation for a build you later find was compromised, and what do you do instead?
Show answer
The certificate expires on its own, but verification uses the transparency log timestamp to prove it was valid at signing time, so old signatures keep verifying. Nothing marks them as bad. You must add a separate signal, such as a published advisory, a denylist of affected digests, or a policy that rejects that release version.