Skip to content

feat(minimald): refuse unmatched names for partial allow lists and gate proxy callers (T106) - #2716

Merged
norrietaylor merged 26 commits into
mainfrom
agent/2693-refuse-unmatched-names-for-partial-allow-lists-a
Oct 30, 2026
Merged

norrietaylor merged 26 commits into
mainfrom
agent/2693-refuse-unmatched-names-for-partial-allow-lists-a

Conversation

@minimal-foundry

@minimal-foundry minimal-foundry Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

T106 — Refuse unmatched names for partial allow lists and gate host-address proxy callers

slice: S16
kind: task
covers: NET-141, NET-070
size: L
est: 260 code, 360 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: the diagnostics bundle's daemon log tail carries the relay's rate-limited line for each refused name, naming the box and the name, and the proxy's refusal line naming the calling box and the target
observability: the relay logs one rate-limited line per name it refuses with the box and the name; the hostname proxy's refusal line names the caller box whether it called from a switch lease or from the node's address
layers:
- dns:
- crates/minimald/src/net/dns_gate.rs: a query from a box with an allow list, for a name the list does not match and outside the box zone, is answered refused and forwarded to no resolver, the same as a deny-all box's; the test gains the partial-allow-list leg and a property over names, patterns and zones
test: cargo nextest run -p minimald unmatched_name_refused_without_upstream_forward
test: cargo nextest run -p minimald unmatched_name_never_forwarded_for_any_allow_set
- proxy:
- crates/minimald/src/net/dns.rs: the caller table answers for a host-address box's connections from the node's address by the box that owns the connecting socket
- crates/minimald/src/net/proxy.rs: a request from a host-address box is decided by that box's egress rules, as a switch-lease caller's is
test: cargo nextest run -p minimald proxy_caller_egress_denied
test: cargo nextest run -p minimald proxy_host_address_caller_egress_denied
test (deferred: kani): cargo nextest run -p boxes kani_frame_verdict_admits_nothing_undeclared
produces: none
consumes: none
proof: A box allowed only github.com fails at once to resolve example.com, and a deny-all host-address box's request through the hostname proxy to another box is refused.

Proof

A box allowed only github.com now gets REFUSED at once from the relay for example.com, and the query never reaches the switch. A deny-all host-address box's request through the hostname proxy to another box now gets 403 Forbidden, and the refusal line names that box as the caller.

Notes from the agent: DNS: the relay's gate now refuses every name outside the box zone that a declared allow_dns_hosts list does not match, not only for deny-all boxes. A box that declared no names is still not refused. A deny-all box keeps its narrower zone match (the apex and x.MIN.INTERNAL are REFUSED). A partial list leaves those zone forms to the existing NXDOMAIN rule. Each refusal writes one warning, rate-limited per box and name, that names the box (session_id) and the name. Existing dns_gate tests that asked an allow-list box for unlisted names now expect REFUSED. The steered-proxy fixtures gained an allowed, non-credentialed name (example.org) so the SERVFAIL-on-mixed-query leg still tests what it did. Proxy: HostnameRegistry::caller_owning plus dns::connecting_box name a host-address caller by the connecting socket: /proc/net/tcp{,6} inode, the holder pid from /proc/*/fd, and the box id from the holder's cgroup leaf boxes/<allow|deny>/. The lookup runs on a blocking thread, and only while some live caller holds no switch lease. HostRoute gained two methods; it has no implementations outside proxy.rs. The proxy test stubs the owner lookup through Router::with_socket_owner, because a test process runs in no box leaf. The kernel half (inode and holder) has its own test against a real connection. The leaf-name-equals-box-id mapping depends on create_box_leaf being called with record.id, as box_actor/host.rs does today. Deferred (lane: kani): cargo nextest run -p boxes kani_frame_verdict_admits_nothing_undeclared. That harness already exists in crates/boxes/src/core/egress.rs, and the proxy reuses the same pure verdict, so nothing in it changed and nothing was run f…[truncated]

