Skip to main content
RunBook Academy

Git, CI/CD & GitOpsCVII · Production Infrastructure Delivery ArchitectureArtifact

The artifact flow — from source to image to deployment

Advanced⏱ ~26 mingitcosigndocker

What you'll learn

  • Trace the artefact from source commit to running container
  • Distinguish the four artefacts produced at build time (image, signature, provenance, SBOM)
  • Apply SLSA Build L3 hardening to the build plane
  • Recognise why the digest, not the tag, is the artefact identity

Prerequisites

Verified against Git 2.55.x teaching target; 2.40+ minimum · GitHub Actions continuous service; Aug 2026 documentation baseline · Argo CD v3.5.x teaching target; v3.0+ minimum · Flux v2.9.x · Sigstore Cosign v3.1.x · SLSA v1.2 · OCI Distribution Specification v1.1 · Git LFS v3.7.1 · Kubernetes (cross-course target) 1.36.x

Not yet marked complete on this device.

The artefact flow is the path from a source commit to a running container. It is the most forensically rich part of the reference architecture: the artefact leaves behind a trail of digests, signatures, and attestations the audit chain can walk backward. The trail is the artefact’s identity; without it, the running container is a black box whose provenance cannot be reconstructed.

The flow

flowchart LR
    A["Source commit\n(SHA)"] -->|"build"| B["Layered image\n(sha256:img)"]
    B -->|"cosign sign"| C["Signature\n(sha256:sig)"]
    B -->|"generate"| D["Provenance\n(SLSA)"]
    B -->|"scan"| E["SBOM\n(SPDX or CycloneDX)"]
    C --> F["Registry\n(digest-indexed)"]
    D --> F
    E --> F
    F -->|"pull by digest"| G["Manifest\n(image: sha256:img)"]
    G -->|"apply"| H["Running pod\n(imageID: sha256:img)"]

The flow has six transitions, each producing a signed artefact. The image’s identity is its digest; the signature’s identity is its digest; the provenance’s identity is its digest. Everything in the registry is addressed by digest; tags are pointers humans use to find digests.

The four artefacts at build time

The build plane produces four artefacts per build:

  • Image. A layered OCI image whose topmost digest identifies the exact bytes. A rebuild from the same commit produces the same digest because layers are content-addressed.
  • Signature. A cosign signature over the image digest, produced with a managed key or via keyless signing tied to the workflow.
  • Provenance. An in-toto attestation recording builder, invocation, materials, subject. Subject is the image digest; materials include the source commit.
  • SBOM. Software Bill of Materials in SPDX or CycloneDX, listing every package and version.
IMAGE="ghcr.io/acme/checkout:${GITHUB_SHA}"
cosign sign --yes "$IMAGE"
cosign attest --yes --predicate provenance.json --type slsaprovenance "$IMAGE"
cosign attest --yes --predicate sbom.spdx.json --type spdxjson "$IMAGE"

Each call pushes a new artefact signed by the same workflow identity and addressed by the image’s digest.

The digest is the identity

The registry holds two kinds of references: tags and digests. A tag is a mutable pointer; a digest is an immutable address.

REGISTRY=ghcr.io
REPO=acme/checkout
TAG=v3.2.7
DIGEST=sha256:b4ffde6502d1c5f7e3b9c1d8a8c2d3a4b5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0
crane manifest "${REGISTRY}/${REPO}:${TAG}" | jq .config.digest
crane manifest "${REGISTRY}/${REPO}@${DIGEST}" | jq .config.digest

The first returns the digest the tag currently points to; the second returns the digest at that exact address. They are equal at push time; the second remains correct forever.

SLSA Build L3 hardening

The artefact flow at SLSA Build L3 has three properties:

  1. Provenance is non-forgeable. The build runs in a hardened runner whose identity is bound to the provenance attestation.
  2. Provenance is generated automatically. No engineer hand-writes it; the attestation is the workflow’s output, signed at build time.
  3. All build parameters are recorded. Materials list includes the source commit, dependency lockfiles, and build arguments.

L1 records the commit but signs nothing. L2 signs artefacts but the build runs on a shared runner. L3 signs from a hardened, isolated runner. The audit property improves at each level; L3 is the level at which the artefact identity can be reconstructed from provenance alone.

Why the registry is more than storage

The registry in the reference architecture is a participating component, not a passive disk:

  • Immutability of digests. A digest cannot be overwritten; pushing the same digest is a no-op.
  • Signature discovery. The registry serves the cosign signature alongside the image.
  • Replication with identity. Cross-region replication carries the signatures.

A registry that stores images but does not serve signatures is a registry the deployer must verify out-of-band.

Production discipline

  1. Pin by digest everywhere. Manifests, GitOps values, helm chart values, Terraform configuration
    • all reference by digest.
  2. Sign at build time, verify at deploy time. A signature never verified is a signature not present.
  3. Generate provenance automatically. Manual provenance is forgeable; attested provenance is not.

Cross-course references

  • This course, Part LXX (SLSA) - the L1-L3 levels applied to the build plane.
  • This course, Part XLVII (Signing) - the keys used by cosign.
  • Kubernetes for Production Sysadmins - Parts XXXVIII-XL cover runtime image policy.

Quiz

Knowledge check · 4 questions

  1. Q1. A registry holds an image with tag `checkout:v3.2.7`. The manifest references the image by tag, not digest. Six months later, the same tag resolves to a different digest because someone re-pushed. What is the audit-chain consequence?

  2. Q2. Provenance is the signed statement that this image was built from this commit by this workflow.

  3. Q3. Name the four artefacts produced at build time and identify which one is required at SLSA Build L3 but optional at L2.

  4. Q4. Diagnose the artefact-flow break and recommend the fix.

    A team builds a container image with GitHub Actions, signs it with cosign using a long-lived key in the runner's secrets, pushes to ECR, and deploys via Argo CD. Manifests reference the image by tag (`checkout:v3.2.7`). Cosign signature is verified by a separate nightly job, not by Argo CD on pull. A CVE is announced in a base image; the team needs to know which deployed versions include the vulnerable base layer.

Passing score: 75%. Answers are checked in this browser.