Sub topic 2
SLSA in brief: tracks, Build levels, and what they promise
This chapter assumes you have read the previous chapter on supply chain threats. It also assumes you can read a GitHub Actions workflow and know what a hash and a digital signature are. Here you learn what SLSA is, how its Build levels differ, and which level a typical GitHub Actions setup reaches. Later chapters cover the attestation format and the commands.
What SLSA is
SLSA (pronounced "salsa") stands for Supply-chain Levels for Software Artifacts. It is a specification maintained by the Open Source Security Foundation (OpenSSF). It does not scan code or find vulnerabilities. It defines what a producer can claim about how an artifact was made, and how strong the evidence for that claim needs to be.
SLSA gives you a shared vocabulary:
- A producer builds and publishes artifacts.
- A build platform is the system that runs the build, such as GitHub Actions hosted runners.
- A consumer downloads and uses an artifact.
- A verifier is the code or person that checks an artifact against expectations before use.
- Provenance is signed metadata that says what was built, by which platform, from which source, with which inputs.
SLSA also tells you which parts of that chain you must trust. At the levels you can reach with GitHub-hosted runners, you trust the build platform, and you do not have to trust the person who ran the build.
Tracks and levels
SLSA organizes requirements into tracks. Each track covers one part of the supply chain, and each has numbered levels that raise the bar. A higher level means stronger guarantees and stricter requirements.
SLSA v1.0 defined a single track, the Build track. It covers the step from source to artifact, which is the part that build provenance addresses. Later versions of the specification add a Source track for how source revisions are produced and protected. This tutorial covers only the Build track. Check the current specification at slsa.dev for the track list before you cite SLSA in a policy document.
Levels are cumulative. Build Level 2 includes everything Level 1 requires, and Level 3 includes everything Level 2 requires.
The Build levels
| Level | What it requires | What it protects against |
|---|---|---|
| Build L0 | Nothing. No provenance. | Nothing. This is the baseline for most software today. |
| Build L1 | The producer generates provenance that says how the artifact was built. | Mistakes and confusion. You can tell how an artifact was meant to be built. It does not stop a determined attacker, because the provenance can be unsigned and forged. |
| Build L2 | The build runs on a hosted build platform, and that platform generates and signs the provenance. | Tampering after the build. A consumer can check the provenance came from the platform and describes the artifact. |
| Build L3 | The platform also hardens the build. Runs are isolated from each other, and the signing material is not reachable from user-defined build steps. | Tampering during the build. One run cannot influence another, and a build step cannot forge provenance. |
Each level is worth looking at on its own.
Level 1: provenance exists
At L1 the producer records how the artifact was built. The record may be generated by a script the producer writes. It can be unsigned, and it can be wrong. L1 helps with debugging and inventory. A consumer can see which source and which build process the producer says were used. It gives little protection against an attacker, because anyone who can change the build can also change the record.
Level 2: the platform signs the provenance
L2 changes who writes the provenance. The build platform produces it, not the build script, and the platform signs it. A consumer who verifies the signature knows that the platform made the statement. That means the provenance is as honest as the platform, not as honest as the person who triggered the build.
L2 does not stop a malicious or compromised build step from doing the wrong thing during the build. If a step in the workflow swaps the output file, the platform will still faithfully record and sign that file's digest. L2 gives you an accurate record of what happened. It does not guarantee that what happened was safe.
Level 3: the build is hardened
L3 adds two requirements on the platform:
- Isolation between runs. One build cannot affect another, for example through a shared cache that an earlier run could poison.
- Protected signing material. The credentials used to sign provenance must not be accessible to the steps the user defines. Otherwise a step could sign any claim it likes.
At L3 a consumer can trust that the provenance fields describing the build process come from the platform and not from a build script that reports whatever it wants. The user's build steps still run arbitrary code, and they can still produce a bad artifact if the source is bad. L3 limits what a compromised or careless step can forge about the build.
Where the guarantees come from
SLSA separates two ideas that are easy to mix up:
- Provenance authenticity. Can the consumer confirm the provenance was created by the build platform and describes this exact artifact?
- Build integrity. Can the consumer trust that the provenance fields are true, meaning the build really used that source and those parameters?
L2 gives you the first. L3 adds the second for the fields the platform controls. Neither level says anything about whether the source code is trustworthy, whether dependencies are free of vulnerabilities, or whether the build is reproducible.
The diagram shows the part people skip most often. The consumer's verifier needs expectations as its own input. Provenance that nobody checks against anything protects nobody.
Which level does GitHub Actions give you?
GitHub's artifact attestations map onto the Build track as follows:
| Setup | Typical level | Why |
|---|---|---|
| A normal workflow on a GitHub-hosted runner that calls `actions/attest-build-provenance` | Build L2 | GitHub's infrastructure issues the signing identity and the attestation is signed. The attesting step runs in the same job as user-defined steps, so those steps share the job with the signing step. |
| The same build moved into a reusable workflow that the consumer's policy pins | Build L3 | The build logic lives in a separate, controlled workflow, and the consumer verifies that this workflow signed the provenance. |
| A self-hosted runner | Depends on how you operate it | Isolation between runs is your responsibility. A long-lived runner that keeps state between jobs does not give L3 isolation. |
Treat the L3 row as a result of the whole arrangement and not as a property of one action. Chapter 9 explains how the reusable workflow arrangement works and how to verify it.
Three practical consequences follow:
- Moving from no provenance to L2 on GitHub costs one workflow step and two permissions. That is a cheap gain.
- Reaching L3 takes design work. You separate the build definition from the callers and verify the signer workflow, not just the repository.
- The level describes the build pipeline, not a single artifact. If one workflow builds artifacts at L3 and another builds at L2, the consumer must check which workflow produced each one.
What a level does not promise
SLSA levels are easy to over-read. Keep these limits in mind when you describe your pipeline to others.
- A level is not a vulnerability rating. An L3 build of vulnerable code produces a vulnerable artifact with excellent provenance.
- Provenance does not review the source. If an attacker lands a malicious commit in your repository and your workflow builds it, the provenance will honestly say so.
- Provenance does not cover dependencies. It records what the build declared as inputs. It does not mean each dependency was itself built at a given level.
- Provenance does not prove reproducibility. Two builds of the same source can produce different bytes. SLSA does not require reproducible builds.
- Verification is the consumer's job. An L3 claim only counts if someone checks the attestation, and checks it against the right repository and workflow.
Reading a level claim critically
When you see someone claim "we meet SLSA Build L3", ask these questions:
- Which build platform produced the provenance, and who operates it?
- Is the provenance signed, and by what identity?
- Can user-defined steps reach the signing material?
- Are runs isolated from each other, including caches and runner state?
- What does the consumer check, and against which expected values?
If the answers to 1 to 4 are vague, the claim is closer to L1 than L3. If nobody can answer 5, the provenance is decoration.
Choosing a target level
Use the level as a planning tool, not a badge.
- Aim for L2 first on every release pipeline. It is cheap on GitHub-hosted runners and gives consumers a signed record of origin.
- Aim for L3 where the artifact is widely consumed, runs with high privilege, or where you need to show that build steps in a caller workflow cannot forge provenance.
- Write down which verification a consumer should run. A level without a stated verification policy is a promise without a test.
The next chapter looks inside a provenance attestation, so you can see exactly which fields a verifier reads.
Exercise
A team builds a release binary in a normal GitHub Actions workflow on a GitHub-hosted runner. The workflow's last step calls the attestation action, which signs the provenance. A reviewer asks, "Does this prevent a compromised build step in the same job from changing the binary before it is attested?" What is the correct answer, and which Build level does this setup reach?
Show answer
No. A step in the same job can change the binary before the attestation step runs, and the platform will faithfully sign the digest of the changed file. The setup reaches Build L2: the platform generates and signs the provenance, so a consumer can trust the record came from GitHub. It does not reach L3, because the signing step shares the job with user-defined steps. Moving the build into a reusable workflow, and having consumers verify that workflow as the signer, is the path to L3.
Exercise
A vendor says its artifacts are "SLSA Build L3". Name two questions you would ask before you rely on that claim, and one thing the claim still would not tell you.
Show answer
Two good questions are: "Can user-defined build steps access the signing material?" and "Are builds isolated from each other, including caches and runner state?" Other valid ones ask who operates the build platform, or what a consumer is expected to verify. The claim would still not tell you whether the source code or its dependencies are free of vulnerabilities or malicious changes, because SLSA Build levels describe the build process and not the quality of its inputs.