Layer exception

These files are outside T106's layers. Round 2 changed them to close arch conditions C1, C3 and C4 at f3725db8 (arch_rulings 500):

  • crates/minimald/src/box_actor/naming.rs and crates/minimald/src/box_actor/tests.rs (C1): a HostNet box registers as a caller, so the host-address proxy gate can attribute it, with a naming test for that registration.
  • scripts/session-e2e.sh (C3): the partial-allow-list box's disallowed-name leg now fails unless the name is refused fast, as the deny-all leg does.
  • docs/specs/18-spec-box-networking/18-spec-box-networking.md (C4): the NET-141 note drops its known-gap sentences and states the assertion C3 adds.

Tests

line exit tail
cargo nextest run -p minimald unmatched_name_refused_without_upstream_forward 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-cece... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimald unmatched_name_never_forwarded_for_any_allow_set 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-5f84... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimald proxy_caller_egress_denied 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-24a9... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimald proxy_host_address_caller_egress_denied 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-e47e... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify

min task run agent-verify passed ([tasks.verify]).

Base

The base branch moved while the coder worked; it was merged in before the tests ran.

Deferred

The plan marked these test lines deferred: the executor lacks the lane, so nothing here ran them and they still owe evidence.

line lane
cargo nextest run -p boxes kani_frame_verdict_admits_nothing_undeclared kani

Closes #2693


Generated by Claude Code

The relay's DNS gate answered REFUSED only for a deny-all box. A box
with a partial allow_dns_hosts list still forwarded a name that no
entry matched, so the name left the machine in the query (NET-141).

The gate now refuses, at the relay and before any onward query, every
name outside the box zone that a declared list does not match. Each
refusal writes one rate-limited warning that names the box and the
name. A property test covers lists, names and zones.
A host-address box holds no switch lease, so its request reached the
hostname proxy from the node's address and the proxy named no caller.
Its egress rules were never applied (NET-070).

The caller table now names the box that owns the connecting socket:
the socket's inode in the kernel's tables, its holder, and that
process's classifier leaf. The proxy puts the request to that box's
egress rules, and the refusal line names it as the caller.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d0be7699-ebf9-45aa-8a3e-496a6d9daf37

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@minimal-foundry

minimal-foundry Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Reviewed: no findings; approval withheld, 1 thread unresolved at 90731efd1928.

APPROVE withheld: 1 unresolved thread — minimal-arch[bot] crates/minimald/src/net/dns.rs:1217. Resolving the last thread releases the approval on this head.

Resolve the open threads. Resolving the last one releases the approval on this head; no new review is required.

Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it.

Clobber: none seen.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 3 findings, 3 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimald/src/net/proxy.rs Resolved
Comment thread crates/minimald/src/net/proxy.rs Resolved
Comment thread crates/minimald/src/net/dns_gate.rs Resolved
The key held the name the box asked for, and the limiter never evicts
a key. A hash bucket of the name keeps the keys at a fixed count.
Name the caller when the proxy accepts the connection, before it reads
the head. While a host-address box is live, a connection from the
node's address whose owner the kernel cannot name is refused, not
left ungated.

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: CONDITIONS · 4 conditions · the full ruling

The DNS refusal for partial allow lists conforms to §5.3 line 145. The proxy gate for host-address callers does nothing in production. Only the OwnIp arm of box_actor/naming.rs calls register_caller. A host-address box has no caller facts, so the proxy routes its request without a gate. §7.1 lines 249 and 259 say the :7654 proxy must enforce the source's egress rules now. C1 registers the facts, and C2 refuses a box that the registry does not know. C3 and C4 make the partial-list e2e leg assert a fast refusal and remove the stale spec gap.

Ruled at f3725db against gominimal/arch@109541a48c31 by claude-opus-5-5.

