docs(sdk): scope the evidence-options security rationale to the artifact - #2543
Conversation
Signed-off-by: Mark Chmarny <mark@chmarny.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughUpdated Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to This PR clarifies existing security documentation without changing code behavior, APIs, or generated artifacts. No actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Coverage Report ✅
Coverage BadgeCoverage unchanged by this PR. |
Summary
Corrects the security rationale on
Config.EvidenceAttestationOptions(), addedin #2542, which asserted a blanket rule the same function contradicts four lines
later.
Motivation / Context
#2542's godoc justified keeping
NoSign/Fullun-derived with a generalprinciple: both "WEAKEN a run", and a checked-in file that weakens a run is a
supply-chain downgrade. The same function projects
PlainHTTPandInsecureTLSfrom that same committed document, and those weaken a run too. So the stated
boundary was not the boundary the code implements.
Found by running the five-lens review process retroactively on #2542 after it
merged.
make qualify, golangci-lint,-race, coverage and mutation testingall passed on that PR and none of them can catch a rationale that contradicts
its own function body.
Fixes: N/A
Related: #2542, #2245
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/server)pkg/recipe)pkg/bundler,pkg/component/*)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)pkg/client/v1)Implementation Notes
No behavior change. Comments and markdown only. The config-settable
plainHTTP/insecureTLScapability is inherited unchanged fromEvidenceAttestationSpecand the CLI's existing mapping; this PR corrects whatthe docs claim about it.
The distinction the rationale now draws is the artifact versus the hop.
NoSign/Fullalter the artifact's own trust properties and staycommand-line-only.
plainHTTP/insecureTLSconfigure transport to a registrythe same document already names in
push, which is whyEvidenceOptionscarriesthem while the bundler's options do not —
MakeBundlenever reaches a registry.This connects to the rationale already stated for
spec.bundle.registry(go-library.md line ~921), which the #2542 section failed to reference.
Two claims are now stated as structural facts, and both were source-traced
rather than asserted:
PlainHTTP/InsecureTLSreach only the OCI transport — neverSignStatement's Fulcio/Rekor call, never predicate or redactionconstruction.
Emit-and-push binds the digest computed locally during packaging, before any
push begins (
pkg/oci/push.go,pkg/oci/reference.go). Signing analready-pushed artifact resolves it at pull time instead
(
SignExistingOptions.Artifact, "resolved at pull time"), but the pull iscontent-addressed and cross-checked for equality at
pkg/evidence/verifier/fetch.go:183-187, which fails closed.The second point is deliberately split by path. An earlier draft of this PR
stated the local-packaging mechanism as covering both, which is false for the
aicr evidence signleg — the end security property holds there, but via adifferent mechanism.
Also states the residual risk rather than implying safety. A committed
plainHTTP/insecureTLSdoes weaken that hop, and it widens the threat model:redirecting
pushneeds a malicious document, whereas downgrading TLS on adestination the operator believes is protected only needs someone on the network
path.
Declined, recorded here rather than silently: the text says
"
EvidenceOptionsandSignOptionscarry these". No type namedSignOptionsactually carries those fields — the real ones are
EvidencePublishOptions(SDK)and
SignExistingOptions(CLI). But that shorthand is pre-existing atgo-library.md:921,bundle.go:83andconfig.go:353; correcting it only inthe new sentence would leave three existing uses inconsistent. Worth a separate
cleanup.
One table row also moves:
EvidenceAttestationOptions()now sits with the otherspec.validate.*derivation instead of after thespec.snapshot.*row, matchingthe order of the "does and does not carry" subsections below it.
Testing
go build ./... golangci-lint run -c .golangci.yaml ./pkg/client/v1/... go test ./pkg/client/v1/... make check-docs-mdx check-docs-mdx-parseAll pass. No test changes: the diff is comments and markdown, so there is no new
behavior to cover and coverage is unchanged.
Risk Assessment
Rollout notes: Comments and markdown only; no code paths, signatures, or
generated artifacts change. N/A for migration.
Checklist
make testwith-race)make lint)git commit -S) — GPG signing info