Sub topic 1
Why build provenance matters: threats between source and artifact
Prerequisites
This chapter assumes you can read a basic GitHub Actions workflow (jobs, steps, permissions). It also assumes you know the GitHub CLI and git, and have built and published a binary or container image. You should know what a hash is and what a digital signature proves. No attestation tooling is needed yet. This chapter sets up the problem that later chapters solve.
The gap between source and artifact
Most consumers trust a repository because they can read its code. They run the artifact, though, not the code. An artifact is the file or image produced by a build, such as a binary, a tarball, or a container image. Code review covers the source. Nothing in a plain download tells you that the artifact came from that source.
Between a commit and a published artifact there are several steps, and each one can be attacked:
- Source: a commit lands in the repository.
- Build: a CI job compiles the code, using dependencies and build tools.
- Publish: the result is uploaded to a release page or registry.
- Consume: a user or cluster downloads and runs it.
Common threats
The table lists threats at each step and what a consumer sees when one succeeds.
| Step | Threat | What the consumer sees |
|---|---|---|
| Source | A malicious commit is pushed with stolen credentials, or merged without review | A normal release from the real repository |
| Build | The build runs on a developer laptop, or a CI runner or build step is compromised | A binary that does not match the source |
| Build | A dependency is swapped or a build tool is poisoned | A binary with extra code that is not in the repository |
| Publish | An attacker with registry or release access uploads a different file | A file with the right name but the wrong content |
| Publish | A tag or image tag is moved to point at different content | The same tag now means something else |
The SolarWinds compromise is the standard example of the build-step threat. Attackers altered the build process, so the shipped binaries contained code that never appeared in the source repository. A reviewer reading the repository would not have found it.
What a checksum does and does not tell you
A published checksum, such as a SHA-256 digest next to a download, detects corruption. It does not establish origin. If an attacker can replace the file, they can usually replace the checksum on the same page. A checksum answers "is this the same file as the one listed?" It does not answer "who built this, from which commit, and by which process?"
A plain signature from a maintainer's key helps with origin, but it has its own costs. The key must be stored, rotated, and protected, and a stolen key lets an attacker sign anything. A signature also says who signed, not how the artifact was built.
What build provenance adds
Build provenance is signed metadata that describes how an artifact was produced. A provenance record typically says:
- which artifact it covers, identified by its digest
- which repository and commit it was built from
- which workflow and builder produced it
- which build trigger started it, such as a tag push
A consumer can then check a downloaded file against this record. If the record is signed by a trusted builder, the consumer gets evidence that this exact file came out of a specific workflow run in a specific repository. That narrows the threats above. A file uploaded by hand will have no matching provenance. A file built from a fork or an unexpected workflow will show the wrong repository or workflow name.
Provenance does not make the build trustworthy by itself. It makes the build claim checkable and attributable. Later chapters cover how the claim is signed and what it cannot prove.
Where this tutorial goes next
The next chapters introduce SLSA, a framework that grades build integrity in levels. They then show how GitHub Actions generates signed attestations and how consumers verify them. Keep the threat table in mind. Each later feature maps back to one or more rows.
Exercise
A project publishes a binary and a SHA-256 file on the same release page. An attacker gains write access to the release. Does the checksum protect users, and which question about the binary does build provenance help answer?
Show answer
No. The attacker can replace both files, so the checksum only shows the download matches whatever is listed. Build provenance helps answer which repository, commit and workflow produced this exact file, because the signed record is tied to the file's digest and to the builder's identity rather than to the release page.
Exercise
A maintainer's laptop is used to build a release and upload it. Which row of the threat table does this fall under, and what would a consumer checking provenance for the expected workflow observe?
Show answer
It falls under the build threat of running outside a controlled CI environment. A consumer checking for the expected workflow would find no provenance, or provenance naming a different builder, so the check would fail.