Comment thread crates/minimald/src/net/dns.rs Resolved
Comment thread crates/minimald/src/net/proxy.rs Resolved
Comment thread crates/minimald/src/net/proxy.rs Resolved
Comment thread crates/minimald/src/net/proxy.rs Resolved

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimald/src/net/proxy.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as f3725db87af6.

line exit tail
cargo nextest run -p minimald unmatched_name_refused_without_upstream_forward 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-fe85... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimald unmatched_name_never_forwarded_for_any_allow_set 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-c35b... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimald proxy_caller_egress_denied 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-a44b... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimald proxy_host_address_caller_egress_denied 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-4935... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/net/proxy.rs: The proxy now names the owner at accept time. connecting_box separates no box from unknown. While a host-address box is live, an unknown owner is refused with 403 and a warn line.
  • 👍 valid — PRRT_kwDOPdfcxM6xBJSC: Same fix as the sibling thread. The lookup runs before the head read. With has_unleased_callers() true, a scan miss or a spawn_blocking error is refused, not ungated. (not posted on the thread: not an open thread on the pull request)
  • 👍 valid — PRRT_kwDOPdfcxM6xBJSJ: The key is now one of 256 buckets of a per-daemon random hash of the name, so each box adds at most 256 keys. The test unmatched_name_refusal_keys_stay_bounded pins this. (not posted on the thread: not an open thread on the pull request)

A box allowed only github.com gets REFUSED at once for example.com, and the query goes to no resolver. A deny-all host-address box's request through the hostname proxy to another box gets 403 Forbidden. While a host-address box is live, the proxy also refuses a connection from the node's address when it cannot name the box that owns it.

Notes from the agent: Revise round 1. Threads 1 and 2 report the same fail-open. connecting_box now returns ConnectingOwner (Box, NoBox, Unknown). The proxy names the caller when it accepts the connection, before it reads the head. While a live caller holds no switch lease, an Unknown owner (or a failed lookup task) is refused with 403 and the body 'the proxy cannot tell which box opened this connection'. The warn line 'refused a proxied request' names the peer, the host and the target box, with caller="unknown". A host-side client whose holder the proxy cannot see (for example under a hidepid /proc) is refused too while a host-address box is live. This fails closed on purpose. A box id whose leaf names no live caller still gets no caller, as before. Thread 3: the policy.rs limiter is outside the layers, so the fix is in dns_gate.rs. The key is now one of 256 buckets per box, from a hash with a random per-daemon key. Two names in the same bucket share one line a minute. I added the unit test unmatched_name_refusal_keys_stay_bounded and a fourth case to proxy_host_address_caller_egress_denied, and the net::proxy and net::dns modules pass (122 tests). Deferred: cargo nextest run -p boxes kani_frame_verdict_admits_nothing_undeclared (lane: kani), not run. I did not run just clippy-strict.

Copy link
Copy Markdown
Member

