Skip to content

Normalize startup policy CIDRs - #187

Closed
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/normalize-initial-policy-targets
Closed

Normalize startup policy CIDRs#187
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/normalize-initial-policy-targets

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Proxy::new decides whether to enable bridge isolation from the startup --allow targets. Unlike policy updates received through the control socket, those targets were not normalized first.

ipnet preserves host bits when parsing a CIDR, so 192.0.2.1/0 and 0.0.0.0/0 are distinct values until truncated. The packet filter still treats both as the default route, but the exact isolation check only recognized 0.0.0.0/0. As a result, an equivalent /0 spelling allowed all destinations while unexpectedly leaving bridge isolation enabled.

Canonicalize startup targets before configuring the host and building the packet-filter rules. Prefix normalization now lives on Target and is shared with control policy updates, while the control path keeps its existing sorting and deduplication behavior.

Tests:

  • cargo test --no-run
  • cargo clippy --all-targets -- -D warnings
  • startup target normalization regression test
  • existing control target normalization test

@fallintoplace
fallintoplace force-pushed the fix/normalize-initial-policy-targets branch from 9b36a79 to 643f0cd Compare July 30, 2026 19:19
@fallintoplace
fallintoplace force-pushed the fix/normalize-initial-policy-targets branch from 643f0cd to fb55677 Compare July 30, 2026 19:19
@fallintoplace fallintoplace changed the title Normalize initial policy targets Normalize startup policy CIDRs Jul 30, 2026
@edi-oai

edi-oai commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Hello Minh 👋

Thanks for the contribution! We ended up landing a broader change in #188, which I believe already addresses this.

I'm going to close this PR as superseded.

@edi-oai edi-oai closed this Aug 3, 2026
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.

2 participants