Repository navigation
T33 — Run every operation with no identity plane - #3275
Conversation
A create whose spec carries a [secrets] entry with source = "broker" is refused before any record is written when no identity plane is configured and no node-local proxy serves the box (BOX-081). The refusal carries exit 5 and the gatehouse_unenrolled_node code, the create reply carries its text, and the daemon log names the refused secrets. A source = "store" reference passes through unchanged (BOX-141). The box.create span records identity = "none" (BOX-140). Tests drive every box operation over an owner-only local socket, check the record reports identity none, and check that no identity.sock is in the 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: CONDITIONS · 2 conditions · the full ruling
The daemon refuses a brokered secret when no proxy serves the box, and that part conforms. When root_certificate is set, the daemon admits every broker entry. Architecture line 1308 admits only a GitHub grant there. C1 limits the waiver to GitHub grants. The daemon refusal reaches min as text only, so the client does not exit 5 with gatehouse_unenrolled_node. C2 files that gap as an issue and names it in the PR body as a residual. BOX-140 and BOX-141 conform.
Ruled at e1ebaa2 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
| proxy_serves: bool, | ||
| ) -> Option<boxes::core::bep::ActivationRefused> { | ||
| let grants = brokered_secrets(spec); | ||
| if grants.is_empty() || proxy_serves { |
There was a problem hiding this comment.
C1 · This waiver admits every broker entry when the request carries a root certificate. Architecture line 1308 admits only a GitHub grant with a node-local proxy. Enrollment is the remedy for all other grants. Waive the refusal only for entries with github: scopes, and refuse the others with exit 5.
There was a problem hiding this comment.
Addressed in a9b9a2269989: With a proxy root certificate, the waiver now covers only broker grants with a github: scope. Other broker grants are refused with exit 5, and the new aws:s3 cases test this.
| "create refused: a brokered secret on a host with no identity plane" | ||
| ); | ||
| Errorable::Err { | ||
| error: refusal.to_string(), |
There was a problem hiding this comment.
C2 · The reply carries only the text. min maps this text to a plain error, so the user does not get exit 5 and gatehouse_unenrolled_node. Gatehouse §6.2 line 580 names that error. Open an issue for the wire change in minimald-rpc and minimal, and name it in the PR body.
There was a problem hiding this comment.
Addressed in a9b9a2269989: The wire change in minimald-rpc and min is filed as #3276 and named as a residual in the PR body. This task's layers do not include those crates.
The BOX-081 gate took any root_certificate on the create request as proof that a node-local proxy serves the box, so an empty or malformed value let a brokered secret through. The gate now accepts only one well-formed certificate block, and the daemon log names a certificate it did not accept.
There was a problem hiding this comment.
arch-review: CONDITIONS · 2 conditions · the full ruling
The compare fixes the proxy fact. An empty or malformed root certificate now refuses the brokered secret. Two gaps stay in BOX-081. First, with a proxy present the daemon admits every broker grant, but architecture.md line 1308 exempts only a GitHub grant. C1 fixes this. Second, a refusal from the daemon alone does not make min exit 5, and the PR body names no issue for that gap. C2 fixes this.
Ruled at 60a8277 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
| proxy_serves: bool, | ||
| ) -> Option<boxes::core::bep::ActivationRefused> { | ||
| let grants = brokered_secrets(spec); | ||
| if grants.is_empty() || proxy_serves { |
There was a problem hiding this comment.
C1 · This line admits every broker grant when proxy_serves is true. Line 1308 of the design exempts only a GitHub grant. Every other broker reference fails at creation. Refuse the broker grants that have no github: scope, also when a proxy serves the box.
There was a problem hiding this comment.
Addressed in a9b9a2269989: refused_broker_grants keeps the broker grants with no github: scope when a proxy serves the box, so they are refused. The exit5 test covers aws:s3 alone and aws:s3 beside a GitHub grant.
| // plane (identity none) and no node-local proxy. The reply | ||
| // carries the refusal's text, so the client reads the cause | ||
| // and not a closed channel. | ||
| Err(e) if crate::box_manager::unenrolled_refusal(&e).is_some() => { |
There was a problem hiding this comment.
C2 · This reply carries the refusal text but no code. So min does not exit 5 with gatehouse_unenrolled_node when only the daemon refuses. File an issue for the wire field in crates/minimald-rpc, and name it as a residual in the PR body.
There was a problem hiding this comment.
Addressed in a9b9a2269989: Filed as #3276 for the refusal code field in crates/minimald-rpc. The PR body names it as a residual.
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
On a host with no identity plane, a person can create, stop, resume, exec into and reap a box over the local socket. The box record shows identity none. A create with a source = "broker" secret is refused with exit 5 and gatehouse_unenrolled_node, also when the request carries an empty or malformed root certificate. Notes from the agent: Revise round 1. The gate now accepts only one well-formed PEM certificate block with a non-empty base64 body (new crate::env::is_one_certificate, which reuses the existing certificate_block and certificate_der helpers). An empty or malformed value counts as no certificate, and the daemon log names it. Limit: minimald has no daemon-side fact about the host's Box Egress Proxy. On a microVM host that proxy runs beside minvmd, outside the guest, so the daemon cannot prove that a well-formed certificate came from it. The caller is the socket owner under file-mode trust, so a forged certificate gains nothing that the owner cannot already do. A full check needs minvmd to pass the proxy fact to the guest, outside this task's layers. clippy -p minimald --all-targets is clean. just clippy-strict was not run. |
|
/revise Arch conditions (arch_rulings 1133, ruled at 60a8277), in full:
C2 is filed as #3276. Name it in the PR body as a residual, in place of the unlinked note. |
A node-local proxy serves only a GitHub grant, so the BOX-081 waiver now covers only broker grants with a github: scope. The exit5 test adds non-GitHub cases and counts only its own log lines.
|
Round 2 of 10 on a /revise note, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
On a host with no identity plane, a person can create, stop, resume, exec into and reap a box and see identity none in its record. A create with a brokered secret is refused with exit 5 and gatehouse_unenrolled_node. When a node-local proxy serves the box, only a GitHub grant passes, and a broker grant with no github: scope (for example aws:s3) is still refused. Notes from the agent: C1: done. With a proxy root certificate, unenrolled_broker_refusal now refuses the broker grants that have no github: scope (the same test as SecretGrant::is_github). With no certificate it still refuses every broker grant. broker_secret_unenrolled_exit5 adds three non-GitHub cases (aws:s3 alone with ROOT_PEM, aws:s3 beside a GitHub grant with ROOT_PEM, aws:s3 with no certificate). The test now counts log lines from the expected cases (6). C2: filed as #3276. The runner writes the PR body, so name #3276 there as the residual for the client exit code, in place of the unlinked note. Printed text gap: the refusal comes from boxes::core::bep::unenrolled_node, and ProxyAbsence has no variant for 'a proxy serves the box, but not this grant'. So for the C1 case the text still ends with 'no Box Egress Proxy serves boxes on this machine.', and that is not true when a proxy serves the box. The fix needs a new cause in crates/boxes/src/core/bep.rs, which is outside this task's layers. In this daemon, the stored flag now marks a non-GitHub grant so the text says 'secret' and not 'GitHub grant'. That flag is documented as 'store reference', and it only selects that word. The daemon log line changed to 'refused a create: the spec carries a brokered secret that nothing on this host serves, and no identity plane is configured' and it now records proxy_serves. I did not run just clippy-strict. |
|
Round 3 of 10 on the runtime's review findings: the coder changed nothing. Revise round 3: the one open thread does not hold, so I changed nothing and made no commit. I ran no test: line this round, because the code is the same as at a9b9a22. The daemon has no fact about the egress proxy. 10BC8 On a microVM host the proxy runs beside the host daemon, outside the guest. The only proxy that the daemon tracks is the hostname proxy, and that proxy does not serve secrets. So the daemon has no root to compare the certificate with. Review threads the coder judged:
|
There was a problem hiding this comment.
arch-review: CONDITIONS · 3 conditions · the full ruling
The daemon gate now follows architecture line 1308. Only a GitHub grant passes when a node-local proxy serves. Three gaps remain. When a proxy is present, the refusal says that no proxy serves, which is false (C1). A non-GitHub brokered secret always reaches the daemon refusal, and min then exits 1, not 5 as line 366 requires (C2). Spec BOX-081 still waives every brokered secret when a proxy is present, so amend it to match the design (C3).
Outside the diff
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:543: C3 · BOX-081 waives every brokered secret when a proxy is present. Architecture line 1308 waives only a GitHub grant. Amend the spec to match the design.
Ruled at a9b9a22 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
| boxes::core::bep::unenrolled_node( | ||
| grants.clone(), | ||
| not_github, | ||
| boxes::core::bep::ProxyAbsence::NotServed, |
There was a problem hiding this comment.
C1 · When proxy_serves is true, this cause prints "no Box Egress Proxy serves boxes on this machine". That is false. Architecture line 1308 says the proxy serves only a GitHub grant, and enrollment is the remedy for other secrets. Pass a cause that says this, and keep exit 5 and the code.
| "create refused: a brokered secret on a host with no identity plane" | ||
| ); | ||
| Errorable::Err { | ||
| error: refusal.to_string(), |
There was a problem hiding this comment.
C2 · The reply carries only the text. create_refusal() in min makes it a plain error, so the command exits 1. Line 366 says a policy rejection is exit 5. A non-GitHub brokered secret always takes this path. Carry the code on the reply and map it in the client, or file an issue and name it as a residual.
| Err(e) if e.kind() == std::io::ErrorKind::InvalidInput => Errorable::Err { | ||
| error: e.to_string(), | ||
| }, | ||
| // BOX-081: a brokered secret on a host with no identity |
There was a problem hiding this comment.
C1 · This comment says "and no node-local proxy". After this head, the daemon also refuses a non-GitHub secret when a proxy is present. Update the comment.
There was a problem hiding this comment.
Addressed in b5e9470e7d3e: Rewrote the comment: the daemon refuses every brokered secret when no proxy is present, and every non-GitHub secret when one is.
|
/revise Arch conditions (arch_rulings 1134, ruled at a9b9a22), in full:
How each closes in this PR:
|
The refusal arm in rpc.rs now names both cases: no proxy, or a secret that is not a GitHub grant. Point the wrong proxy cause and the missing reply code at their follow-up issues.
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 2 conditions · the full ruling
The daemon gate conforms to architecture.md line 1308. A brokered secret on an un-enrolled host fails at creation, and a GitHub grant passes only when a node-local proxy serves. The user does not get the whole defined error. The reply has no code, so min exits 1 and not 5 (C1, #3276). With a proxy present, the text names a cause that says no proxy serves (C2, #3277). Both fixes are outside this task's layers. They are filed, so the change can merge with them open.
Ruled at b5e9470 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
| // and every secret that is not a GitHub grant when one is. | ||
| // The reply carries the refusal's text, so the client reads | ||
| // the cause and not a closed channel. It does not carry the | ||
| // refusal code, so `min` exits 1 and not 5 (#3276). |
There was a problem hiding this comment.
C1 · This reply carries only the refusal text. Line 1308 of the architecture requires a defined error, and BOX-081 requires exit 5 with gatehouse_unenrolled_node. Put the code in the CreateSession reply, and make min exit 5 on it. Track this in #3276.
| // When `proxy_serves` is true, this cause's text is wrong: a | ||
| // proxy is present and serves only GitHub grants. The cause | ||
| // for that case lives in `crates/boxes` (#3277). | ||
| boxes::core::bep::ProxyAbsence::NotServed, |
There was a problem hiding this comment.
C2 · When proxy_serves is true, NotServed tells the user that no proxy serves boxes. That is false. Add a ProxyAbsence cause in crates/boxes that says the proxy serves only GitHub grants, and pass it here. Track this in #3277.
| // well-formed block does not count as the proxy's. | ||
| let proxy_serves = proxy_root_certificate(config.root_certificate.as_deref()); | ||
| if config.root_certificate.is_some() && !proxy_serves { | ||
| tracing::info!( | ||
| session_name = config | ||
| .name | ||
| .as_deref() |
There was a problem hiding this comment.
HIGH · security · confidence 0.50 · in proxy_root_certificate
The BOX-081 gate that refuses a brokered secret decides proxy_serves from config.root_certificate, a value the create request carries. Any caller that sends a well-formed certificate block makes proxy_serves true. The doc comment on proxy_root_certificate admits this. A caller can then create a box with a brokered github: grant on a host where nothing serves it. Check against a root certificate the daemon knows, or from the daemon's own config, not the request.
What the reviewer checked
proxy_root_certificate: "the check is advisory: it trusts the caller. A caller that sends a made-up certificate passes it."
Hand this to an agent
Act on a code-review finding.
File: crates/minimald/src/box_manager.rs
Lines: 3914-3920
Category: security
Severity: high (reviewer confidence 0.50)
Finding:
The BOX-081 gate that refuses a brokered secret decides `proxy_serves` from `config.root_certificate`, a value the create request carries. Any caller that sends a well-formed certificate block makes `proxy_serves` true. The doc comment on `proxy_root_certificate` admits this. A caller can then create a box with a brokered `github:` grant on a host where nothing serves it. Check against a root certificate the daemon knows, or from the daemon's own config, not the request.
First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.
👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.
There was a problem hiding this comment.
Disputed for this PR, on the owner's decision of 2026-11-11, and tracked in #3279.
The daemon's check is advisory, as the doc comment says. The enforcement is elsewhere:
minrefuses a GitHub grant unless the proxy's published identity carries the root (proxy_box_factsandroot_certificate_forincrates/minimal/src/cmd/boxes/create.rs).- A GitHub secret reaches a box only through the proxy, so a create with a made-up certificate gets a grant that delivers nothing.
- On a microVM host the proxy runs outside the guest, so the guest
minimaldhas no proxy root to compare against.
#3279 has the daemon compare the request's certificate with the proxy's published root where it can see that identity.
|
Round 4 of 10 on a /revise note, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
On a host with no identity plane, a person can create, stop, resume, exec into and reap a box, and the box record shows identity none. A brokered secret is refused at create: every brokered secret when no node-local proxy is present, and every secret that is not a GitHub grant when one is. The daemon log names the refused secret. Notes from the agent: Revise round 4. This round changes only comments. The rpc.rs refusal arm comment now says the daemon refuses a brokered secret that no node-local proxy serves: every brokered secret with no proxy, and every non-GitHub secret with a proxy. Residuals for the PR body: (1) C1, #3277: the new ProxyAbsence cause in crates/boxes/src/core/bep.rs is outside the task's layers. Until it lands, a refusal with a proxy present prints 'no Box Egress Proxy serves boxes on this machine', which is false in that case. A // comment at the call site in box_manager.rs names #3277. The test assertion of the proxy-present text also waits for #3277. (2) C2, #3276: the CreateSession reply carries only the refusal text, so a refusal that only the daemon makes ends |
T33 — Run every operation with no identity plane
slice: S8
kind: task
covers: BOX-081, BOX-140, BOX-141
size: L
est: 200 code, 340 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: daemon log names a refused brokered secret
observability: create span records identity mode
layers:
- daemon:
- crates/minimald/src/box_manager.rs: broker refused; store passes
- crates/minimald/src/box_manager/tests.rs: tests
- crates/minimald/src/rpc.rs: identity none
- crates/minimald/src/env.rs: no identity socket
test: cargo nextest run -p minimald broker_secret_unenrolled_exit5
test: cargo nextest run -p minimald unenrolled_operations_over_file_mode_trust
test: cargo nextest run -p minimald store_secret_passed_through_unenrolled
produces: none
consumes: none
proof: on a host with no identity plane, create, stop, resume, exec into and reap a box, see identity none in its record, and see a brokered secret refused.
depends on:
- blocked by #2395
- blocked by #2403
- blocked by #2418
- blocked by #2408
Proof
On a host with no identity plane, a person can create, list, show, exec into, rename, stop, read the events and files of, resume, restart, reap and prune a box over an owner-only (0600) local socket. The box record shows identity none, and no identity.sock is in the box. A create whose spec has a [secrets] entry with source = "broker" is refused before any record exists, with exit code 5 and the gatehouse_unenrolled_node code. The daemon log names the refused secret. A source = "store" reference is stored unchanged.
Notes from the agent: Proxy fact: the daemon cannot see a node-local proxy itself, because on a VM guest the proxy runs on the VM host. So the daemon reads the request's root_certificate as the proxy fact. A client sets that field only from an identity that a node-local proxy published. The host is never enrolled here, so the BOX-081 test enumerates proxy present or absent against broker, store and no secrets. It does not enumerate all eight cases.
Exit 5 on the client: the daemon refusal carries exit_code 5 and the code in its ActivationRefused value, and in the daemon log. The CreateSession reply carries only the refusal text, because the wire type has no field for a code. The min client already refuses a broker secret with exit 5 before it sends the create, when no proxy serves boxes. If the daemon refusal is reached, the client does not map the reply text to exit 5. That needs a change in crates/minimal or crates/minimald-rpc, which are outside this task's layers.
Printed text: the reply reuses the existing BepRefusal::UnenrolledNode text with cause NotServed. That text ends with 'remove gh from [session.secrets] in minimal.toml'. The spec writes [secrets] on an entry, so this table name can be out of date. I did not change it, because it is in crates/boxes and outside the layers.
env.rs: no code in the tree creates an identity.sock. The change adds IDENTITY_SOCKET_NAME and a test-only find_identity_socket. The BOX-140 test uses them …[truncated]
Tests
cargo nextest run -p minimald broker_secret_unenrolled_exit5cargo nextest run -p minimald unenrolled_operations_over_file_mode_trustcargo nextest run -p minimald store_secret_passed_through_unenrolledVerify
min task run agent-verifytimed out after 1800s, so this PR is a draft.Closes #2422