/revise Fix the native-daemon-e2e failure, then close arch conditions C1–C4 from the ruling at f3725db8 (arch_rulings 500).

  • native-daemon-e2e (job 122682539624): scripts/session-e2e.sh:6144 fails with ##[error]a task in an own-IP session completed an outbound request against no host — its egress does not work, after curl: (6) Could not resolve host: example.org. A box created with only --allow-subnets 0.0.0.0/0 gets allow_dns_hosts = Some([]) from boxes::effective_egress, and the new DnsGate::refuses (crates/minimald/src/net/dns_gate.rs:577-589) then refuses every name outside the box zone. Refuse on names only for the deny-all shape or a non-empty list, for example let Some(names) = self.names.as_ref().filter(|n| self.deny_all || !n.is_empty()) else { return false; };. Add a unit test beside the NET-141 tests: a gate built from allow_subnets: Some(vec["0.0.0.0/0".into()]), allow_dns_hosts: Some(vec[]) forwards (returns None for) an A query for example.com. Update the module doc at dns_gate.rs:60-85.
  • C1: crates/minimald/src/box_actor/naming.rs, boxes::NetworkMode::HostNet arm (lines 336–342): after reg.register_host_net(record.id, &name), call reg.register_caller(record.id, &name, &record.policy, subnet, hostname_proxy_port). Add a naming test that registers a HostNet record through this path and asserts has_unleased_callers() and caller_owning(record.id, Ipv4Addr::LOCALHOST).is_some(). In proxy_host_address_caller_egress_denied (proxy.rs:3803), use that production registration in place of the hand-written register_caller, or say in the test comment that the naming test proves it.
  • C2: crates/minimald/src/net/proxy.rs Router::caller_for (line 335): caller.map_or(CallerLookup::Unattributed, CallerLookup::Box). Update the doc comments of caller_for and HostnameRegistry::caller_owning. Add a leg to proxy_host_address_caller_egress_denied: the stub returns ConnectingOwner::Box for an id with no registered facts, and the test expects 403 Forbidden.
  • C3: scripts/session-e2e.sh, the partial-allow-list box's disallowed-name leg (the example.org probe near line 2091): fail with a ::error::NET-141: line when the curl error does not match could not resolve, or when name_elapsed_ms is 5000 or more, as the deny-all leg does at line 2221. Remove the comment that says the outcome is not asserted.
  • C4: docs/specs/18-spec-box-networking/18-spec-box-networking.md NET-141 note (line 491): remove the Known gap: sentences, and replace asserts only that the connection does not complete. It prints whether the name was refused fast or timed out. with the assertion C3 adds. Keep the host-address and VM-backed host limits.
  • Change nothing else.

Generated by Claude Code

An empty allow_dns_hosts list with subnets admitted (--allow-subnets
0.0.0.0/0 alone) keeps its forwarding. Register caller facts for
host-address boxes, and refuse a proxied connection whose owning box
has no caller facts.
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Spec lint

docs/specs/18-spec-box-networking/18-spec-box-networking.md — 10 finding(s)

docs/specs/18-spec-box-networking/18-spec-box-networking.md:159: P004 NET-009 names test 'native_resolution_without_proxy_env', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:339: P004 NET-040 names test 'fresh_install_own_ip_ingress_publishes_loopback', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:344: P004 NET-041 names test 'installer_switch_binary_executable', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:382: P004 NET-048 names test 'linux_amd64_manifest_ships_vm_stack', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:387: P004 NET-049 names test 'fresh_linux_kvm_activate_local_minvmd', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:392: P004 NET-050 names test 'linux_arm64_manifest_ships_vm_stack', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:397: P004 NET-051 names test 'fresh_arm64_kvm_activate_local_minvmd', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:746: P004 NET-132 names test 'proxy_sees_each_vm_box_by_its_switch_address', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:772: P004 NET-134 names test 'deny_all_box_reaches_proxy_and_no_other_host_port', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:796: P004 NET-107 names test 'session_outbound_request', which was not found in the repository

Advisory. None of this blocks the merge; the review decides.

Advisory, and never a merge gate. Linter: gominimal/foundry@fb5932b8, spec format: How Minimal Writes Specs.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 3 findings, 3 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimald/src/net/dns_gate.rs Resolved
Comment thread crates/minimald/src/net/proxy.rs Resolved
Comment thread crates/minimald/src/net/dns.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a /revise note, pushed as efdedb3683b3.

line exit tail
cargo nextest run -p minimald unmatched_name_refused_without_upstream_forward 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-ccc8... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimald unmatched_name_never_forwarded_for_any_allow_set 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-20de... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimald proxy_caller_egress_denied 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-8b2f... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimald proxy_host_address_caller_egress_denied 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-eb6b... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify min task run agent-verify passed.

