feat(forge): add target attestation safety policy#22
Merged
Conversation
| } | ||
| } | ||
|
|
||
| fn parse_target_attestation(value: &str) -> Result<TargetAttestation> { |
Contributor
Author
|
Local review complete. Verified the PR only changes src/forge.rs and adds the target-attestation safety gate, Pkl/JSON normalization, and focused tests. Local validation passed: cargo fmt -- --check, cargo clippy --all-targets -- -D warnings, cargo test target_attestation -- --nocapture, and cargo test. GitHub checks are green. No blocking findings.\n\nNote: GitHub rejected an approve review because this is my own PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an explicit target-attestation safety policy for destructive forge USB operations.
This supports external-first install flows where the operator must attest the target class before destructive writes, e.g. an external USB/Thunderbolt SSD is allowed while an internal Apple NVMe target is forbidden by default.
New safety fields:
Supported attestations:
Behavior
For destructive USB install requests:
requires_target_attestation = trueand no attestation is present, planning is blocked withTARGET_ATTESTATION_REQUIREDallowed_targets, planning is blocked withTARGET_ATTESTATION_NOT_ALLOWEDforbidden_targets, planning is blocked withTARGET_ATTESTATION_FORBIDDENinternal-apple-nvmeis additionally blocked by default unlessallow_internal_disk_selection = trueWhy
This is the next safety primitive needed for external-first NixOS install flows on hardware like Intel Apple T2 MacBooks. It lets profile/materialization artifacts express:
without relying only on stringly disk names.
Tests
Targeted tests cover: