Sub topic 3
Anatomy of a provenance attestation
This chapter assumes you know basic GitHub Actions workflows, what a hash and a digital signature are, and how to use the GitHub CLI. It explains what is inside a provenance attestation, so the later chapters on generating and verifying one make sense.
What an attestation is
An attestation is a signed statement about an artifact. A provenance attestation says where an artifact came from and how it was built. It does not hold the artifact itself. It refers to the artifact by its digest, which is a cryptographic hash of the file's bytes.
The format comes from the in-toto project. Three layers are nested together:
- The statement is the JSON document that says "these subjects have this predicate".
- The envelope wraps the statement and carries the signature. It follows the DSSE format (Dead Simple Signing Envelope).
- The bundle packages the envelope with the certificate and the transparency log proof needed to check it offline. Later chapters cover the certificate and the log.
The statement
A statement has four fields that matter:
| Field | Meaning |
|---|---|
| `_type` | The statement version, for example `https://in-toto.io/Statement/v1`. |
| `subject` | A list of artifacts, each with a name and a digest map. |
| `predicateType` | A URI that says what kind of claim the predicate makes. |
| `predicate` | The claim itself. Its shape depends on `predicateType`. |
The subject is what ties the claim to a real file. When you verify, the tool hashes your file and looks for that digest in the subject list. If you change one byte of the file, the digest no longer matches and verification fails.
Here is a trimmed example of a statement for a file called app. The digest is shortened for readability and the layout is simplified.
{
"_type": "https://in-toto.io/Statement/v1",
"subject": [
{
"name": "app",
"digest": { "sha256": "9f2c...e41a" }
}
],
"predicateType": "https://slsa.dev/provenance/v1",
"predicate": {
"buildDefinition": {
"buildType": "https://actions.github.io/buildtypes/workflow/v1",
"externalParameters": {
"workflow": {
"ref": "refs/tags/v1.2.0",
"repository": "https://github.com/OWNER/REPO",
"path": ".github/workflows/build.yml"
}
},
"resolvedDependencies": [
{
"uri": "git+https://github.com/OWNER/REPO@refs/tags/v1.2.0",
"digest": { "gitCommit": "3b1d...07c2" }
}
]
},
"runDetails": {
"builder": { "id": "https://github.com/OWNER/REPO/.github/workflows/build.yml@refs/tags/v1.2.0" },
"metadata": { "invocationId": "https://github.com/OWNER/REPO/actions/runs/123456789/attempts/1" }
}
}
}The SLSA provenance predicate
The predicate type https://slsa.dev/provenance/v1 has two main parts.
buildDefinition describes the inputs to the build:
buildTypenames the kind of build and tells a reader how to interpret the other fields.externalParametersholds the values that triggered the build, such as the workflow file and the Git ref. A consumer should treat these as the facts worth checking.resolvedDependencieslists the inputs the build actually used, including the exact source commit.
runDetails describes the execution:
builder.ididentifies the build system or workflow that ran.metadata.invocationIdpoints to the specific run, so you can open it and read its logs.
The key idea is that the predicate answers three questions: which source, which build instructions, and which run. A consumer can then compare those answers against what they expect.
What the signature adds
The statement is only a claim until someone signs it. The signature binds the statement to the identity that made it. For GitHub Actions, that identity is the workflow that ran, not a person and not a long-lived key. The next two chapters explain how the OIDC token and Sigstore provide that identity.
Without the signature, anyone could write a JSON file with a convincing builder.id. With it, a verifier can check that the claim came from the named workflow in the named repository.
Common mistakes
- Treating the subject name as the identity. The name is a label. The digest is what matters. Two different files can have the same name.
- Trusting the predicate without checking the signer. Fields such as
repositoryare only as trustworthy as the identity that signed them. - Expecting a hash of the repository. The subject covers the built artifact. The source appears only as a dependency entry with a commit digest.
- Assuming provenance means safe. It records how the artifact was built. It does not say the code is free of bugs or malicious logic.
Exercise
A provenance statement lists a subject with the sha256 digest of app. You download a file named app from a mirror, and its sha256 differs from the digest in the statement. What does verification do, and why does the file name not help?
Show answer
Verification fails. The verifier matches the hash of the file's bytes against the subject digest, and the digests differ, so this file is not the artifact the statement describes. The name app is only a label, and any file can carry it, so a matching name proves nothing.
Exercise
In the SLSA provenance predicate, which section would you read to find the exact source commit used in the build, and which would you read to find the run to inspect in the Actions logs?
Show answer
The exact source commit is in buildDefinition.resolvedDependencies, in the gitCommit digest. The run is identified by runDetails.metadata.invocationId, which points to the specific workflow run.