Repository navigation
Conversation
…get pins Follow-ups from the reviews of #1163 and the re-merge review. - A rejected spec's override record stays the strict union while the spec is stale and shrinks to the spec's own overrides once it compiles again at the same identity. - ClassifyPod and PodPlansAt return typed deep copies (about 7x faster than the JSON round trip); a reflection test fails if a field is shared or missed (CodeRabbit #1163 4805356433). - R1: the dead s.Identity check is removed; an enforce policy with identity, alone or with http, stays gate-Strict and is refused at start (owner batch 18). - Comments: prev.pod, PodClassification.Strict. - Pin guard: section_images.go records a source digest per section (gadget files, transitively included headers, VERSION; CRLF read as LF; unreadable directives and unlisted angle headers fail). TestSectionSourcesMatchPins fails a gadget change made without a pin rotation. check-product-images -sections and make check-section-images verify built images; anchored on a local VM build (IG v0.57.0), with a negative control. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Docs-exempt: internal fixes, tests and a CI guard in the unreleased NRI start gate stack Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Run make check-section-images after the unit-test job builds the gadgets, so a gadget source change without a pin rotation fails CI. Anchored on a local VM build with IG v0.57.0 (the job's ig version), including a negative control. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Docs-exempt: CI step only, no behavior change Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
There was a problem hiding this comment.
🟡 Changes recommended
An active critical issue can drop GateStrict while retained documents still enforce, and a separate digest issue misses valid includes preceded by comments and subsequent nested-header changes.
2 open issues
What changed in this PR
This PR follows up on sandbox-policy start-gate classification and adds checks linking gadget sources to pinned enforcement images.
Changes:
- Refines override retention and replaces JSON cloning with typed deep copies.
- Clarifies identity-policy classification and adds regression tests.
- Adds source-digest guards and section-only image verification.
| File | Description |
|---|---|
pkg/sandboxpolicy/igbackend/section_sources_test.go |
Adds source-digest and include-scanning checks. |
pkg/sandboxpolicy/igbackend/section_images.go |
Records source digests alongside image pins. |
pkg/sandboxpolicy/controller.go |
Tracks stale overrides and copies returned plans. |
pkg/sandboxpolicy/classify.go |
Adds typed copies and clarifies classification semantics. |
pkg/sandboxpolicy/classify_fu3_test.go |
Tests overrides, copy isolation, and identity classification. |
Makefile |
Adds check-section-images. |
cmd/check-product-images/main.go |
Adds section-only verification mode. |
Review effort: Balanced
…rved Copilot on #1230 (e36d8eb). - gateStrictSections also counts a section whose served network or file document enforces (policy mode, default, rule or per-access default), so a same-identity Audit replacement during a binding failure cannot drop GateStrict while the old enforcing document is still served (4811715164). - The pin guard's include scan strips comments (literal-aware) before reading directives, refuses an include after other text on its line, refuses a builder header name that a repo file could shadow, and its completeness cross-check walks nested headers (4811715182). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Docs-exempt: internal fix and test guard in the unreleased NRI start gate stack Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Performance Benchmark ResultsNode-Agent Resource Usage
Dedup EffectivenessNo data available. |
Copilot 4811837908 on #1230: a %:include digraph behind a backslash continuation was silently skipped by the pin guard's include scan. The scan now refuses any trigraph, joins continued lines (LF or CRLF, trailing blanks allowed), blanks comments on the joined text and reads %: as #, before detecting directives; %:%: and an include after code are errors. The completeness cross-check reads the joined text, so a header name split across a continuation is seen whole. The real tree's digests are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Docs-exempt: test-only pin guard change Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Performance Benchmark ResultsNode-Agent Resource Usage
Dedup EffectivenessNo data available. |
Copilot 4811937127 on #1230: the include scan mapped every %: to #, so a header named extra%:dep.h was hashed as extra#dep.h. Only a %: that starts a logical line now reads as #; a %: in a header name, string or char literal stays as written. %:%: and an include after code are still errors, and the cross-check sees names containing %: or # whole. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Docs-exempt: test-only pin guard change Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Performance Benchmark ResultsNode-Agent Resource Usage
Dedup EffectivenessNo data available. |
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because the digest guard can miss changes to absolute includes and configured nested inputs, allowing pin checks to pass despite changed sources.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
Performance Benchmark ResultsNode-Agent Resource Usage
Dedup EffectivenessNo data available. |


Summary
Follow-ups from the reviews of #1163 (S4) and the stack re-merge review, plus a CI guard for gadget pins. Stacked on #1178.
ClassifyPodandPodPlansAtreturn typed deep copies instead of a JSON round trip (about 7x faster), so callers cannot alias the snapshot or the last-good plans (CodeRabbit feat(sandboxpolicy): lock-free pod classification for the start gate #1163 4805356433). A reflection test fails if any field is shared or missed.s.Identity == nilcheck is removed. An enforce policy with identity, alone or with http, stays gate-Strict and is refused at start.prev.pod,PodClassification.Strict.section_images.gorecords a source digest per section (the gadget's files, the headers its sources transitively include, the IG version; CRLF read as LF; unreadable directives and unlisted angle headers fail).TestSectionSourcesMatchPinsfails a gadget change made without a pin rotation, in the existing go test jobs.check-product-images -sectionsandmake check-section-imagesverify built images, and the unit-test job now runsmake check-section-imagesright after building the gadgets.Validation:
go test ./pkg/sandboxpolicy/...in default,-tags startgate_vmtestand-race: all pass.make gadgetsbuilt from these sources matched the recorded pins, and a negative control (an editedenforce_network/gadget.yaml) was refused with a manifest digest mismatch.AI Review
Written with Claude Code (Claude Opus 5.5). One independent adversarial review: APPROVE with LOW findings (CRLF, unused headers, the build baseline, then an over-broad header rule), all fixed and re-checked (APPROVE).
🤖 Generated with Claude Code