gunk-dev/the-valley

verification.md

sourceb7f7c08c0b95main's published tip history
4.2 KiB · Plain text

Verification #

The reframe — attestation-with-revocation instead of CI-as-gate, and the failure-mode trade it makes — is an architecture bet; see architecture.md. This document holds what the attestation phase actually needs: the two kinds of checks, and what makes an attestation hard to forge.

Two kinds of checks, two kinds of attestation #

The system must distinguish what an attestation is claiming. A single "checks passed" signature is the SLSA mistake worth avoiding.

  • Pure checks — nix build, nix flake check, lint/type-check as derivations, nixosTest-style integration tests (effectful inside, pure outside). Inputs content-addressed, outputs deterministic; the attestation carries input, derivation, and output hashes, so any verifier can re-derive and confirm. These are the strong attestations.
  • Effectful checks — real-network tests, external APIs, benchmarks, anything not bit-reproducible. The attestation is a notarization: "sealed environment $E ran $T at time $t and observed $result." Trust here is closer to "I trust the signer."

Wherever a check can be moved from effectful to pure (via nixosTest or microVM sandboxing), it should be.

The mechanism stack #

Without a TEE, attestations are exactly as trustworthy as the signing key — the same trust model as code signing, plenty for non-adversarial settings. But the mechanisms stack:

MechanismWhat it gets youResidual attack
Signing key"The signer says these checks passed"Anyone with the key can lie
Content-addressed attestation toolThe tool itself is a known Nix derivation; the attestation names its hashMalicious dev can ship a patched tool, but it will not match the canonical hash
Hermetic sandboxnix build sandbox; nixosTest VMs; microVMs for non-Nix checksLocal root can still bypass — but bypass leaves evidence
Re-derivation auditPure attestations encode every input hash; verifier re-runs and confirms bit-identicalNone for pure checks; effectful checks not re-verifiable
Witness samplingRandom fraction of attestations re-run on another node; trust score per attesterNone — this is the backstop
Transparency log (Tessera-backed)Every attestation appended to an external append-only log with an inclusion proof; anyone can audit existence and content over timeOrthogonal to the others — gives non-repudiation and tamper evidence, not correctness of the computation. Independent and complementary.

Stacked, a determined local-root actor can still forge an attestation — but only visibly (tool hash mismatch), temporarily (re-derivation eventually detects), and within a bounded window (before their trust score is recalculated). For pure-derivation checks this lands roughly at SLSA Level 3; for effectful checks, lower — but the system knows which kind each attestation is.