8000 fix(minvmd): honor the egress deny-all opt-out for undeclared host rows by gominimal-aw-bot[bot] · Pull Request #2043 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minvmd): honor the egress deny-all opt-out for undeclared host rows - #2043

Merged
norrietaylor merged 4 commits into
mainfrom
inbox-patch/egress-opt-out-host-gate-50a7af3c50ad19da
Oct 7, 2026
Merged

norrietaylor merged 4 commits into
mainfrom
inbox-patch/egress-opt-out-host-gate-50a7af3c50ad19da

Conversation

@gominimal-aw-bot
@gominimal-aw-bot gominimal-aw-bot Bot commented Oct 7, 2026 •
Copy link
Copy Markdown
Contributor

The host-side egress gate compiled a client box with no egress section to allow-all unconditionally, ignoring both the rollout phase and the operator's MINVMD_EGRESS_DENY_ALL_OPT_OUT opt-out. The guest daemon resolves the same absent section through sessions::effective_egress, so an opted-out VM host denied at the host what the guest allowed.

This threads the opt-out into BoxRegistry and resolves an absent section via sessions::effective_egress in register_client_box_as, so the host gate and the guest gate agree. It also shares the duplicated true/false parse in sessions::egress_deny_all_opt_out_from_raw, and names the VM host's variable in the activate notice on VM-backed hosts.

Part of the egress default rollout: both phase constants flip together. UNREGISTERED_SOURCE_PHASE (minvmd) and sessions::EGRESS_DEFAULT_PHASE are pinned to each other by a const assertion in egress_gate.rs.

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABVex3Yg

Summary by CodeRabbit

  • New Features
    • During the announced phase, VM-backed hosts now receive instructions to opt out of the deny-all egress default using MINVMD_EGRESS_DENY_ALL_OPT_OUT=1; native daemons continue to receive the --egress-deny-all-opt-out option.
    • For client boxes without a declared egress policy, the default now follows the configured phase and opt-out setting. Explicitly declared policies remain unchanged.
  • Bug Fixes
    • The deny-all announcement is no longer shown once the default is in force.

The host-side egress gate compiled a client box with no `egress`
section to allow-all unconditionally, ignoring both the rollout phase
and the operator's `MINVMD_EGRESS_DENY_ALL_OPT_OUT` opt-out. The guest
daemon resolves the same absent section through
`sessions::effective_egress`, so an opted-out VM host denied at the
host what the guest allowed.

Thread the opt-out into `BoxRegistry` and resolve an absent section via
`sessions::effective_egress` in `register_client_box_as`, so the host
gate and the guest gate agree. Share the duplicated true/false parse in
`sessions::egress_deny_all_opt_out_from_raw`, and name the VM host's
variable in the activate notice on VM-backed hosts.

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABVex3Yg

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner October 7, 2026 00:49
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Oct 7, 2026
@coderabbitai
coderabbitai Bot commented Oct 7, 2026 •
Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: e5ba92fa-a248-4c6b-9341-a938e9345b81
📥 Commits

Reviewing files that changed from the base of the PR and between c1072c9 and f242c2b.

📒 Files selected for processing (10)
  • crates/minimal/src/cmd/session.rs
  • crates/minimal/tests/cli.rs
  • crates/minimal/tests/named_vm.rs
  • crates/minimald/src/guest.rs
  • crates/minvmd/src/box_registry.rs
  • crates/minvmd/src/cmd/run.rs
  • crates/minvmd/src/net/egress_gate.rs
  • crates/minvmd/src/vm.rs
  • crates/sessions/src/lib.rs
  • scripts/session-e2e.sh

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change shares egress opt-out parsing, applies phase-dependent defaults to VM client boxes, and configures the VM supervisor from the opt-out environment variable. VM-backed session notices and tests now use the VM-specific restart instruction.

Changes

VM egress defaults