Outside the task's layers::

  • crates/minimald/src/box_actor/naming.rs
  • crates/minimald/src/box_actor/tests.rs
  • docs/specs/18-spec-box-networking/18-spec-box-networking.md
  • scripts/session-e2e.sh

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/net/dns.rs:1086: The HostNet arm in box_actor/naming.rs now calls register_caller, so caller_owning finds facts for a host-address box. The naming test host_address_box_registers_its_caller_facts proves this.
  • 👍 valid — crates/minimald/src/net/proxy.rs:310: Fixed through C1: a host-address box now registers caller facts, so has_unleased_callers is true for it in production and the owner lookup runs.
  • 👍 valid — crates/minimald/src/net/proxy.rs: caller_for now maps a None from caller_owning to CallerLookup::Unattributed. A new test leg expects 403 Forbidden for a box with no registered facts.
  • 👍 valid — crates/minimald/src/net/proxy.rs:3818: The production registration is now proved by the box actor test host_address_box_registers_its_caller_facts. The proxy test comment names that test.
  • 👍 valid — crates/minimald/src/net/proxy.rs: Same fix as C2: a known box with no caller facts is Unattributed (403). NoBox stays only for ConnectingOwner::NoBox.

A box allowed only github.com gets REFUSED at once for example.com, and the e2e now fails unless that lookup fails at resolution inside 5000 ms. A box created with only --allow-subnets 0.0.0.0/0 resolves outside names again. A deny-all host-address box gets its caller facts registered by the session actor, so its request through the hostname proxy to another box is refused with 403. A connection that the kernel names a box for, but that box has no caller facts, is refused too.

Notes from the agent: Revise round 2. The directive asked for changes in files outside the task's layers: crates/minimald/src/box_actor/naming.rs (C1, register_caller in the HostNet arm), crates/minimald/src/box_actor/tests.rs (the C1 naming test host_address_box_registers_its_caller_facts), scripts/session-e2e.sh (C3) and docs/specs/18-spec-box-networking/18-spec-box-networking.md (C4). I touched them because the directive names them. The native-daemon-e2e fix: DnsGate::refuses now refuses on the name list only when the box is deny-all or the list is non-empty, with the unit test empty_name_list_with_subnets_forwards_outside_names and the module doc updated. C2: Router::caller_for returns Unattributed when caller_owning is None. The proxy_host_address_caller_egress_denied test gains a leg that expects 403 for a box with no caller facts, and its comment points to the naming test for the production registration. I did not run the session e2e (scripts/session-e2e.sh), so the C3 assertion is unverified on this box. The C3 elapsed time is measured around mnl session exec, so it includes the exec round trip, as the directive asked. I did not run just lint-prose because vale is not installed here. Deferred: cargo nextest run -p boxes kani_frame_verdict_admits_nothing_undeclared (lane: kani). The test exists in crates/boxes/src/core/egress.rs, and I did not run it.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft October 28, 2026 08:14
@norrietaylor
norrietaylor marked this pull request as ready for review October 28, 2026 08:17
The refusal warning keys a bucket of the name under a per-process
random hasher, so the fixed second name shared the first one's bucket
on one run in 256 and its line was suppressed.
Each connection from the node's address walks /proc on the blocking
pool. Allow four walks at once, daemon-wide. A connection that waits
more than five seconds for a slot is refused as unattributed.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approval withheld

Verdict COMMENT — APPROVE withheld: 4 unresolved threads — minimal-arch[bot] crates/minimald/src/net/dns.rs:1086, minimal-arch[bot] crates/minimald/src/net/proxy.rs:323, minimal-arch[bot] crates/minimald/src/net/proxy.rs, minimal-arch[bot] crates/minimald/src/net/proxy.rs:3846. 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimald/src/net/dns_gate.rs Resolved

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: CONDITIONS · 1 condition · the full ruling

