Commit 168d1d3
committed
fix(validate): never emit evidence in --no-cluster dry-run mode
A --no-cluster validate is an offline dry-run that reports every check as
"skipped", yet it still honored spec.validate.evidence.attestation.{out,push}
and built, signed, and wrote attestation.intoto.jsonl into the evidence output
dir (and pushed the bundle).
In the UAT flow the emit output dir (attestation.out: ./evidence) is shared
across phases in the runner workspace. The prep phase's dry-run therefore left a
signed attestation.intoto.jsonl (subject = prep's content-hash OCI digest) in
./evidence/. The later conformance-phase emit re-packs ./evidence/ into the
run-<id> artifact; the closed-world pack sweeps in that stale attestation, so the
run-tag artifact embeds a signature for a FOREIGN subject (prep's digest, not the
run-tag digest). Normally the conformance emit's own Sigstore referrer overwrites
the staged attestation at verify time and masks this; when that referrer push
fails to attach (observed: GHCR timeouts), `aicr evidence verify` (and the
Evidence: Ingest job) fall back to the embedded stale attestation and fail with
"signed subject digest (<prep digest>) does not match pulled artifact digest
(<run-tag digest>)". Confirmed by `oras pull` of the run-tag artifact: it embeds
attestation.intoto.jsonl signing the prep digest, and the run-tag artifact has
zero referrers.
Fix in two layers:
- CLI: evidenceConfigForRunMode drops the recipe-evidence config when
--no-cluster is set, so an offline dry-run can never sign or push an
attestation regardless of config. Emitting evidence over an all-skipped run
attests to nothing.
- UAT: the prep phase validates against a config copy with
spec.validate.evidence stripped (mirroring the readiness-gate strip in the
conformance phase), keeping prep safe even against an older released aicr
that predates the CLI guard.
With prep no longer emitting, no attestation.intoto.jsonl is left in ./evidence/
for the conformance pack to embed, so the run-tag artifact carries only its own
signature. Documents the behavior on the --no-cluster row of the CLI reference.
Signed-off-by: Nathan Hensley <nhensley@nvidia.com>
Review (CodeRabbit) follow-ups:
- Reject --cncf-submission --no-cluster: the behavioral evidence collector
short-circuits to the live cluster, bypassing the noCluster handling, so the
combination must fail closed rather than silently contact the cluster.
- Narrow the --no-cluster doc to what actually changes (recipe-evidence
attestation is not signed/pushed); CNCF conformance markdown via --evidence-dir
is still rendered locally.
- prep temp config cleanup runs on every exit path via a subshell + EXIT trap
(matches the signing subshell in phases.sh), not just the normal path.
Signed-off-by: Nathan Hensley <nhensley@nvidia.com>1 parent 6f9050b commit 168d1d3
6 files changed
Lines changed: 92 additions & 7 deletions
File tree
- docs/user
- pkg/cli
- tests/uat/lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
835 | | - | |
| 835 | + | |
836 | 836 | | |
837 | 837 | | |
838 | 838 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
628 | 638 | | |
629 | 639 | | |
630 | 640 | | |
| |||
758 | 768 | | |
759 | 769 | | |
760 | 770 | | |
761 | | - | |
| 771 | + | |
762 | 772 | | |
763 | 773 | | |
764 | 774 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
85 | 105 | | |
86 | 106 | | |
87 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
208 | 214 | | |
209 | 215 | | |
210 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
178 | 197 | | |
179 | 198 | | |
180 | 199 | | |
| |||
0 commit comments