Layer / File(s) Summary
Shared opt-out parsing and phase contract
crates/sessions/src/lib.rs, crates/minimald/src/guest.rs, crates/minvmd/src/vm.rs, crates/minvmd/src/net/egress_gate.rs
A shared parser accepts trimmed, case-insensitive 1, true, yes, and on values. The guest and VM supervisor use it. A compile-time assertion checks that the host and guest egress-default phases match.
VM client-box egress defaults
crates/minvmd/src/box_registry.rs, crates/minvmd/src/cmd/run.rs
BoxRegistry stores the egress-default phase and opt-out setting. Client-box registration uses them to resolve undeclared egress. The VM supervisor reads the environment setting and configures the registry. Tests cover phase behavior, opt-out, and declared policies.
VM opt-out notice and environment forwarding
crates/minimal/src/cmd/session.rs, crates/minimal/tests/cli.rs, crates/minimal/tests/named_vm.rs, scripts/session-e2e.sh
VM-backed hosts receive the environment-variable restart instruction; native hosts receive the daemon-flag instruction. Tests check the notice, inherited environment value, and daemon-specific announcement.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant run_foreground
  participant egress_deny_all_opt_out_from_env
  participant sessions_egress_deny_all_opt_out_from_raw
  participant BoxRegistry
  participant register_client_box_as
  run_foreground->>egress_deny_all_opt_out_from_env: read opt-out environment value
  egress_deny_all_opt_out_from_env->>sessions_egress_deny_all_opt_out_from_raw: parse raw value
  run_foreground->>BoxRegistry: configure opt-out
  BoxRegistry->>register_client_box_as: resolve undeclared egress by phase and opt-out
Loading

Suggested reviewers: norrietaylor

Merge Risk: ⚪ Minimal · up to f242c

The VM egress default, opt-out handling, and notice changes have no identified issue that should block merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: honoring the egress deny-all opt-out for undeclared host rows.
Description check ✅ Passed The description gives a clear summary of the problem and the changes. It does not include the template's Testing or Checklist sections, so test evidence and checklist status are missing, but the descr…
Docstring Coverage ✅ Passed Docstring coverage is 92.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 8 files. (2 skipped: 2 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the egress gate,
And reads the opt-out setting straight.
The VM gets words that name the way,
To restart and choose allow today.
The boxes follow phase and tune,
While burrow songs hum to the moon.

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

@norrietaylor norrietaylor changed the title fix: fix(minvmd): honor egress deny-all opt-out for undeclared host rows fix(minvmd): honor the egress deny-all opt-out for undeclared host rows Oct 7, 2026
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch label Oct 7, 2026
…ll notice

VM-backed lanes now assert the announcement names
MINVMD_EGRESS_DENY_ALL_OPT_OUT=1 and not the native flag.

The box_registry test also pins a declared egress section in both
directions and covers the (Announced, opt-out) arm. The phase field
doc notes that host/guest agreement needs the two phase constants
to match.
@norrietaylor
Copy link
Copy Markdown
Member

/review

@norrietaylor
Copy link < 8000 /clipboard-copy>
Copy Markdown
Member

@coderabbitai review

@minimal-foundry
minimal-foundry Bot commented Oct 7, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at 4885184e3026.

Nothing to do.

Clobber: none: git log --oneline -8 -- crates/minvmd/src/box_registry.rs shows only this PR's own commits (f0471154, 6051f5a4) touching the file; no dependency files moved.

@coderabbitai
coderabbitai Bot commented Oct 7, 2026 •
Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

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 — No findings.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 7, 2026
The host gate's UNREGISTERED_SOURCE_PHASE and the guest daemon's
sessions::EGRESS_DEFAULT_PHASE are one rollout. A const assertion now
fails the build if only one of them flips.
@norrietaylor
Copy link
Copy Markdown
Member

/review

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

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 — No findings.

@norrietaylor
Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai
coderabbitai Bot commented Oct 7, 2026 •
Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@norrietaylor
Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai
coderabbitai Bot commented Oct 7, 2026 •
Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit ea2a379 Oct 7, 2026
36 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/egress-opt-out-host-gate-50a7af3c50ad19da branch October 7, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0