wtf( )unctionsystem design, drawn
← all problemsSupply ChainHard

The build may not sign for itself

Everything reaching production has to carry a machine-checkable statement of what source it was built from and by what process. The build platform already produces artifacts; what it does not have is a chain of custody anybody outside the team would believe.

The difficulty is that the build runs code nobody has reviewed — that is what a build IS — so anything the build can reach is something an attacker who lands in it can reach too.

  1. R1No long-lived signing key may exist anywhere. Compromising a machine must not yield something that can sign future artifacts, so whatever signs must be issued per build and be useless minutes later.
  2. R3A signature must remain checkable long after the credential that made it has expired, which requires a record that the signature existed at a moment when that credential was valid. The record must be append-only, so an entry cannot be removed or rewritten later.
  3. R4Nothing deploys unless its provenance verifies against an expected identity and an expected process. Something has to say no, and it must be the same thing every time.
Compose the chain of custody. Tier 1 is what signs and what witnesses it, tier 2 is what refuses to deploy.
Components — tap one, then tap a slot on the diagram
?A build step that can write its own paperwork has not proved anything. It has filled in a form about itself.

Outside every boundary: Production, Source (reviewed changes), Artifact registry (by digest), Build environment (runs unreviewed code; FAILED: assume it is hostile), Build control plane (trusted, dispatches), an empty slot for the what a signature is made with, tier 1, an empty slot for the proves the signature existed then, tier 1, an empty slot for the the thing that says no, tier 2 Connections: Source calls Build control plane Build control plane controls Build environment — dispatch Build control plane calls what a signature is made with what a signature is made with calls proves the signature existed then Build environment calls Artifact registry — pushes the artifact the thing that says no controls proves the signature existed then — verify the thing that says no controls Artifact registry the thing that says no calls Production — only if it verifies

Production
Sourcereviewed changes
Artifact registryby digest
Build environmentruns unreviewed codeassume it is hostile
Build control planetrusted, dispatches