# Provenance verification runbook (SAMPLE)

> Signatures, key ids and certificates here are SAMPLE placeholders — the base64 decodes to the words 'SAMPLE SIGNATURE', so verification must fail. Nothing here is cryptographically valid and no key material is real.

Every file referenced below is in this category. Nothing here verifies successfully by design — the point is to exercise the failure path as well as the happy one.

## 1. Locate the attestation

Start from the artifact digest, not from a filename. The release artifact is `orchard-gateway-4.2.0.tgz` with sha256 `06af88e316cf889e0b72645f235f77c900d48972456b1ff6ba4df49ae24be734`. That digest appears as:

- the `subject[0].digest.sha256` of the in-toto statements,
- the `payloadHash` of the Rekor entry,
- the first line of `SHA256SUMS.txt`.

If those three disagree, stop: the attestation does not describe the artifact you have.

## 2. Unwrap the envelope

`dsse-envelope.json` carries the statement as base64 in `payload`. Decode it and check it byte-matches `in-toto-slsa-provenance-v1.json`. The bad-payload fixture in this family is the negative case: it must fail here, not later.

## 3. Check the builder

`predicate.runDetails.builder.id` must equal `https://build.orchard.example/builders/hosted/v1`, which is the only entry in the allowed list in `attestation-policy.yaml`. A provenance statement that verifies cryptographically but names an unexpected builder is still a policy failure.

## 4. Check transparency-log inclusion

`sigstore-bundle.json` and `rekor-log-entry.json` both carry an inclusion proof with a root hash and a tree size of 51201. Recompute the proof — do not trust the `signedEntryTimestamp` alone.

## 5. Apply the policy

`slsa-verification-summary.json` says PASSED at SLSA_BUILD_LEVEL_3. The dependency breakdown in `slsa-level-matrix.csv` shows two dependencies still at level 0, which the policy refuses — a green top-level result does not clear the tree beneath it.

## Expected outcome with these fixtures

| Step | Result |
| --- | --- |
| Digest agreement | passes |
| Payload decode | passes (fails for the bad-payload fixture) |
| Signature verification | **fails** — SAMPLE placeholder |
| Builder identity | passes |
| Log inclusion | passes structurally |
| Policy evaluation | **blocks** — two dependencies at level 0 |