The proxy side of NET-070 conforms. Unknown owners and lookups without a slot fail closed. Baseline conditions C1, C3 and C4 are met. A new exemption in DnsGate::refuses forwards outside names for a box with only allow_subnets. Section 5.3 line 145 says the relay must refuse those names. The CLI and NET-074 treat that shape as allow-all, so I escalated the question for a design decision. Make the change in C1: record the exemption as a residual in the spec and in the code comments. Do not change the gate behaviour in this round.

Ruled at 9834586 against gominimal/arch@109541a48c31 by claude-opus-5-5.

Comment thread crates/minimald/src/net/dns_gate.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a failed check suite, pushed as 983458646c1f.

line exit tail
cargo nextest run -p minimald unmatched_name_refused_without_upstream_forward 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-568d... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimald unmatched_name_never_forwarded_for_any_allow_set 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-f885... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling graph v0
cargo nextest run -p minimald proxy_caller_egress_denied 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-6242... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimald proxy_host_address_caller_egress_denied 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-a588... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify min task run agent-verify passed.

Outside the task's layers::

  • crates/minimald/src/box_actor/naming.rs
  • crates/minimald/src/box_actor/tests.rs
  • docs/specs/18-spec-box-networking/18-spec-box-networking.md
  • scripts/session-e2e.sh

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — PRRT_kwDOPdfcxM6xB_0q: The test now picks a second name in a different bucket from the first, so it passes every run. Production keeps the per-process random key and its 256-key bound. The doc comment already says that two names in one bucket share one line a minute. (not posted on the thread: not an open thread on the pull request)
  • 👍 valid — PRRT_kwDOPdfcxM6xB_0x: caller_for now holds a slot of a process-wide semaphore (OWNER_LOOKUPS = 4) around the /proc walk. A connection that waits more than 5 s for a slot is refused as Unattributed, so a burst cannot fill the blocking pool or open the gate. (not posted on the thread: not an open thread on the pull request)
  • 👍 valid — PRRT_kwDOPdfcxM6xB_04: The fix for this one is in proxy.rs caller_for: no more than four socket_holder walks run at once, daemon-wide. A connection that waits past 5 s for a slot fails closed. socket_holder itself is unchanged. (not posted on the thread: not an open thread on the pull request)

A box allowed only github.com gets REFUSED at once for example.com, and the relay forwards the query to no resolver. A deny-all host-address box's request through the hostname proxy to another box is refused with 403. This round also makes the per-name warning test deterministic, and caps the proxy's /proc owner lookups at four at a time.

Notes from the agent: Failed checks: the test-kvm excerpt in the directive holds only the job's cleanup steps, not the step that failed. This box has no /dev/kvm, so I could not run the e2e and could not find the cause. I read the e2e legs that the NET-141 change can affect: the own-IP egress proof's new fast-refusal assertion for example.org, the hostname-only toolchain box, and the undeclared-name leg. Each box declares a non-empty allow_dns_hosts, and the gate code refuses an unmatched name for all of them, as the assertions expect. I changed nothing in scripts/ this round. Someone must read the full test-kvm log to find the failing step. The test (deferred: kani) line, kani_frame_verdict_admits_nothing_undeclared, is still owed by the kani lane, and I ran nothing for it. I added no unit test for the lookup cap. The semaphore is process-wide, and a test that drains it can affect other tests when they share a process under cargo test.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft October 29, 2026 11:36
@minimal-foundry minimal-foundry Bot added the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Oct 29, 2026
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: the diff is +1786/-199 (1985 lines), past 3x the plan's estimate of 620 lines (est: 260 code, 360 tests, as #2693 reads now), at round 4 (the last trigger was a /revise note). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #2693 by hand.

@norrietaylor
norrietaylor marked this pull request as ready for review October 29, 2026 11:55

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of 63e1bbcd0ad2 withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 29, 2026

