Skip to content

feat(net): reject UDP to port 443 where a box's QUIC stance is blocked - #2513

Merged
norrietaylor merged 7 commits into
mainfrom
agent/2282-reject-udp-to-port-443-where-a-box-s-quic-stance
Oct 24, 2026
Merged

norrietaylor merged 7 commits into
mainfrom
agent/2282-reject-udp-to-port-443-where-a-box-s-quic-stance

Conversation

@minimal-foundry

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

Copy link
Copy Markdown
Contributor

T31 — Reject UDP to port 443 where a box's QUIC stance is blocked

slice: S4
kind: task
covers: BEP-018
size: L
est: 280 code, 240 tests
executor: agent
difficulty: needs care
model: standard
diagnostics: the bundle's daemon log tail carries each rejected UDP 443 datagram's box and destination, rate-limited
observability: one rate-limited debug log line per rejected datagram with the box and the destination
layers:
- net:
- crates/minimald/src/net/switch.rs: rejects UDP to 443 with ICMP port unreachable for a blocked box, and to the steered proxy address always
- crates/minimald/src/net/classifier.rs: blocks the host_ip cohort when any resident member is blocked
test: cargo nextest run -p minimald quic443_blocked_rejects_udp_443
test: cargo nextest run -p minimald udp_443_to_steered_proxy_rejected_in_every_stance
test: cargo nextest run -p minimald host_ip_cohort_quic_stance_most_restrictive_wins
- spec:
- crates/boxes/src/core/bep.rs: the property test over the stance resolution
test: cargo nextest run -p boxes prop_quic443_auto_resolves_on_grants_and_steering
produces: none
consumes: none
proof: A dns-steered grant box's QUIC to port 443 gets an immediate port-unreachable.
depends on:
- blocked by #2276

Proof

An own_ip box with a broker grant under dns (or both) steering sends UDP to port 443. Its relay now writes an ICMP port unreachable back into the box at once and does not forward the datagram, so a QUIC client falls back to TCP. UDP 443 to the Box Egress Proxy address gets the same answer in every stance. The relay tests show both cases end to end.

Notes from the agent: 1. Stance input: BoxPolicy carries quic443 since round 4. activate_box sets it from [session.network] quic443 for every box, lane or not, and BoxGate::for_session resolves policy.quic443.unwrap_or_default().blocks(..) over the auto facts (the lane's broker grants and resolved steering). A declared block or allow overrides auto in production. The with_quic443 and set_quic443 test hooks are gone.
2. host_ip cohort: classifier.rs now has CohortQuic443 (join, leave, blocked, blocking_members), which decides most-restrictive-wins. It is not enforced. The host-address verdict comes from a fixed nftables table that the privileged step installs, and the module states that nothing edits it at launch or stop. Enforcement needs a UDP 443 rule in that table, keyed to a set or flag, and launch/stop wiring that calls join and leave. Both are open under residual #2515.
3. Diagnostics: each rejection writes tracing::debug! with switch_addr (the box's lease), destination and reason. Rate limit: one line per 10 s window per gate, which carries a suppressed count. I did not check that the bundle's daemon log tail keeps debug-level records.
4. Ordering: the UDP 443 check runs before the egress verdict. A blocked datagram gets the ICMP reply even if the box's rules would have dropped it in silence. IP fragments after the first are not parsed, so they pass to the egress verdict.
5. clippy -p minimald --all-targets shows no new warnings. The chunks_exact warning at switch.rs:521…[truncated]

Tests

line exit tail
cargo nextest run -p minimald quic443_blocked_rejects_udp_443 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-7223... Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc
cargo nextest run -p minimald udp_443_to_steered_proxy_rejected_in_every_stance 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-9b6a... 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 host_ip_cohort_quic_stance_most_restrictive_wins 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-f4f4... 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 boxes prop_quic443_auto_resolves_on_grants_and_steering 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-10c5... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling common v0.0.1 (/workbench

Verify

min task run agent-verify exited 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.

the sandbox ran rustc (1.98.1), the repository pins 1.97.0 in rust-toolchain.toml; a failure here may be the newer toolchain's, not this change's
Applying loadouts: default
Running task runtime-implement-verify in session task-runtime-implement-verify-73e1...
    Checking args v0.0.1 (/workbench/crates/args)
    Checking ot v0.0.1 (/workbench/crates/ot)
    Checking paths v0.0.1 (/workbench/crates/paths)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking common v0.0.1 (/workbench/crates/common)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking decode v0.0.1 (/workbench/crates/decode)
error: using `chunks_exact` with a constant chunk size
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: could not compile `minimald-rpc` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Layer exception

Round 4 added quic443 to BoxPolicy, so every BoxPolicy struct literal in the tree had to name the new field. Outside the T31 layers the change is the one-line quic443: None, in each literal, plus a three-line carry (quic443: policy.quic443 with its comment) in crates/minimald/src/box_actor/setup.rs:

  • crates/minimal/src/cmd/boxes/attach.rs, vm_host.rs
  • crates/minimal/src/dash/render.rs, rpc.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor/setup.rs, tests.rs
  • crates/minimald/src/net/dns_gate.rs, gvproxy_network.rs, listeners.rs, proxy.rs
  • crates/minimald/src/rpc/tests.rs
  • crates/minimald/tests/netns_root_integration.rs

Accepted under the layer-exception rule of 2026-10-19: a required one-line change in a file the layers do not name.

Residuals

  • #2515: enforce the host_ip cohort's blocked quic443 stance in the host-address nftables ruleset and call CohortQuic443::join and leave from the launch and stop paths (arch C2). CohortQuic443 decides most-restrictive-wins but nothing enforces it yet.

Closes #2282


Generated by Claude Code

BEP-018: the stance is blocked iff the value is block, or auto with a
credentialed upstream under dns or both steering.
BEP-018: the box relay answers UDP 443 with ICMP port unreachable
while the box's resolved stance is blocked, and toward the Box Egress
Proxy address in every stance. The gate resolves the auto stance from
the policy's credentialed lane; with_quic443 takes a declared one.
Each rejection writes a rate-limited debug line with box and destination.
BEP-018: CohortQuic443 holds each resident member's resolved stance
and blocks UDP 443 for the cohort when any member blocks. The cohort
table and launch wiring that enforce it are not in this change.
@coderabbitai

coderabbitai Bot commented Oct 24, 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: 43f14a72-af48-43ef-b853-28227b3b1847

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 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Reviewed: no findings; approval withheld, 1 thread unresolved at 4c69aada0a45.

APPROVE withheld: 1 unresolved thread — minimal-arch[bot] crates/minimald/src/net/classifier.rs:538. 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.

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 — 2 findings, 2 inline.

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

Comment thread crates/minimald/src/net/switch.rs Resolved
Comment thread crates/minimald/src/net/classifier.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 · 2 conditions · the full ruling

The relay rejects UDP 443 with an ICMP port unreachable, and the steered-proxy reject holds in every stance. Two gaps remain. First, the gate resolves only auto. A declared block or allow never reaches it, because BoxPolicy does not carry quic443. Section 5.3 line 150 says block and allow override auto. Make the change in C1. Second, nothing calls CohortQuic443, so the host_ip cohort block is not enforced, and the PR still closes #2282. File the issue and change the PR body as C2 says.

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

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

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings: the coder changed nothing. Revise round 1: no code change. The two review findings are correct about the gaps, but each fix needs files outside this task's layers. (1) The declared quic443 stance does not reach the daemon. mfile parses [session.network] quic443, but boxes::CredentialedUpstream (crates/boxes/src/lib.rs) has no quic443 field. So the gate holds the auto stance in production, and with_quic443 has only test callers. The fix needs a quic443 field on the policy wire type in crates/boxes/src/lib.rs, the client path that fills it, and a call where crates/minimald/src/net/gvproxy_network.rs builds the gate. (2) CohortQuic443 is a model with no production caller. The host_ip verdict comes from a fixed nftables table that the privileged step installs (classifier.rs module docs: nothing is edited at box launch). Enforcement needs that ruleset and the host_ip launch and stop path to join and leave the cohort. The spec's first slice lists host_ip cohort handling as a later slice. Both need a follow…[truncated]

Review threads the coder judged:

  • 👎 invalid — crates/minimald/src/net/switch.rs:1573: The gap is real, but the fix is outside this task's layers. The policy wire type boxes::CredentialedUpstream (crates/boxes/src/lib.rs) has no quic443 field, so the daemon never gets the declared stance. The fix needs that field, the client path that fills it, and a with_quic443 call in crates/minima
  • 👎 invalid — crates/minimald/src/net/classifier.rs:566: The gap is real, but the fix is outside this task's layers. host_ip egress is enforced by a fixed nftables table from the privileged install step, and nothing is edited at box launch. So enforcement needs ruleset changes and the host_ip launch and stop path to call join and leave. Neither is in clas

Copy link
Copy Markdown
Member

/revise Carry the declared quic443 stance into the gate (arch C1 on review 5636951737's successor at 889893c, threads 4366097285 and 4366097287; minimal-review thread 4366096691). The task's layers were too narrow for spec §5.3 line 150, so #2282 now has a policy layer naming the files:

  • crates/boxes/src/lib.rs: CredentialedUpstream gains the declared quic443 stance (Option<Quic443>), so the wire type the client registers carries it to the daemon.
  • crates/minimal/src/cmd/boxes/create.rs: credentialed_upstream_for fills it from [session.network] quic443, the field mfile already loads.
  • crates/minimald/src/net/gvproxy_network.rs: build the gate with the declared stance where BoxGate::for_session runs today, so block and allow override auto (policy.quic443.unwrap_or_default().blocks(..)).
  • A test in crates/minimald/src/net/switch.rs named declared_quic443_block_rejects_without_test_hook: a gate built from a policy that declares block, with no with_quic443 or set_quic443 call, rejects UDP 443 (thread 4366097287).

Arch C2 (thread 4366097289, the unenforced host_ip cohort) is held as the filed residual #2515, linked from the PR body; say in the CohortQuic443 doc comment that the type is not enforced yet and name #2515. Keep the relay rejects and the property test as they are.


Generated by Claude Code

CredentialedUpstream carries the [session.network] quic443 stance from
the client to the daemon, and BoxGate::for_session resolves it, so a
declared block or allow overrides auto (BEP-018, spec section 5.3).
The set_quic443 test hook is now test-only. CohortQuic443 says it is
not enforced yet (#2515).

@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 — 2 findings, 2 inline.

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

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimald/src/net/switch.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 declared quic443 stance now reaches the gate, but only for a box with a credentialed lane. A box with no broker grant that declares block still sends UDP to port 443, because credentialed_upstream_for returns None and the stance is lost. Section 5.3 says block and allow override, and section 5.4 makes quic443 a [network] field of every box. Move the stance to BoxPolicy as C1 says. The cohort enforcement can stay open as residual #2515.

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

Comment thread crates/boxes/src/lib.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimald/src/net/switch.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p minimald quic443_blocked_rejects_udp_443 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-a7d7... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc
cargo nextest run -p minimald udp_443_to_steered_proxy_rejected_in_every_stance 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-2cdb... 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 host_ip_cohort_quic_stance_most_restrictive_wins 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-7625... 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 boxes prop_quic443_auto_resolves_on_grants_and_steering 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-6f38... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling common v0.0.1 (/workbench
cargo nextest run -p minimald declared_quic443_block_rejects_without_test_hook 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-2420... 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 exited 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.

the sandbox ran rustc (1.98.1), the repository pins 1.97.0 in rust-toolchain.toml; a failure here may be the newer toolchain's, not this change's
Applying loadouts: default
Running task runtime-implement-verify in session task-runtime-implement-verify-382c...
    Checking ot v0.0.1 (/workbench/crates/ot)
    Checking args v0.0.1 (/workbench/crates/args)
    Checking paths v0.0.1 (/workbench/crates/paths)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking common v0.0.1 (/workbench/crates/common)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking decode v0.0.1 (/workbench/crates/decode)
error: using `chunks_exact` with a constant chunk size
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: could not compile `minimald-rpc` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/net/switch.rs: CredentialedUpstream now carries quic443, create.rs fills it from [session.network] quic443, and BoxGate::for_session resolves quic443.unwrap_or_default().blocks(..), so block and allow override auto.
  • 👍 valid — crates/minimald/src/net/switch.rs: Added declared_quic443_block_rejects_without_test_hook: gates built from policies that declare block (and allow) with no set_quic443 call. with_quic443 is removed and set_quic443 is cfg(test).
  • 👍 valid — crates/minimald/src/net/classifier.rs:538: The CohortQuic443 doc comment now says the type is not enforced yet: nothing calls join or leave, and no filter rule reads blocked(). It names Enforce the host_ip cohort's blocked QUIC stance in the host-address ruleset #2515 for the enforcement.

A dns-steered grant box's UDP to port 443 gets an immediate ICMP port unreachable. A box that declares quic443 = "block" in [session.network] gets the same reject, and one that declares "allow" sends QUIC. The stance now comes from the box's own policy and not from a test hook.

Notes from the agent: gvproxy_network.rs is not changed. BoxGate::for_session now reads the declared stance from policy.credentialed_upstream.quic443 (policy.quic443.unwrap_or_default().blocks(..)), so the gate that gvproxy_network.rs builds at line 307 takes the declared stance with no change at that call site, and so does every other caller. with_quic443 is removed because it had no caller. set_quic443 is now #[cfg(test)], and so is the quic443_facts field it reads. Residual: the stance travels on CredentialedUpstream, so a box with no credentialed lane (no broker grant and no --credentialed-upstream flag) that declares quic443 = "block" still gets no reject at the daemon. Its policy carries no upstream to hold the stance. The arch note asked for this placement, but spec section 5.3 says block always blocks. A follow-up must carry the stance outside the lane. The cargo-deny failure is a RustSEC advisory on the russh dependency tree (ecdsa/primeorder). The fix is in deny.toml or Cargo.lock, outside this task's layers, so it is not addressed here. ci-success fails only because of that cargo-deny failure. I did not run just ci or a workspace build.

Copy link
Copy Markdown
Member

/revise Arch C1 at 35b0b48 (review threads 4366213191, 4366213192, 4366213193; minimal-review thread 4366211977): the declared quic443 stance reaches the gate only for a box with a credentialed lane, because credentialed_upstream_for returns None without a grant or the flag, and a grant-less project with quic443 = "block" still sends UDP 443. Spec §5.4 makes quic443 a [network] field of every box and §5.3 line 150 says block and allow override auto.

  • crates/boxes/src/lib.rs: move the stance from CredentialedUpstream to BoxPolicy (quic443: Option<Quic443>, same serde attributes), so every box carries it.
  • crates/minimal/src/cmd/boxes/create.rs: set BoxPolicy.quic443 from project_quic443 in activate_box, and drop the parameter credentialed_upstream_for took for it.
  • crates/minimald/src/net/switch.rs (and gvproxy_network.rs where the gate is built): read policy.quic443 and resolve unwrap_or_default().blocks(credentialed, steering); add the test declared_quic443_block_rejects_without_test_hook as a grant-less box that declares block and gets the ICMP reject, and keep the credentialed-lane case.
  • minimal-review thread 4366211980 (LOW, BoxGate::refuse_udp_443): skip multicast and broadcast destinations (RFC 1122 forbids ICMP errors for them, and the reply would carry the group address as its source).

Arch C2 (cohort enforcement) stays held on #2515. The task's policy layer on #2282 already names lib.rs, create.rs and gvproxy_network.rs.


Generated by Claude Code

RFC 1122 forbids an ICMP error for a datagram to a multicast or
broadcast address, and the reply would carry the group address as its
source. refuse_udp_443 now passes such datagrams to the egress verdict.

@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/classifier.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 relay rejects UDP 443 correctly for a box whose stance resolves to blocked, and to the proxy address in every stance. But a box with no broker grant loses its declared quic443 = "block", because the stance rides only CredentialedUpstream. Section 5.3 line 150 says block and allow override auto. The test leg for a declared block with no lane passes only through the test hook set_quic443. Make the change in C1: carry the stance on BoxPolicy and prove it without the hook. The host_ip cohort enforcement stays open as #2515.

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

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/boxes/src/lib.rs Resolved
Comment thread crates/minimald/src/net/switch.rs Resolved
Comment thread crates/minimald/src/net/switch.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a /revise note, pushed as 0a055ebb2f88.

line exit tail
cargo nextest run -p minimald quic443_blocked_rejects_udp_443 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-645f... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc
cargo nextest run -p minimald udp_443_to_steered_proxy_rejected_in_every_stance 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-c0f3... 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 host_ip_cohort_quic_stance_most_restrictive_wins 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-dcfe... 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 boxes prop_quic443_auto_resolves_on_grants_and_steering 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-8977... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling common v0.0.1 (/workbench
cargo nextest run -p minimald declared_quic443_block_rejects_without_test_hook 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-7503... 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 exited 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.

a v1.7.2 (https://github.com/souk4711/hakoniwa.git?rev=0810ffa37620ef5c57de263c8eaa1f4d7633c14a#0810ffa3)
    Checking ed25519 v3.0.0
    Checking opentelemetry-http v0.33.1
    Checking opentelemetry-proto v0.33.0
    Checking tracing-serde v0.2.0
    Checking nickel-lang-core v0.19.0
   Compiling heapless v0.9.3
    Checking json-subscriber v0.3.1
    Checking opentelemetry-otlp v0.33.0
    Checking tracing-appender v0.2.5
    Checking ed25519-dalek v3.0.0
    Checking ssh-cipher v0.3.0
    Checking args v0.0.1 (/workbench/crates/args)
    Checking p384 v0.14.0
    Checking p521 v0.14.0
    Checking opentelemetry-appender-tracing v0.33.1
    Checking hash32 v0.3.1
    Checking common v0.0.1 (/workbench/crates/common)
   Compiling smoltcp v0.14.0
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking ssh-key v0.7.0-rc.11
    Checking russh-cryptovec v0.62.0
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking russh-util v0.52.0
    Checking bitflags v1.3.2
    Checking managed v0.8.0
    Checking moka v0.12.16
    Checking russh v0.64.1
    Checking async-compression v0.4.50
    Checking async-tar v0.6.1
    Checking is_executable v1.0.6
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking clap_complete v4.6.11
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking hickory-proto v0.26.3
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking dashmap v6.2.1
    Checking vsock v0.5.4
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking russh-sftp v2.4.0
    Checking tokio-vsock v0.7.2
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
   Compiling darling_core v0.24.0
   Compiling signal-hook v0.3.18
    Checking castaway v0.2.4
   Compiling darling_macro v0.24.0
   Compiling convert_case v0.10.0
   Compiling strum_macros v0.28.0
error: using `chunks_exact` with a constant chunk size
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: could not compile `minimald-rpc` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Review threads the coder judged:

  • 👎 invalid — PRRT_kwDOPdfcxM6v2HA-: The finding holds, but the fix is outside the task's layers: moving quic443 to BoxPolicy breaks ~37 BoxPolicy literals in 16 files the layers do not name (dns_gate.rs, listeners.rs, proxy.rs, vm_host.rs, dash/*, minimald-rpc tests, minvmd tests and others). Not changed this round. The file list is i (not posted on the thread: not an open thread on the pull request)
  • 👍 valid — PRRT_kwDOPdfcxM6v2HBB: refuse_udp_443 now skips IPv4 multicast, 255.255.255.255 and link-layer group frames. quic443_blocked_rejects_udp_443 asserts no reply for each. (not posted on the thread: not an open thread on the pull request)
  • 👎 invalid — crates/boxes/src/lib.rs:353: The finding holds, but adding quic443 to BoxPolicy breaks ~37 struct literals in 16 files outside the task's layers. Not moved this round. The layers must name those files first.
  • 👎 invalid — crates/minimal/src/cmd/boxes/create.rs:220: The finding holds, but it depends on BoxPolicy.quic443, and that field breaks ~37 struct literals in 16 files outside the task's layers. create.rs is unchanged this round.
  • 👎 invalid — crates/minimald/src/net/switch.rs:1532: The finding holds, but reading policy.quic443 needs the BoxPolicy field, which breaks ~37 struct literals in 16 files outside the task's layers. Not changed this round.

A dns-steered grant box that sends QUIC to port 443 gets an immediate ICMP port unreachable. A datagram to a multicast or broadcast address gets no ICMP answer. A grant-less box that declares quic443 = "block" still sends UDP 443, because the C1 move is not done in this round (see notes).

Notes from the agent: This round fixed the multicast and broadcast finding only. refuse_udp_443 now skips a datagram to an IPv4 multicast address, to 255.255.255.255, or in a frame with the group bit set in the destination MAC. It does not detect a subnet-directed broadcast, because the gate does not know the subnet. The arch C1 move (quic443 from CredentialedUpstream to BoxPolicy) is NOT done. BoxPolicy has no default for a new field in a struct literal, so the move breaks about 37 BoxPolicy literals in files outside the task's layers: crates/minimald-rpc/src/tests.rs, crates/minimald/src/box_actor/setup.rs, crates/minimald/src/box_actor/tests.rs, crates/minimald/src/box_manager/tests.rs, crates/minimald/src/box_runtime.rs, crates/minimald/src/net/dns_gate.rs, crates/minimald/src/net/listeners.rs, crates/minimald/src/net/proxy.rs, crates/minimald/src/rpc/tests.rs, crates/minimald/tests/netns_root_integration.rs, crates/minimal/src/cmd/boxes/attach.rs, crates/minimal/src/cmd/boxes/vm_host.rs, crates/minimal/src/dash/render.rs, crates/minimal/src/dash/rpc.rs, crates/minvmd/tests/guest_classifier_integration.rs, crates/minvmd/tests/vm_escape_integration.rs. Each needs quic443: None. My instructions do not let me widen the diff to these files, so the task's layers must add them (or a person must approve the widening) before the next round. The change itself is small: add #[serde(default, skip_serializing_if = "Option::is_none")] pub quic443: Option<core::bep::Quic443> to BoxPolicy, set it in BoxPolicy::new to None, set it from project_quic443 in activate_box, and read policy.quic443 in BoxGate::new. The failed checks (cargo-deny RUSTSEC advisory under russh/ecdsa, a m…[truncated]

Copy link
Copy Markdown
Member

/revise Arch C1 stands at 0a055eb (review threads 4366276496, 4366276497, 4366276498, 4366276499): round 3 added the multicast skip but left the declared stance on CredentialedUpstream, so a box with no broker grant and no flag still loses quic443 = "block". Do these four edits, nothing else:

  1. crates/boxes/src/lib.rs: remove quic443 from CredentialedUpstream and add pub quic443: Option<Quic443> to BoxPolicy, with the same serde attributes (default, skip when None).
  2. crates/minimal/src/cmd/boxes/create.rs: drop the quic443 parameter from credentialed_upstream_for and its callers; in activate_box set BoxPolicy.quic443 from project_quic443 for every box, lane or not.
  3. crates/minimald/src/net/switch.rs BoxGate::for_session (line 1529): read the declared stance from policy.quic443 and resolve unwrap_or_default().blocks(credentialed, steering); keep the auto facts from policy.credentialed_upstream as they are.
  4. The test leg at switch.rs:7474: build the policy with credentialed_upstream: None and quic443: Some(Quic443::Block), drive it through spawn_test_relay, and assert the ICMP reject with no set_quic443 or with_quic443 call. Name it declared_quic443_block_rejects_without_test_hook, the test the T31 — Reject UDP to port 443 where a box's QUIC stance is blocked #2282 policy layer lists.

Also minimal-review thread 4366276143 (LOW): the PR title and body say the host_ip cohort is blocked, and nothing enforces CohortQuic443 yet. Narrow the claim: say in the body's Proof that cohort enforcement is open under #2515, and keep the doc comment that says the type is not enforced yet. #2282's policy layer already names lib.rs, create.rs and gvproxy_network.rs.


Generated by Claude Code

A box with no broker grant and no --credentialed-upstream flag has no
CredentialedUpstream, so a declared `quic443 = "block"` was lost before
it reached the gate (BEP-018, spec section 5.3).

The stance now rides BoxPolicy for every box. activate_box fills it
from `[session.network] quic443`, effective_session_policy carries it
verbatim, and BoxGate::for_session resolves it against the lane's
grants and steering. The set_quic443 test hook is gone. The tests build
the gate from a declared policy, a lane-less `block` box among them.

The other BoxPolicy literals gain `quic443: None`.

@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_WITH_CONDITIONS · 1 condition · the full ruling

The compare fixes the open item from the last round. The declared quic443 stance now rides BoxPolicy, so a box with no credentialed upstream that declares block rejects UDP 443. Section 5.4 makes quic443 a setting of every box, and the gate now reads it that way. The host_ip cohort rule of section 5.3 is still not enforced. C1 tracks it, and it can stay open as residual #2515. Also update notes 1 and 2 in the PR body, because they describe an earlier head.

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

Comment thread crates/minimald/src/net/classifier.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 — approval withheld

Verdict COMMENT — APPROVE withheld: 12 unresolved threads — minimal-arch[bot] crates/minimald/src/net/switch.rs, minimal-arch[bot] crates/minimald/src/net/switch.rs, minimal-arch[bot] crates/minimald/src/net/classifier.rs:538, minimal-arch[bot] crates/boxes/src/lib.rs, minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs, …. No findings.

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

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 4 of 10 on a /revise note, pushed as dcc3e39b3827.

line exit tail
cargo nextest run -p minimald quic443_blocked_rejects_udp_443 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-1192... Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc
cargo nextest run -p minimald udp_443_to_steered_proxy_rejected_in_every_stance 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-9242... 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 host_ip_cohort_quic_stance_most_restrictive_wins 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-7e38... 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 boxes prop_quic443_auto_resolves_on_grants_and_steering 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-55e0... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling common v0.0.1 (/workbench
cargo nextest run -p minimald declared_quic443_block_rejects_without_test_hook 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-8369... 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 exited 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.

the sandbox ran rustc (1.98.1), the repository pins 1.97.0 in rust-toolchain.toml; a failure here may be the newer toolchain's, not this change's
Applying loadouts: default
Running task runtime-implement-verify in session task-runtime-implement-verify-c8fb...
    Checking args v0.0.1 (/workbench/crates/args)
    Checking ot v0.0.1 (/workbench/crates/ot)
    Checking paths v0.0.1 (/workbench/crates/paths)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking common v0.0.1 (/workbench/crates/common)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking decode v0.0.1 (/workbench/crates/decode)
error: using `chunks_exact` with a constant chunk size
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: could not compile `minimald-rpc` (lib test) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `minimald-rpc` (lib) due to 1 previous error

Outside the task's layers::

  • crates/minimal/src/cmd/boxes/attach.rs
  • crates/minimal/src/cmd/boxes/vm_host.rs
  • crates/minimal/src/dash/render.rs
  • crates/minimal/src/dash/rpc.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor/setup.rs
  • crates/minimald/src/box_actor/tests.rs
  • crates/minimald/src/net/dns_gate.rs
  • crates/minimald/src/net/listeners.rs
  • crates/minimald/src/net/proxy.rs
  • crates/minimald/src/rpc/tests.rs
  • crates/minimald/tests/netns_root_integration.rs

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

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/net/classifier.rs:571: Narrowed the claim: the proof now says that host_ip cohort enforcement is open under Enforce the host_ip cohort's blocked QUIC stance in the host-address ruleset #2515. The CohortQuic443 doc comment still says that the type is not enforced yet.
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs:216: Removed the quic443 parameter from credentialed_upstream_for. activate_box now sets BoxPolicy.quic443 from project_quic443 for every box, lane or not.
  • 👍 valid — crates/boxes/src/lib.rs: Moved quic443 from CredentialedUpstream to BoxPolicy, with the same serde attributes. effective_session_policy carries it verbatim to the gate.
  • 👍 valid — crates/minimald/src/net/switch.rs: BoxGate::for_session now resolves policy.quic443.unwrap_or_default().blocks(credentialed, steering). The auto facts still come from credentialed_upstream.
  • 👍 valid — crates/minimald/src/net/switch.rs:7476: The leg now builds a policy with credentialed_upstream: None and quic443: Some(Block), and runs it through spawn_test_relay. set_quic443 is removed. declared_quic443_block_rejects_without_test_hook covers the same case.

A box with a dns-steered broker grant gets an immediate ICMP port unreachable when it sends UDP to port 443. A box that declares quic443 = "block" in [session.network] gets the same reject, with or without a credentialed upstream, and the gate takes that stance from the box's policy, not from a test hook. UDP 443 to the Box Egress Proxy address is rejected in every stance. Cohort enforcement for host_ip boxes is not in this pull request: CohortQuic443 holds the most-restrictive-wins logic, its doc comment says that nothing enforces it yet, and the enforcement is open under #2515.

Notes from the agent: Revise round 4 makes the four edits in the /revise note. quic443 moved from CredentialedUpstream to BoxPolicy (same serde attributes). credentialed_upstream_for lost its quic443 parameter, and activate_box sets BoxPolicy.quic443 for every box. BoxGate::for_session reads policy.quic443. The set_quic443 test hook and its quic443_facts field are removed, and every quic443 test now builds the gate from a declared policy through spawn_test_relay. declared_quic443_block_rejects_without_test_hook now starts with a policy that has credentialed_upstream: None, quic443: Some(Quic443::Block) and asserts the ICMP reject. The 7474 leg of quic443_blocked_rejects_udp_443 does the same.

Files outside the layers, all touched on purpose:

  • crates/minimald/src/box_actor/setup.rs: effective_session_policy rebuilds the policy that the gate reads. Without quic443: policy.quic443 there, a declared block is dropped before it reaches BoxGate::for_session. This is a required change, not a mechanical one.
  • A new BoxPolicy field breaks every struct literal that does not use ... These files only gain quic443: None in test or fixture literals, or in production literals that declare no stance: crates/minimal/src/cmd/boxes/attach.rs, crates/minimal/src/cmd/boxes/vm_host.rs, crates/minimal/src/dash/render.rs, crates/minimal/src/dash/rp…[truncated]

@minimal-foundry
minimal-foundry Bot marked this pull request as draft October 24, 2026 07:12

@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 dcc3e39b3827 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 24, 2026
@norrietaylor
norrietaylor marked this pull request as ready for review October 24, 2026 07:23
@norrietaylor norrietaylor changed the title T31 — Reject UDP to port 443 where a box's QUIC stance is blocked feat(net): reject UDP to port 443 where a box's QUIC stance is blocked Oct 24, 2026

@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_WITH_CONDITIONS · 1 condition · the full ruling

The merge from main does not touch this change. So the ruling on dcc3e39b stands for this head. The per-box quic443 gate and the steered-address reject conform to §5.3 line 150. The host_ip cohort stance is decided in CohortQuic443 but no rule enforces it. C1 closes that gap, and #2515 tracks it. The change can merge with C1 open.

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

Comment thread crates/minimald/src/net/classifier.rs Resolved
@minimal-foundry minimal-foundry Bot removed the review:approved minimal-review approved the current head label Oct 24, 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 4c69aad: every merge gate passes at this head (arch PASS, zero open threads, every lane aggregator green, bot resolutions re-verified). Squash title feat(net): reject UDP to port 443 where a box's QUIC stance is blocked and the squashed message pass commitlint. Queued for squash merge.


Generated by Claude Code

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit 1c94b06 Oct 24, 2026
37 checks passed
@norrietaylor
norrietaylor deleted the agent/2282-reject-udp-to-port-443-where-a-box-s-quic-stance branch October 24, 2026 22:52
norrietaylor added a commit that referenced this pull request Oct 29, 2026
…(0.7.0 backport) (#2742)

* fix(minimal): hold the answerer channel socket owner-only (#2297)

* fix(minimal,minvmd): hold the answerer channel socket owner-only

The box-zone answerer's channel socket was world-connectable: the
launchd plist bound it SockPathMode 0666 and the systemd socket unit
SocketMode=0666, leaving the peer-uid gate the only check on who may
connect. Both units now bind it owner-only -- SockPathOwner the
operator, SockPathMode 0600 on launchd; SocketUser the operator,
SocketMode=0600 on systemd -- with the uid gate kept as defence in
depth.

An install whose socket node carries group or other bits -- one that
predates the mode, or a hand that relaxed it -- now fails custody
through a channel_mode fact, so the advisory re-surfaces and a step
re-run re-binds the socket. The accept loop's foreign-refusal warn is
rate-limited to a few lines a second, so a connect storm cannot flood
the log; the refusals themselves are never limited.

* fix(minimal,minimald,minvmd): name the other account on a refused channel connect

A daemon whose connect the owner-only channel socket refuses now says
the host's DNS service belongs to another account, not a bare
Permission denied. The answerer step needs the operator's account to
resolve, with no stand-in uid, and custody fails a channel socket the
operator does not own.

* fix(minimal,minvmd): leave another operator's DNS service alone

A channel socket owned by another existing, non-root account is that
operator's service: the answerer step is now unavailable with the same
sentence the daemons say on a refused connect, instead of a custody
failure whose step would reinstall the unit and take the service over.
A root-owned socket, or one whose uid names no account, still fails
custody so the step re-binds it.

The minvmd tests that take the process-global foreign-refusal slots
now run one at a time and start and end with every slot free, and the
warn-rate test bounds the burst at two windows' worth of lines, so a
slow runner that spreads the burst does not fail it.

* fix(minimal): offer the step over a socket another account left behind

A channel socket another account owns refuses the answerer step only
when a service is installed; with none, the step's install removes the
leftover socket before it loads the unit, so it is offered.

---------

Co-authored-by: gominimal-aw-bot[bot] <281738952+gominimal-aw-bot[bot]@users.noreply.github.com>
(cherry picked from commit 746770d)

* fix(net): refuse out-of-zone names at a guest deny-subtree DNS listener (#2300)

* fix(net): refuse out-of-zone names at a guest deny-subtree DNS listener

A deny-all host-address box on a VM-backed guest resolved out-of-zone
names at the switch gateway: the interim NET-079 carve-out admitted the
gateway's port 53 whole, UDP and TCP, so a box that admits no destination
could still ask a resolver beyond the machine — and DNS over TCP could
retry past the verdict.

The guest's deny subtree now steers its UDP-53 lookups onto a loopback
listener on the answerer's port (NET-141 slice 2): deny_out admits the
listener beside the reply direction, the dstnat match carries no
destination address (the box asks the gateway like every other
host-address box; the steer is the carve-out), and the listener itself
answers REFUSED for every name outside the box zone — apex and a
non-lowercase zone suffix among them — NODATA for an in-zone non-A
question, and forwards the zone's A questions to the switch gateway
alone. DNS over TCP is neither steered nor admitted.

The guest daemon starts the listener after its classifier table loads;
the daemon's own lookups are untouched (cgroup-keyed match, deny path
only). The interim --gateway-resolver installer flag and every test,
digest and pin that spelled the interim carve-out follow the new shape.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(net): bound and pin the guest DNS listener's forwards

Connect each forward socket to the gateway so a datagram from any other
sender is dropped, cap forwards in flight so a flood cannot exhaust the
daemon's descriptors, and drop the needless to_string calls clippy
rejects in the guest classifier integration test.

* fix(net): refuse questionless and non-QUERY messages at the guest DNS listener

decide() forwarded a message with no question, and an UPDATE or NOTIFY
whose zone section named an in-zone A, because every per-question check
passed vacuously. Answer the first REFUSED and the rest NOTIMP, so the
forward path carries only standard lookups.

Bind the listener directly so its log does not read as the box-zone
answerer, pin the integration test's boot-log check to the exact
example.com REFUSED line, and cite NET-079 (the deny-all case) rather
than NET-141 at the lines this change added.

---------

Co-authored-by: gominimal-aw-bot[bot] <281738952+gominimal-aw-bot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 2c2f8cc)

* fix(net): spawn the guest DNS tasks with tokio::spawn on release/0.7.0

crate::traced landed on main after the release branch was cut, so the
cherry-pick of #2300 did not compile here.

* build: declare 0.7.3 for the release/0.7.0 backports

v0.7.2 is tagged at the branch head, so the version check requires the
next patch release.

* chore(deps): update pulldown-cmark to 0.13.5 for RUSTSEC-2026-0414

* fix(minimald): close the host classifier's mark, IPv6 and probe gaps (T105) (#2712)

* fix(minimald): close the classifier's mark, IPv6 and probe gaps

The install's conflict scan now treats a ct-mark write with no mask
as a user of every bit, names each rule with its table and chain,
and --ct-mark-mask refuses the ranges Tailscale and kube-proxy class
with. The table refuses non-loopback IPv6 from the boxes subtree and
counts that refusal in the same named counter as the deny chain.

The per-launch probe reads with a UDP datagram, so a launch no longer
waits the SYN retransmit a refused TCP connect pays. The reading at
daemon start keeps its TCP leg. Each probe logs its leg and duration.

* test(minimald): prove the classifier's mark, IPv6 and probe gaps live

Three root-lane proofs load the real table: the install refuses a
whole-mark ct writer and a mask in a well-known range, and an allow
box's IPv6 connection to a peer is refused and counted. The live probe
proof also checks the per-launch reading waits no retransmit.

* fix(minimald): pass shellcheck and pin the new mask refusals

The rerun hint's empty assignment tripped SC1007 in the shell lint
gate. The installer test pinned the old remedy text and escaped with
0x0000c000, the kube-proxy range the install now refuses: it now
pins the new remedy, escapes with 0x03000000, and pins the
well-known range refusal. The IPv6 refusal comment names the
condition that replaces it.

* fix(minimald): re-apply the recorded ct-mark mask and name min finalize-install

With no --ct-mark-mask, the install step adopts the mask a previous
install recorded under the tree. Mask refusals now name
min finalize-install --ct-mark-mask <mask>. The conflict scan joins the
nft and iptables-save hits with a newline.

* feat(minimal): add min finalize-install --ct-mark-mask and keep it at boot

The mask record lives in cgroupfs, so a reboot empties it. The classifier
step's block now passes the chosen or recorded mask to the one-time run
and to the boot unit's ExecStart, so the operator's bits survive a
reboot. A requested mask that differs from the loaded table's re-runs
the step.

* fix(minimald): refuse a CONNMARK --restore-mark that copies the whole mark

The install's ct-mark scan now treats --restore-mark with no --mask,
--ctmask or --nfmask, or an all-ones one, as a whole-mark writer, as it
does --save-mark. A restore with a narrow mask is still no conflict.

* fix(minimald): allow --restore-mark, bind probe datagrams first

A CONNMARK --restore-mark copies the connection mark into the packet
mark and never writes the connection mark, which is all the classifier
reads. This reverts 16d9160 and pins a restore with no mask as no
conflict.

hold_probe_listeners now binds its datagram endpoints before it spawns
any TCP drain thread, so a failed datagram bind returns before a
listener serves.

---------

Co-authored-by: minimal-foundry[bot] <327719912+minimal-foundry[bot]@users.noreply.github.com>
(cherry picked from commit 354548e)

* fix(minimald): adapt the host classifier gaps backport to release/0.7.0

The cherry-pick before this one keeps main's text for every line #2712
changes. Main's neighbouring code comes from the QUIC block work
(#2513, #2553, #2601, #2644), the box-name placement (#2722) and the
crate renames, none of which release/0.7.0 has. The conflicts were
resolved onto release's code without importing that work:

- classifier.rs: the four new unit tests are appended after release's
  last test, without the QUIC cohort tests main has above them. Their
  sandbox::classifier paths are sandbox2::classifier here.
- install-host-classifier.sh: the table gains the refused counter. The
  QUIC leaf set that main declares beside it is not on release, so it
  stays out. The --help range (2,87p) matches release's header too.
- finalize_install.rs: release has one classifier item, built by
  classifier_item_on_this_host, not main's classifier_items_on_this_host
  with the QUIC block helper item. That function takes --ct-mark-mask
  and fills recorded_mask and requested_mask itself. plan_for_this_host
  keeps release's names item placement and only passes the mask on.
- #2712's edits to finalize_install_names_the_quic_block_helper are
  dropped: release has no QUIC block helper item or test.
- install_test.sh: run_hc puts HC_PATH_PREFIX ahead of PATH, the line
  #2601 added on main. Without it the new --restore-mark case never
  reaches its stand-in iptables-save, and shellcheck flags the variable
  as unused.

The user-facing text is main's, unchanged.

---------

Co-authored-by: gominimal-aw-bot[bot] <281738952+gominimal-aw-bot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: minimal-foundry[bot] <327719912+minimal-foundry[bot]@users.noreply.github.com>
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.

T31 — Reject UDP to port 443 where a box's QUIC stance is blocked

1 participant