Repository navigation
feat(minimal): sign store handles under one host-keychain client key (T59) - #2557
norrietaylor merged 3 commits into
Conversation
Box creation reads the client's signing key from the host keychain (macOS login keychain through /usr/bin/security, the Secret Service through secret-tool on Linux) and no longer generates a key per box. A key the keychain refuses this program is replaced, kept, and registered with the proxy before any sealed value leaves the mint. The proxy logs a new client key at info and a known one at debug, so its log holds one registration line for each client, not for each box.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Reviewed: 1 finding, none blocking at Address the comments on the diff. Clobber: none seen. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms to Gatehouse §6.10 line 842. Box creation now signs under one local key that the host keychain keeps. The client registers that key over the control socket before a sealed value leaves the process. A keychain refusal gives a replacement key, and the client registers it before the mint. Other store failures stop the creation. The store-handle caller (#2525) and the min box spec key identifier (#2526) stay open as residuals.
Ruled at d50ede2 against gominimal/arch@109541a48c31 by claude-opus-5-5.
Take secret-tool from a fixed system directory, never through PATH, because it sees the client signing key. Kill a keychain tool that runs past 60 seconds, as one waiting on an unanswered unlock prompt does, and reap the child when its stdin write fails.
There was a problem hiding this comment.
arch-review: PASS · the full ruling
This push conforms to the design, as the earlier head did. The keychain tool now has a deadline, and secret-tool comes only from system directories. A timeout or a missing tool stops box creation with MintError::KeyStore. It does not make a new key. Section 6.10 line 842 is still met: one kept local key signs the handles. Store-handle minting (#2525) and the kid in min box spec (#2526) stay open as filed residuals.
Ruled at a8bcf69 against gominimal/arch@109541a48c31 by claude-opus-5-5.
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
Two box creations sign under one kept client key, and the proxy holds one registration for it. A key the keychain refuses is replaced, kept and registered before the mint gives a sealed value. On Linux the keychain tool now comes from a system directory, and a tool that hangs on a prompt ends with an error after 60 seconds. Notes from the agent: Revise round 1. Fixed two of the three findings in crates/minimal/src/mint.rs. secret-tool now comes from /usr/bin, /bin or /run/current-system/sw/bin, never through PATH. run_key_tool now kills a tool after 60 seconds, reads its pipes on threads, and reaps the child when the stdin write fails. The create.rs fallback finding was not changed, for the reason in its thread entry. The secret_tool test runs only off macOS. The macOS backend was not built or run on this Linux box. |
On macOS, an item whose access list refuses this program can refuse an in-place update as well. The replacement now deletes the old item before it adds the new one. No item to delete is not an error. Record the two new test connections of the mint tests in the daemon connection inventory. They reach a test proxy control socket, not the daemon.
There was a problem hiding this comment.
arch-review: PASS · the full ruling
This push changes only how the macOS keychain item is replaced. The old item is deleted first, and then the new item is added. Gatehouse §6.10 line 842 asks for one local key, registered before use. The change keeps that. A failed delete stops creation, so the flow still fails closed. The new tests.rs lines classify two test-only connections. The PASS on the earlier head stands.
Ruled at b9a1c13 against gominimal/arch@109541a48c31 by claude-opus-5-5.
|
Round 2 of 10 on a failed check suite, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
Two box creations register one client key with the proxy, and a key the proxy refuses is replaced and registered before the mint. Both test lines pass, and the crate's connection inventory test passes again. Notes from the agent: The CI |
norrietaylor
left a comment
There was a problem hiding this comment.
Babysitter approval at b9a1c13: every merge gate passes at this head (arch PASS at b9a1c13, zero open threads, every lane aggregator green including ci-macos-success). The out-of-layer inventory lines in crates/minimal/src/tests.rs are accepted under the epic owner's layer-exception rule. Squash title feat(minimal): sign store handles under one host-keychain client key (T59) and the squashed message pass commitlint. Queued for squash merge.
Generated by Claude Code
T59 — Sign store handles under the client's one local key from a host-keychain ClientKeyStore
slice: S9
kind: task
covers: BEP-063
size: L
est: 260 code, 240 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics:
min box specnames the client key's identifier under the grant, and the proxy log records one registration per client, not one per boxobservability: one info line at first use naming the registered key identifier
layers:
- key-store:
- crates/minimal/src/mint.rs: a host-keychain
ClientKeyStorebackend behind the existing key-store seam holds the client's one local signing key (macOS Keychain; the Linux host behind the same seam), and theInterim:notes andexpect(dead_code)reasons that name #2524 go- crates/minimal/src/cmd/boxes/create.rs:
mint_grantsreadslocal_client_keyover that store and signs the store handle and the grant registrations with it, neverClientKey::generate()per box- crates/bep/src/control.rs: the module doc stops naming #2524; the registry keeps one key per client
test: cargo nextest run -p minimal two_creations_register_one_client_key
test: cargo nextest run -p minimal a_refused_client_key_is_replaced_and_registered_before_the_mint
produces: none
consumes: none
proof: Two box creations register one client key with the proxy, and a key the proxy refuses is replaced and registered before the mint.
depends on:
- blocked by T27
- assumes OQ3
Proof
Two box creations now sign under the one key that the host keychain keeps. The proxy registers that key once, and its registrations file holds one line for the client. When the keychain refuses this program the kept key, creation makes a replacement, keeps it, and registers it with the proxy before the mint gives any sealed value.
Notes from the agent: Interpretation: the proof says 'a key the proxy refuses'. The spec and the existing seam describe a key that the keychain refuses this program, and the code now replaces that key. When the proxy itself refuses a key, creation still stops with the existing fixed message. The proxy refuses only a malformed key or a failed registrations-file write, and a new key does not fix either case. Store handles: mint_grants signs the grant registrations under the kept key. It does not mint store handles yet, because bep::seal::MemberKind has no
storekind to carry a handle to the box (#2525). store_claims, StoreHandle and mint_store_handle keep an expect(dead_code) attribute, and its reason now names #2525, not #2524. Diagnostics:min box specdoes not show the client key identifier under the grant. That surface is outside this task's layers (#2526). Observability: the client logs one info line with the kid when it makes a key, and logs each registration at debug level. The proxy logs a new key at info and a known key at debug. HostClientKeyStore uses /usr/bin/security on macOS and secret-tool on Linux. It has no automated test, because this box has no keychain. The macOS refusal exit codes (51, 101, 128) are the low bytes of the statuses that bep::keys treats as denied. Nothing tested them on a Mac. Runs: clippy -p bep -p minimal --all-targets is clean for these crates, andnextest -p minimal mint(14) andnextest -p bep control(6) pass. I did not run just ci or clippy-strict.Tests
cargo nextest run -p minimal two_creations_register_one_client_keycargo nextest run -p minimal a_refused_client_key_is_replaced_and_registered_before_the_mintVerify
min task run agent-verifyexited 101 under rustc 1.98.1, which the repository does not pin (1.97.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.Layer exception
crates/minimal/src/tests.rsis outside T59's layers. The change adds two lines to theevery_daemon_connection_is_classifiedinventory, classifying the two new test-only connections inmint.rsasungated, and rewords the comment above them. The inventory test fails without them, and arch's ruling at b9a1c13 names them. Accepted under the epic owner's layer-exception rule.Closes #2539
Generated by Claude Code