@norrietaylor norrietaylor left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Babysitter review at 63e1bbcd. I read T106's relay gate and proxy owner checks against the plan block and arch's rulings 545, 546, 567, 570 and the PASS at this head.

  • Names: the relay gate refuses unmatched names outside the zone for partial allow lists and the deny-all shape (NET-141); a box with only allow_subnets keeps forwarding, as the module doc states (owner ruling: superseded by arch PASS).
  • Proxy owner checks (NET-070): an off-node peer is OffNode and is refused as unattributed while an own-address box is attaching; a stopped box no longer turns on the owner lookup, a launching box counts as live, and a replaced host's late stop is ignored by launch number (mark_host_stopped, dns.rs:1873). Multiple socket holders resolve to the box, and two box leaves are refused (owner_of_holders).
  • Residual: the log bucketing and the lookup-slot DoS are #2745, by the owner's ruling.
  • Threads: zero open; I checked each fix in code before resolving it. CI: every lane aggregator is green at this head.

No further findings.


Generated by Claude Code

@norrietaylor norrietaylor removed the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Oct 29, 2026
@norrietaylor norrietaylor changed the title T106 — Refuse unmatched names for partial allow lists and gate host-address proxy callers feat(minimald): refuse unmatched names for partial allow lists and gate proxy callers (T106) Oct 29, 2026

@norrietaylor norrietaylor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Babysitter approval at 63e1bbc: every merge gate passes at this head (arch PASS at 63e1bbc, zero open threads, every lane aggregator green). Squash title feat(minimald): refuse unmatched names for partial allow lists and gate proxy callers (T106) and the squashed message pass commitlint. Queued for squash merge.


Generated by Claude Code

Copy link
Copy Markdown
Member

@cla-assistant check


Generated by Claude Code

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: CONDITIONS · 1 condition · the full ruling

The merge of main opens a gap in the NET-070 proxy gate. An ended HostNet box whose name another box holds has no caller facts. Destroy then launches its hook host. has_unleased_callers counts only boxes with caller facts, so the proxy passes the hook's request as a host-side client. Section 7.1 line 249 says the proxy must enforce the source's egress rules. Make the change in C1, and the change conforms.

Ruled at a6c3214 against gominimal/arch@42d214dc8ac8 by claude-opus-5-5.

/// count until [`Self::begin_host_launch`] or [`Self::mark_running`]
/// (NET-070).
#[must_use]
pub fn has_unleased_callers(&self) -> bool {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C1 · This predicate counts only ids in self.callers. On the merged head, an ended HostNet box whose name another box holds has no caller facts, and destroy launches its hook host. Its hook requests then get NoBox in caller_for. Section 7.1 line 249 says the proxy must enforce the source's egress rules. Also count an id in self.launching with no own-address entry and no lease. Then caller_owning answers None, and the request is refused.

An ended box brought up for its destroy hooks can launch with no caller
facts, when another box holds its name and the actor skips
register_hostname. has_unleased_callers iterated only the caller facts,
so the launch did not turn the owner lookup on, and the hook's proxied
request passed as no box's. A launching box with no own address and no
lease now counts whether or not it has caller facts, so the proxy
refuses its connections as unattributed (NET-070, design §7.1).
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Revise round 3 ran against ci-macos-success, e2e and left it red; a coder round cannot clear it, a person should look. No round was started for the failed suite on a6c3214f0339.

@norrietaylor

Copy link
Copy Markdown
Member

/arch-review

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: PASS · the full ruling

The compare closes the open gap on the hostname proxy. A launching box with no caller facts now turns on the owner lookup. The proxy then refuses its request as unattributed. Section 7.1 lines 244 and 249 require this default-deny, and the new test proves it. The rest of the change keeps the status of the PASS on 63e1bbcd.

Ruled at 90731ef against gominimal/arch@42d214dc8ac8 by claude-opus-5-5.

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: PASS · the full ruling

The commit closes a gap in the §7.1 proxy gate. An ended box that launches for its destroy hooks without caller facts now turns on the owner lookup. The proxy then refuses its request and does not let it through as a host-side client's. Section 7.1 line 249 says that a routing surface is never a policy bypass, and the change now conforms to that line. The rest of the PR keeps the earlier ruling. There are no conditions.

Ruled at 90731ef against gominimal/arch@42d214dc8ac8 by claude-opus-5-5.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approval withheld

Verdict COMMENT — APPROVE withheld: 1 unresolved thread — minimal-arch[bot] crates/minimald/src/net/dns.rs:1217. No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot removed the review:approved minimal-review approved the current head label Oct 30, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 302edaf Oct 30, 2026
37 checks passed
@norrietaylor
norrietaylor deleted the agent/2693-refuse-unmatched-names-for-partial-allow-lists-a branch October 30, 2026 01:11
norrietaylor pushed a commit that referenced this pull request Nov 4, 2026
…e proxy callers (#2716)

T106. NET-141: the relay's DNS gate answers REFUSED, before any onward query, for every
name outside the box zone that a declared allow_dns_hosts list does not match. It did this
only for a deny-all box, so a box with a partial list still sent the name off the machine.
An empty list that admits subnets keeps forwarding. Each refusal writes one rate-limited
warning, keyed by a bounded hash bucket of the name.

NET-070: the hostname proxy names the box behind a connection from the node's address
through the socket's inode, its holder and that process's classifier leaf, and applies that
box's egress rules. While a host-address box is live, a connection whose owner cannot be
named is refused. Owner lookups are capped at four at once, and a wait over five seconds
is refused as unattributed. session-e2e.sh asserts the partial allow list refuses fast.

Backport of #2716, folded from #2755.

Adapted to the line:
- Box actor and box runtime hunks land in session.rs and session_host.rs.
- boxes, sandbox and box_runtime read sessions, sandbox2 and session_host, with
  SessionPolicy and SessionKeyPredicate. crate::traced becomes tokio::spawn and
  tokio::task::spawn_blocking, and the line's policy has no quic443 field.
- register_host_net keeps #2749's dial at the guest's 127.0.0.1 beside the host_net record.

Dropped: the edits to the BEP steering tests in dns_gate.rs, since the line has no BEP
steering, and the NET spec hunk, since the line's NET-141 text differs from main's.

(cherry picked from commit 302edaf)
norrietaylor pushed a commit that referenced this pull request Nov 5, 2026
…e proxy callers (#2716)

T106. NET-141: the relay's DNS gate answers REFUSED, before any onward query, for every
name outside the box zone that a declared allow_dns_hosts list does not match. It did this
only for a deny-all box, so a box with a partial list still sent the name off the machine.
An empty list that admits subnets keeps forwarding. Each refusal writes one rate-limited
warning, keyed by a bounded hash bucket of the name.

NET-070: the hostname proxy names the box behind a connection from the node's address
through the socket's inode, its holder and that process's classifier leaf, and applies that
box's egress rules. While a host-address box is live, a connection whose owner cannot be
named is refused. Owner lookups are capped at four at once, and a wait over five seconds
is refused as unattributed. session-e2e.sh asserts the partial allow list refuses fast.

Backport of #2716, folded from #2755.

Adapted to the line:
- Box actor and box runtime hunks land in session.rs and session_host.rs.
- boxes, sandbox and box_runtime read sessions, sandbox2 and session_host, with
  SessionPolicy and SessionKeyPredicate. crate::traced becomes tokio::spawn and
  tokio::task::spawn_blocking, and the line's policy has no quic443 field.
- register_host_net keeps #2749's dial at the guest's 127.0.0.1 beside the host_net record.

Dropped: the edits to the BEP steering tests in dns_gate.rs, since the line has no BEP
steering, and the NET spec hunk, since the line's NET-141 text differs from main's.

(cherry picked from commit 302edaf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T106 — Refuse unmatched names for partial allow lists and gate host-address proxy callers

1 participant