Repository navigation
Key roles, step 3: realm trust material and the layer-manifest path, fail-closed until every site enforces (REQ-KEYROLES-001) - #316
Merged
Conversation
…REQ-KEYROLES-001, step 3) A realms file may declare key-roles = true and a delegation-file (resolved like trust-root-file). Realm::trust() returns root-only for a realm without roles, and the delegation-backed role trust for one with them; a missing, unreadable or refused delegation is an error, never a root-only fallback. delegation-file without key-roles = true is refused at load. Realms without the keys are unchanged. An older varve refuses a file carrying the keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on site enforces it (REQ-KEYROLES-001) No verification site consults Realm::trust() yet, so a roles realm would accept root-signed layers and statuses its own declaration forbids. resolve_realm now refuses it with a clear error instead of verifying it as root-only. Realm::trust() and its tests are kept, built through a private loader that skips the refusal. TODO(PR 5) marks the removal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R 3b) PinnedKeyVerifier::from_trust judges a layer manifest under the realm's LAYER keys in a roles realm and under the root otherwise; compose gains walk_installed_trusted and varve-serve builds its realm verifier and its composition trusts from Realm::trust(). root_public_key() stays the realm root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The loader now refuses key-roles realms (KeyRolesNotEnforced); the viewer tests assert that refusal, with a TODO to flip them once PR 5 wires every site. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
This is step 3 of REQ-KEYROLES-001 (key roles): realm trust material, and the layer-manifest verification path. It is PR 3 and PR 3b combined, because 3b only makes sense on top of 3.
Fail-closed until the wiring lands
A realm that declares
key-roles = trueis refused at load (RealmError::KeyRolesNotEnforced). Status, index and attestation verification still use only the root, so loading such a realm would accept root-signed documents its own declaration forbids. PR 5 removes the refusal once every verification site consultsRealm::trust(). The places it touches are markedTODO(PR 5).Realms without the new keys behave exactly as before.
Change
varve-realms.toml: two new keys.key-roles = true;delegation-file, which is resolved liketrust-root-file. Adelegation-filewithoutkey-roles = trueis refused at load.Realm::trust():RealmTrust::root_only;PinnedKeyVerifier::from_trustjudges a layer manifest under the realm's LAYER keys in a roles realm, and under the root otherwise;compose::walk_installed_trustedcomposes included layers under each realm's own trust;Realm::trust();root_public_key()still returns the realm root.concept-config-reference.mddocuments both keys and the refusal.Evidence
realm.rstests initially failed to compile: there was nokey_rolesfield and notrust()method.main.rswithNo valid signatures.the_same_layer_signed_bytes_are_refused_under_a_realm_declaring_no_roles;layer_signed_bytes_are_refused_by_compose_under_a_no_roles_realm;the_same_layer_signed_layer_is_refused_by_a_realm_declaring_no_roles.KeyRolesNotEnforcedand carry aTODO(PR 5)to flip back.realm.rs:36 mutants tested in 9m: 34 caught, 2 unviable;verify.rsandcompose.rs:101 mutants tested in 18m: 89 caught, 12 unviable;varve-serve/src/main.rsis exempt as a bin target inmutation-scope.toml.clippy -D warningsis clean,cargo test --workspacepasses, andrivet validatepasses.Next
PRs 4 and 5: CLI signing by role, and the consumer wiring of status, index and attestation. They remove the refusal.
🤖 Generated with Claude Code
https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu