arthrop0d

Brief articles on varied topics.

CI/CD Artifact Attestation and Signed Provenance

ci/cdcomputer security

An artifact attestation is a signed statement about a build artifact—usually a container image or package—that records where and how it was produced. It lets a deployment system verify not only what it is deploying, but whether that exact artifact came from an approved source and build process.

The statement is commonly called provenance: evidence describing an artifact’s origin and production steps. Standards such as SLSA and in-toto define common shapes for this evidence; signing systems such as Sigstore can protect it from alteration.

The problem it solves

Without provenance, a deployment pipeline often sees only a name such as payments-api:production or payments-api:1.8.3. That name is not a reliable identity. A registry tag can be moved, a package can be replaced, and two builds from different source revisions can receive similar labels.

Even if the artifact is identified by a cryptographic digest, the digest only answers which bytes are these? It does not answer:

An attestation connects those answers to the artifact’s digest. A deployment policy can then reject an artifact that is genuine but came from an unapproved branch, builder, or workflow.

An attestation is evidence about an artifact, not a replacement for the artifact itself and not a guarantee that the software is bug-free.

What the build records

The build first computes the artifact’s digest, a cryptographic hash of its bytes. For an OCI container image, this is the image manifest digest; for a package, it may be the package file’s SHA-256 digest. The digest is the stable identity that the attestation must name. A mutable tag is only a lookup label.

The build also collects facts such as:

A provenance statement might contain data shaped like this:

{
  "_type": "https://in-toto.io/Statement/v1",
  "subject": [
    {
      "name": "registry.example.com/payments-api",
      "digest": { "sha256": "abc123..." }
    }
  ],
  "predicateType": "https://slsa.dev/provenance/v1",
  "predicate": {
    "buildDefinition": {
      "buildType": "https://ci.example/build/container",
      "externalParameters": { "sourceRevision": "7f3c..." }
    },
    "runDetails": {
      "builder": { "id": "https://ci.example/release-builder" },
      "metadata": { "invocationId": "run-1842" }
    }
  }
}

The important relationship is the subject entry: it binds the statement to one exact digest. The rest describes the claimed build. Real statements contain more fields and may use a different schema version.

The CI system then signs the statement. In common designs, the statement is placed in a DSSE envelope, a format that signs both the payload and its declared type, preventing someone from changing the payload while presenting it as a different kind of statement.

The signing key must represent the build system, not an arbitrary user. It may be a long-lived key held by a protected signing service, or a short-lived key associated with the CI job’s identity. In keyless signing, for example, the job obtains a temporary certificate tied to an identity such as a repository and workflow; a verifier checks that identity and the signature’s validity. The attestation is then stored beside the artifact in a registry, an attestation store, or both.

What deployment verifies

Verification starts with the artifact the deployment is about to use. The system resolves its tag to a digest, or receives a digest directly. It retrieves attestations for that digest and verifies the signature before trusting any claims inside the statement.

A typical admission policy checks the following in order:

  1. Signature: Is the attestation intact, and was it signed by a trusted key or CI identity?
  2. Subject: Does the statement name the exact artifact digest being deployed?
  3. Builder: Is the builder an approved production CI environment rather than an untrusted local or test builder?
  4. Source: Does the source repository, branch, and commit satisfy the release policy?
  5. Build conditions: Were required workflow definitions, parameters, dependency rules, and provenance guarantees used?
  6. Freshness and status: Is the attestation valid for the organization’s retention, revocation, and release rules?

For example, a production policy might require that the image digest have a valid attestation signed by the release workflow, with a source commit reachable from the protected main branch. A staging policy might accept attestations from a wider set of builders.

If any check fails, the deployment controller or admission service rejects the artifact—even if the registry can serve it and its image format is valid. This is the source of errors such as “no matching provenance attestation,” “untrusted builder,” or “artifact digest does not match subject.”

What attestation does—and does not—prove

A successful check proves that a trusted signing identity made a claim about those exact bytes and that the claim meets the deployment policy. It does not prove that the source code is safe, that tests were well designed, or that a compromised approved CI environment behaved honestly. Provenance is therefore one control in a release system, alongside source review, dependency checks, isolated builders, and runtime security.

The practical shift is from asking “Does this tag look like the release?” to asking “Is this exact digest backed by signed evidence from the build process we trust?”

← All articles