Skip to content
tezvyn:
Menu

How would you modify CI/CD to generate and sign SLSA provenance?

Source: slsa.devHardHow cards are made

Tests SLSA Build Track L1-L3 architecture. Outline: emit in-toto provenance with builder ID and resolved deps from ephemeral runners; sign via DSSE with Sigstore; publish attestations to registry. Red flag: confusing SBOMs or image signatures with provenance.

What's really being asked

Deep familiarity with the SLSA Build Track specification and the ability to map its requirements onto a real CI/CD architecture. The interviewer wants to see that you understand the difference between provenance (how an artifact was built) and SBOMs or image signatures, that you know why runner isolation matters for L2 and L3, and that you can reason about trust boundaries between the pipeline orchestrator, the build executor, and the artifact consumer.

The full answer

Four layers in order. First, pipeline instrumentation: the pipeline must generate an in-toto attestation containing the builder ID, the source repository and commit SHA, the build definition digest, the resolved dependencies, and the output artifact digest. This should be produced automatically by the build service, not by user-defined steps. Second, runner hardening: for SLSA Build Level 2 the runner must be hosted and ephemeral, and for Level 3 it must be isolated from user control so that build steps cannot tamper with the provenance generation. Third, signing infrastructure: sign the attestation using DSSE and either Sigstore or HSM-backed keys. The signing identity should belong to the build platform, not an individual engineer. Fourth, artifact repository integration: store the signed provenance attestation alongside the artifact or in an attestation store linked by digest, expose verification APIs, and enforce policy checks at deploy time.

The mistakes people make

Confusing an SBOM or a container image signature with SLSA provenance. Provenance describes the build process, not the contents. Another red flag is proposing manual signing steps inside the pipeline or using long-lived self-hosted runners that lack isolation guarantees. Suggesting that the CI YAML itself is sufficient provenance is also incorrect because it does not capture the resolved dependencies or the builder identity.

What usually comes next

How would you achieve Build Level 3 if you currently use self-hosted runners? How do you prevent a compromised dependency from tampering with the provenance? What is your revocation strategy if the build platform signing key is leaked? How do you verify provenance at deployment time in a Kubernetes cluster?

A concrete example

A GitHub Actions workflow reaches SLSA Build Level 3 by using GitHub-hosted runners with an OIDC-issued identity token. The workflow calls a reusable builder that generates an in-toto provenance attestation including the repository, commit, workflow filename, and artifact SHA256. The attestation is signed with Sigstore cosign using the runner's OIDC token. The resulting .intoto.jsonl file is uploaded to GitHub Releases next to the artifact. A consumer policy in Kyverno rejects any container image that lacks a valid attestation signed by that builder identity.

Interview question

Which CI/CD architecture meets SLSA Build Level 3 provenance requirements?

  • a.A reusable builder on a hosted ephemeral runner generates an in-toto attestation, signs it with the platform OIDC identity via Sigstore, and stores it linked to the artifact digestCorrect
  • b.The container image is signed with cosign, dependencies are listed in an SBOM, and the build log is archived as proof of the build process
  • c.A self-hosted runner executes the build, generates the attestation in a user-controlled step, and signs it with an HSM-backed platform key
  • d.A user-defined workflow step creates the attestation from the CI YAML, an engineer signs it with a personal GPG key, and the SBOM is uploaded as the provenance file
Why?

SLSA Build Level 3 requires the build service to automatically generate in-toto provenance on an isolated hosted runner and sign it with the platform's identity, not an individual engineer. Option C tempts with HSM-backed keys, but user-controlled steps on self-hosted runners violate the isolation and automatic generation requirements.

Just read this? Test yourself on what you have been reading.

Read the original → slsa.dev

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles