Repository navigation
fix(minimald,minvmd): git clone in a hostname-allowlist VM box is not refused on its own loopback - #3375
fix(minimald,minvmd): git clone in a hostname-allowlist VM box is not refused on its own loopback#3375minimal-foundry[bot] wants to merge 10 commits into
Conversation
An own-IP box with a hostname allowlist is placed in no leaf and runs in its own network namespace. Every refusing rule of the guest table needs a socket of the boxes subtree, so the one refused line on lo in a guest boot log is the effect probe's, from its deny leaf.
The boot log tail started at the boot, so git's tail carried the guest effect probe's refusal on lo and read as git's. Read the log from the first tool on, and assert that no minimal-classifier refusal on lo appears while the toolchain runs. Record the fact under NET-068.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Spec lint
Advisory. None of this blocks the merge; the review decides. Advisory, and never a merge gate. Linter: |
|
/revise make Evidence: the PR body says Do:
|
|
/revise make This repeats the Evidence: the PR body says Do:
|
|
/revise make This repeats the Evidence: the PR body says Do:
|
|
Round 3 of 10 on a /revise note: the coder changed nothing. No file changed, as the directive's item 3 says. I ran the steps of agent-verify with this branch's crates (minimald, minvmd). fmt passed. Clippy passed in 7m 15s, cold. nextest took 25m 26s of wall time. Hangs: minimald env::tests::minenv_run_forwards_stdin_to_the_task (#3415) and minimald env::tests::task_run_pipes_stdin_through_the_in_box_helper. Each one was still running after 780s, and I killed them. The second test is in the same module and also forwards stdin, so it is probably the same flake. Nextest reported the two killed tests as failed. Failures this box can reproduce on its own: minvmd net::egress_gate::tests::a_stalled_switch_does_not_hold_the_relay_past_a_guest_close fails at egress_gate.rs:21346 in about 5s. minimald env::tests::task_entrypoint_carries_env_cwd_and_args fails because this sandbox sets MINIMAL_OTEL=off, so the request starts with otel%off% and the run% prefix check fails. This branch touches neither env.rs nor egress_gate.rs. Slowest tests th…[truncated] |
|
Round 4 of 10 on a failed check suite: the coder changed nothing. Revise round 4 changes nothing. The directive gives two failed checks: ci-linux-native-success, which is the aggregator, and tests. The tests excerpt shows only PASS lines from the decode crate and job cleanup. It does not name a failing test, and I have no way to fetch the full log. This branch changes only a unit test in crates/minimald/src/net/classifier.rs, the ignored VM test in crates/minvmd/tests/egress_allowlist_integration.rs, and a comment and verify line in the 18 spec. No other test reads the spec file. Local results: the new unit test passes. |
norrietaylor
left a comment
There was a problem hiding this comment.
Read at f5c3434c against D2996. No product code changes. The coder found the minimal-classifier: refused line on lo was the guest effect probe's boot-time connect from boxes/deny/filter-probe-*, not git's: the e2e test read the boot log from offset 0, so the first tool's tail carried it. hostname_allowlist_box_loopback_connect_is_admitted pins against the installer's rendered guest table that every refusing rule needs a socket of the boxes subtree, and that a hostname allowlist is never placed in the deny subtree. The e2e test now skips the boot log, collects refusals with OUT=lo, and fails on any. The conditional layers (installer, launcher) were left alone because their conditions do not hold, and widening deny_out would break NET-079. That is the right call. VM evidence: test-kvm ran it on this head, PASS [78.024s] minvmd::egress_allowlist_integration hostname_allowlist_toolchain_completes (job 133595848876). That is one run, not the repeated runs the proof names, so the flake's absence rests on the merge queue and later runs.
|
Approved: every review thread resolved at @norrietaylor resolved the last thread, which releases the approval this review had withheld. Nothing to do. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 1 condition · the full ruling
The change conforms to the design. An own-IP box owns its localhost (UC1), and the classifier decides only sockets of the boxes subtree (§4.1 line 54). The new unit test pins this against the installer's render, and the PR correctly keeps deny_out closed on the loopback. The proof of NET-068 is open. hostname_allowlist_toolchain_completes did not run (exit 4, #[ignore] without MINVMD_E2E=1), but the body still says Fixes #3353. C1 keeps the issue open until a green KVM run exists, or files the proof as a residual with an issue.
Ruled at f5c3434 against gominimal/arch@327e1b57d16b by claude-opus-5-5.
…in-a-hostname-allowlist-vm-box-is-not
The loopback test now asserts that the output and ipv6_out chains have rules before it checks them, and that an own-IP launch is placed in no classifier leaf, through the launcher's named gate.
…in-a-hostname-allowlist-vm-box-is-not
|
Round 5 of 10 on the runtime's review findings, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
A person can run hostname_allowlist_box_loopback_connect_is_admitted and see that no rule of the guest table refuses a box's own loopback connect. The test also shows that an own-IP box is placed in no classifier leaf. The repeated-run half of the proof (hostname_allowlist_toolchain_completes passes, and the boot log has no minimal-classifier refused line for 127.0.0.1 on lo) is NOT shown by this branch yet. Only a KVM lane can run it, and no run of it is on record for this head. Notes from the agent: Revise round 5. I added the named gate placed_in_classifier_leaf to launcher.rs and used it at the one place where the launch decides to allocate a leaf. The behaviour does not change. The unit test now uses this gate to check the own-IP claim, and it asserts that the output and ipv6_out chains have rules. The minvmd test line exited 4 here because there is no /dev/kvm and MINVMD_E2E is not set. The evidence for NET-068 and the repeated-run proof is owed by the ci-linux-kvm lane. Until a green ci-linux-kvm run of hostname_allowlist_toolchain_completes is linked, the PR body must say Refs #3353, not Fixes #3353. I cannot edit the PR body. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms. An own-IP allowlist box has its own localhost and no classifier leaf, as UC1 line 83 and section 4.1 line 54 require. The launcher and the test now share one placement predicate, placed_in_classifier_leaf. The deny-all refusal stays loopback-wide, and the e2e leg now fails on any refusal on lo while the tools run. No conditions.
Ruled at e5a84b7 against gominimal/arch@327e1b57d16b by claude-opus-5-5.
|
Round 6 of 10 on the runtime's review findings: the coder changed nothing. Revise round 6: no code change. The one open finding is correct that no production behaviour changes, and that is deliberate. The earlier rounds found that the refused line on lo in the boot log came from the guest effect probe's deny leaf, not from git, and the e2e test read the log from boot start. The fix is in the test and the pinned table facts. The PR body is written by the runner, and no commit on this branch carries a closing keyword. Until a green ci-linux-kvm run of hostname_allowlist_toolchain_completes exists, the PR body must say 'Refs #3353', not 'Fixes #3353'. The minvmd test line is deferred to the KVM lane: this box has no /dev/kvm. Review threads the coder judged:
|
|
/revise Add Docker Hub's S3 blob host to the NET-068 allowlist. Change nothing else. The merge-queue Docker Hub's blob redirect can land on S3 directly, not only on Do:
|
…in-a-hostname-allowlist-vm-box-is-not
Docker Hub's blob redirect can land on docker-images-prod.s3.dualstack.us-east-1.amazonaws.com, not only on its two CDNs. The DNS gate refused that name, and the container pull in hostname_allowlist_toolchain_completes failed.
|
Round 7 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. The NET-068 allowlist now names docker-images-prod.s3.dualstack.us-east-1.amazonaws.com, so the DNS gate resolves Docker Hub's S3 blob redirect in a hostname-allowlist box. The dns_gate unit test resolves and pins that name. Repeated passing runs of hostname_allowlist_toolchain_completes still need a KVM lane. This box did not run them. Notes from the agent: The directive asked for this round's change. It changes crates/boxes/src/lib.rs and crates/minimald/src/net/dns_gate.rs, and the task's layers do not name these files. The test toolchain_hosts_admitted_by_gate in dns_gate.rs pins the constant's contents and order, so it got a new S3 entry with a representative us-east-1 S3 address (52.217.161.40). denied_range_resolution_logged fails in a parallel run with or without this change. It counts log lines from a shared capture, and it passes with --test-threads=1. The boxes doctests did not run because rustdoc is missing on this box. cargo nextest run -p minvmd hostname_allowlist_toolchain_completes did not run this round. It needs KVM and MINVMD_E2E=1 (deferred: ci-linux-kvm). No thread verdict changed this round. |
norrietaylor
left a comment
There was a problem hiding this comment.
Re-read at 58b6f65b. Since my last approval: round 5 asserts that the output and ipv6_out rule lists are not empty (the LOW finding) and moves the launcher's HostNet-only leaf check into placed_in_classifier_leaf, which the unit test pins (no behaviour change). Round 7 adds docker-images-prod.s3.dualstack.us-east-1.amazonaws.com to NET068_TOOLCHAIN_EGRESS_HOSTS, the DNS-gate fixture and the spec 18 note, after two merge-queue test-kvm runs failed on that redirect. boxes/src/lib.rs and dns_gate.rs are accepted as out of scope at this head. test-kvm on this head: PASS [72.710s] hostname_allowlist_toolchain_completes. The agent-verify hang is #3415.
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms. Since the PASS on e5a84b7a, the only change in this PR's files adds Docker Hub's S3 blob host to the test-only NET-068 allow-list. UC3 line 99 provides for named DNS hosts on a per-box allow-list. The classifier, launcher and e2e changes are as they were at the earlier PASS.
Ruled at 58b6f65 against gominimal/arch@327e1b57d16b by claude-opus-5-5.
…in-a-hostname-allowlist-vm-box-is-not
The effect probe's refusal on lo can reach the console after the offset moves. Wait until the log stops growing, so a late boot line does not count as a refusal from a tool's run.
|
Round 8 of 10 on the runtime's review findings, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
The PR links two green ci-linux-kvm runs of hostname_allowlist_toolchain_completes (on f5c3434 and 58b6f65). The test fails on any minimal-classifier refused line on lo while the toolchain runs. This round, the test also waits for the boot log to stop growing before the tools run, so a late boot-time probe line cannot fail it. Notes from the agent: This round changed only the e2e test: skip_boot_log now waits until the guest boot log does not grow for 1 s (at most 10 s) before it moves the offset. The VM test cannot run on this box (no KVM), so the nextest line exited 4 with no tests run. The ci-linux-kvm lane owes the run on this head. The nextest exit code comes from nextest itself, not from the pipe. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
This head changes only the e2e harness. skip_boot_log now waits for a quiet boot log before the tools run. The lo_refusals assertion does not change, and the wait ends before the first tool runs. So the proof of NET-068 does not get weaker (UC1 line 83, UC3 line 99). If the log never gets quiet or is missing, the test still fails closed. The ruling on 58b6f65b stands for the rest of the change. No condition is open. The KVM lane run of hostname_allowlist_toolchain_completes on this head is the proof of record.
Ruled at f346f57 against gominimal/arch@327e1b57d16b by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 2 unresolved threads — minimal-foundry[bot] crates/minimald/src/net/classifier.rs:7370, minimal-foundry[bot] crates/minvmd/tests/egress_allowlist_integration.rs:323. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
norrietaylor
left a comment
There was a problem hiding this comment.
Re-read at f346f577. Round 8 is test-only: skip_boot_log now waits until the guest boot log stops growing for 1s (10s at most) before it moves the offset, so a late console line from the boot probe's refusal cannot land in the first tool's tail. I agree with the coder's rejection of the other LOW: the unit test cannot load nft, and its fixed chain list is meant to fail on a new refusing chain. The rest is a main merge. The out-of-scope files are unchanged since 58b6f65b. test-kvm on this head: PASS [93.353s] hostname_allowlist_toolchain_completes (job).
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of f346f577d4da 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.
Defect
Fixes #3353
crates/minimald/src/net/classifier.rsscripts/install-host-classifier.shcrates/minimald/src/box_runtime/launcher.rscrates/minvmd/tests/egress_allowlist_integration.rsdocs/specs/18-spec-box-networking/18-spec-box-networking.mdTask marker
Proof
Green KVM runs of the test: at
f5c3434c(job 133595848876, 78.0s) and at58b6f65b(job 133868140076,PASS [72.710s] minvmd::egress_allowlist_integration hostname_allowlist_toolchain_completes), the second with Docker Hub's S3 blob host on the list. A third atf346f577(job 133903558230,PASS [93.353s]), withskip_boot_logwaiting for a quiet boot log.That run includes the new assertion that no
minimal-classifier: refusedline onloappears while the toolchain runs. The agent's notes below were written before it.Not delivered on this box. A person can now see two things. First, a unit test pins that no rule of the guest table can refuse an own-IP hostname-allowlist box's loopback connect. Second, hostname_allowlist_toolchain_completes reads the guest boot log only from the first tool on, and fails if a minimal-classifier refused line on lo appears while the toolchain runs. Repeated passing VM runs are still owed by a VM lane.
Notes from the agent: Finding: the guest table does not refuse git's 127.0.0.1 connect. An own-IP box has its own network namespace (OwnIpNetwork relays its own tap) and gets no classifier leaf (launcher.rs places a leaf for HostNet only). A hostname allowlist is not deny-all, so verdict_of gives Allow. Every refusing rule of the guest render needs a socket of the boxes subtree. The refused line on lo for 127.0.0.1 comes from the guest's effect probe. At boot the probe connects from boxes/deny/filter-probe- to the daemon's own loopback listener, and deny_out logs that refusal by design. The e2e test read the boot log from offset 0, so git's tail (the first tool) carried the probe's boot-time line, and the line looked like git's. Changes: (1) classifier.rs adds hostname_allowlist_box_loopback_connect_is_admitted, which pins these facts against the installer's rendered guest table. (2) The e2e test calls skip_boot_log before the tools, collects 'minimal-classifier: refused' lines with OUT=lo, and asserts there are none. (3) NET-068 in spec 18 gets a second verify line and a comment that records the fact. No change to scripts/install-host-classifier.sh or box_runtime/launcher.rs: their layer notes were conditional ('if the guest ruleset is where the refusal comes from', 'if the exec lands in the deny subtree'), and neither condition holds. Widening deny_out to the loopback would also break NET-079 (host_ip_deny_all_reaches_only_the_answerer). Not verified: the VM run. The e2e edit was type-checked and linted with 'cargo clippy -p minvmd …[truncated]
Tests
cargo test -p minimald hostname_allowlist_box_loopback_connect_is_admittedcargo nextest run -p minvmd hostname_allowlist_toolchain_completesVerify
min task run agent-verifytimed out after 1800s, so this PR is a draft.