MSBA-360 · Lesson 10 of 12 · 18 min
Artifact attestations and provenance
▶ Video coming soon A video version of this lesson is on the way.
Wilhelmus opened the tenth session with a question nobody could answer. "The container image running the checkout service in production right now: who built it, from which commit, with which workflow?" The deployment record said the image's tag was 2026.11.12. Tags can be moved, so that proved little. The image registry said who had pushed it, which was a service account. Nothing tied the image back to a particular build of a particular commit. "If an attacker had pushed an image with the same tag, we would be running it, and nothing would tell us," he said. The session was about closing that gap.
Provenance
Provenance is a record of where an artifact came from: which source repository and commit it was built from, which build system and workflow built it, when, and with what inputs. Provenance answers the question Wilhelmus asked. It matters because several of the best-known supply chain attacks did not touch source code at all. They compromised the build: an attacker changed what the build system produced, so that a product built from clean source shipped with malicious code inside.
The SLSA framework, Supply-chain Levels for Software Artifacts, describes how much confidence provenance gives. Version 1.0 defines build levels. At Build Level 1, provenance exists. At Build Level 2, provenance is generated and signed by a hosted build platform, so it cannot be forged by the person running the build. At Build Level 3, the build platform also isolates builds from each other and protects the signing material, so that even a compromised build step cannot forge provenance for another build.
Artifact attestations on GitHub
An artifact attestation is GitHub's way of producing signed provenance. A workflow step generates a statement that links an artifact, identified by its cryptographic digest, to the workflow run that produced it: the repository, the commit, the workflow file and its ref, the event that triggered it and other details from the run's identity token. The statement is signed and stored, and anyone with the right access can later check that an artifact matches a genuine attestation.
Signing uses Sigstore, an open source project for signing software without managing long-lived keys. The workflow obtains a short-lived signing certificate tied to its identity using GitHub's OIDC token, signs the statement and discards the key. For public repositories, attestations use the Sigstore public good instance, and the signature is recorded in a public, append-only transparency log, so anyone can audit what was signed. For private and internal repositories, attestations use GitHub's own Sigstore instance, which has no public transparency log, so private build details are not published. GitHub documents attestations for private and internal repositories as available on GitHub Enterprise Cloud; check the current plan list.
GitHub states that attestations generated this way reach SLSA v1.0 Build Level 2. Building in a reusable workflow that isolates the build from the calling workflow, so that the repository using it cannot change the build steps, can reach Build Level 3. GitHub's documentation is careful about one more point: an attestation does not prove an artifact is secure. It proves where the artifact came from. Whether to trust that origin is a policy decision.
Generating attestations
Attestations are generated with GitHub's attestation actions. The workflow needs permission to request an identity token and to write attestations. For a container image, the step takes the image name and digest; for a file such as a binary or package, it takes the file path. The attestation is stored with the repository and, for images, can also be pushed to the container registry next to the image.
name: Build and attest image
on:
push:
branches: [main]
permissions:
contents: read
packages: write
id-token: write
attestations: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: push
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/skerry/checkout:${{ github.sha }}
- uses: actions/attest-build-provenance@v2
with:
subject-name: ghcr.io/skerry/checkout
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: trueSBOM attestations work the same way but bind an SBOM to the artifact instead of build provenance. A step generates an SBOM for the image, as in lesson 9, and an attestation step records that this SBOM describes this digest. A consumer can then retrieve and verify the SBOM for exactly the image they are running, which answers the European customer's question about keeping SBOMs current and trustworthy.
Verifying attestations
An attestation that nobody checks is a receipt in a drawer. Verification uses the GitHub CLI: gh attestation verify takes an artifact, a file path or an image reference, computes its digest, finds matching attestations and checks the signature and certificate. Options say what to require: the owner or repository the artifact must come from and, more strictly, the exact workflow that must have signed it. A check that requires only the owner accepts any workflow in the organization; a check that requires the signer workflow accepts only the release workflow.
# Verify the image deployed to production was built by the release workflow
gh attestation verify oci://ghcr.io/skerry/checkout@sha256:4f1c...e9 \
--owner skerry \
--signer-workflow skerry/platform-workflows/.github/workflows/build-image.ymlVerification belongs where artifacts are used. Skerry put it in two places. The deployment workflow verified every image before releasing it to production, and failed the deployment if verification failed. The Kubernetes clusters ran an admission controller, a component that checks workloads before they start, configured to reject any image without a valid attestation from Skerry's build workflows. GitHub documents using the Sigstore policy controller for this purpose. Even an image pushed directly to the registry by someone with credentials could not run.
Worked problem
What verification catches
An engineer with registry credentials builds the checkout image on his laptop to test a fix and pushes it with the production tag by mistake. What happens at Skerry after attestations are in place?
Show solution
- The image has no attestation, because it was not built by a workflow; or, if he tried to attest it, the attestation could not come from Skerry's release workflow.
- The deployment workflow runs gh attestation verify with the required signer workflow, which fails.
- Even if someone bypassed the deployment workflow, the cluster's admission controller would refuse to start the image.
- The mistake becomes a failed deployment and an alert, not a production incident.
Reusable workflows and stronger provenance
Requiring a specific signer workflow is strongest when that workflow lives in a central repository that application teams cannot change. Skerry moved its image build into a reusable workflow in a platform-workflows repository, protected by rulesets so only the platform team could change it. Every service called it. The attestation therefore recorded that the platform workflow, not the service's own workflow file, had performed the build, which is the isolation SLSA Build Level 3 asks for.
Offline verification and auditors
Some environments cannot reach GitHub when they verify, such as the store terminals' update servers on an isolated network. The CLI can download attestations and the trust material needed to check them, so verification can happen offline. Auditors can also download attestations for a release and check them independently. Ottoline Brisbane-Teale, the internal audit lead, liked that best: the evidence that production ran only code built by the approved pipeline was now cryptographic, not a screenshot of a configuration page.
| Question | Evidence before | Evidence after attestations |
|---|---|---|
| Which commit was this image built from? | A tag name and a deployment note | The commit in a signed provenance statement |
| Which pipeline built it? | Whoever had registry credentials | The signer workflow recorded in the certificate |
| Has the image changed since the build? | Not checked | Digest matches the attested subject |
| What is inside it? | A spreadsheet of libraries | An SBOM attested to the same digest |
Releases and immutability
Attestations pair well with protections on the places artifacts are published. GitHub introduced immutable releases in 2025, so that once a release is published its assets and the tag it points to cannot be changed, and releases carry their own attestation. Container registries support digests that never change, and Skerry's deployment manifests referred to images by digest rather than by tag after this session. A tag is a label that can be moved; a digest is the content itself.
What attestations do not do
Attestations do not make a build safe. If a malicious dependency is in the lock file, the build will faithfully produce and attest an artifact containing it. If an attacker can change the release workflow, the provenance will truthfully say the release workflow built it. That is why provenance sits alongside the other controls in this course: dependency review and Dependabot for what goes in, rulesets and protected reusable workflows for how it is built, and attestations to prove the result came from that process.
Attestations for packages and binaries
Container images are not the only artifacts worth attesting. Skerry published internal npm packages, command-line tools as downloadable binaries, and firmware update bundles for the store terminals. Each can be attested the same way: the workflow computes the file's digest and attests it, and consumers verify the file they downloaded with gh attestation verify and the file path. For npm, the public registry also supports provenance statements generated from GitHub Actions, which show on the package's registry page, so consumers of the two public libraries in skerry-oss could see where each release was built without installing anything.
The firmware bundles mattered most. Terminal firmware was installed by an update server in each store's back office, which had no direct internet access. Wilhelmus's team changed the update server to verify each bundle offline against downloaded trust material before installing it, and to refuse unsigned bundles. That closed a route that had worried Freya for years: anyone who could place a file on the update server could previously have installed it on every terminal in a store.
Managing attestations over time
Attestations accumulate with every build. GitHub stores them with the repository, and they can be listed and inspected in the repository's Actions area and through the API. For long-lived releases, Skerry also downloaded each release's attestations and stored them with the release record, so that verification would still be possible years later, for example during an audit of a terminal model that was still in service. When a repository is deleted, its attestations go with it, so archiving rather than deleting repositories for released products became part of the retention policy.
Rolling out verification safely
Turning on enforcement at deployment can stop production releases if something is misconfigured, so Skerry rolled it out the way it had rolled out dependency review. For two weeks the deployment workflow ran verification and reported the result without failing. Then the admission controller was set to warn rather than reject. Only when both had run cleanly for every service for a week did the team switch them to enforce. The warning period found three services still built by their own old workflows rather than the shared reusable workflow; they were moved before enforcement began.
Explaining provenance to non-engineers
Ottoline asked for a one-paragraph explanation she could put in the audit report, and Wilhelmus's draft became the standard wording: every production artifact is built by an approved workflow in a protected repository; the build produces a signed record of exactly which source and workflow produced it; deployment checks that record and refuses anything without it; and the records are kept with each release. It avoided every technical term in this lesson, which was the point. A control that cannot be explained to an auditor in plain language is hard to rely on.
Attestations at Tidewater
TrailCheck is a public repository, so its attestations would be recorded in the public transparency log and could be verified by anyone, including the app's users. Priya decided to add the build provenance step to TrailCheck's release workflow the following week. It took four lines in the workflow and gave a small team a capability that had once required a dedicated signing infrastructure.
Common mistakes
MistakeGenerating attestations but never verifying them.
InsteadVerify at deployment and, where possible, enforce with an admission controller.
MistakeVerifying only the owner when the release workflow is known.
InsteadRequire the signer workflow so that only the approved pipeline's artifacts pass.
MistakeDeploying images by tag.
InsteadDeploy by digest; tags can be moved to different content.
MistakeTreating an attestation as proof that an artifact is secure.
InsteadIt proves origin; trust in that origin depends on the build process and its inputs.
Summary and key terms
- Provenance records where and how an artifact was built; SLSA build levels describe how trustworthy it is.
- Artifact attestations are signed with Sigstore using short-lived certificates tied to the workflow's identity.
- Public repositories use the public good instance and transparency log; private ones use GitHub's own Sigstore instance.
- Attestations reach SLSA Build Level 2; isolated reusable workflows can reach Build Level 3.
- gh attestation verify checks artifacts against required owners and signer workflows, at deployment or in admission control.
- Provenance
- A record of where and how an artifact was built.
- Artifact attestation
- A signed statement linking an artifact's digest to the workflow run that produced it.
- Digest
- A cryptographic hash that identifies an artifact's exact content.
- SLSA
- Supply-chain Levels for Software Artifacts, a framework of build integrity levels.
- Sigstore
- An open source project for keyless signing with short-lived certificates.
- Transparency log
- A public, append-only record of signatures.
- Admission controller
- A component that checks workloads before they start in a cluster.
- SBOM attestation
- An attestation binding an SBOM to an artifact's digest.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Which SLSA build level do GitHub artifact attestations reach on their own?
Show answer
Build Level 2.
Why require --signer-workflow when verifying?
Show answer
So that only artifacts built by the approved workflow pass, not any workflow in the organization.
Where do attestations for private repositories get signed?
Show answer
On GitHub's own Sigstore instance, without a public transparency log.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.