-
Notifications
You must be signed in to change notification settings - Fork 62
[LXC] Address network policy gaps - model 2 (deny-all-except-proxy) #632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Darren Hoehna (dhoehna)
wants to merge
33
commits into
microsoft:main
from
dhoehna:user/dahoehna/lxc-net-model2-deny-all-except-proxy
Closed
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
5f5ae13
[LXC] Network model 2: deny-all-except-proxy (AB#62830341)
dhoehna 64c072e
[LXC] Address PR #632 review: reject localhost proxy, gate DNS in pro…
dhoehna 6425119
Add LXC network proxy sample config (tests/configs/lxc_network_proxy.…
dhoehna 775dc87
Merge microsoft/mxc main (47a172c) into lxc-net-model2-deny-all-excep…
dhoehna 9648284
Merge remote-tracking branch 'upstream/main' into user/dahoehna/lxc-n…
dhoehna 3fd32ed
[LXC] Address PR #632 review: rollback, IPv6 parity, pinned proxy, DN…
dhoehna f22f839
Merge upstream/main into lxc-net-model2-deny-all-except-proxy
dhoehna 80fb608
Merge remote-tracking branch 'upstream/main' into user/dahoehna/lxc-n…
dhoehna 4c71e2e
Address review: close conntrack, INPUT, IPv6 and rollback gaps in LXC…
dhoehna 7389263
Merge remote-tracking branch 'upstream/main' into user/dahoehna/lxc-n…
dhoehna 81362b6
[LXC] Fix Bubblewrap regression from veth-scoped firewall enforcement
dhoehna 8df9dff
[LXC] Set DHCP ownership flags only after the insert succeeds
dhoehna 84ac24c
[LXC] Stop rewrite_url_host from eating a query or fragment character
dhoehna 29cf20e
[LXC] Reject loopback proxy URLs under the deny-all model
dhoehna ed6ee5b
[LXC] Explicitly reject IPv6 proxy endpoints
dhoehna a273708
[LXC] Add executable deny-all-except-proxy integration test
dhoehna 7c4e03b
[LXC] Restore fail-closed veth invariant coverage in lxc_runner
dhoehna c5484b1
[bwrap] Add + register no-veth firewall regression guard
dhoehna f276fb2
Add spec-derived black-box tests for host_is_loopback and rewrite_url…
dhoehna 815758a
Un-ignore documenting tests; add characterization tests for contract …
dhoehna fff3c93
Fix IPv6 host bracketing in rewrite_url_host and pinned_to_ip fallback
dhoehna c917434
fix(proxy_env): always return true from disabled branch
dhoehna a7a6194
fix(tests): avoid expect_fun_call in IPv6 proxy URL tests
dhoehna 6e7591c
fix(tests): stop counting a skipped bwrap firewall run as a pass
dhoehna 1ed2ae6
Skip with exit 77 in the LXC proxy test so a skip is not tallied as a…
dhoehna 63578db
Address review feedback on deny-all-except-proxy
d563cbb
Make the start-ownership bit impossible to forget rather than merely …
dhoehna c3af5f3
Close two fail-open paths the review found
dhoehna 6756a3b
Republish firewall ownership after teardown instead of leaving it stale
dhoehna 6c52d93
Fail closed on an unresolvable blocked host under either default policy
dhoehna 17ea610
[LXC] Tear down only the firewall objects the record names
dhoehna 96042f4
[LXC] Attempt every hook delete, so a failed one cannot hide the next
dhoehna 10f0599
[LXC] Make hook teardown converge, and stop flushing a referenced chain
dhoehna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Does setting the iptables require root access? I'm thinking about the GitHub copilot usecase. I don't think they'd want to be root when trying this but I could be wrong. Carlos Alexandro Becker (@caarlos0), in GitHub copilot, for linux do you know if the cli will need root access to perform these iptable actions? Not sure what it's doing on Linux today when these are passed in. Figured I would circle back to this now that self hosting is underway.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lxc needs root access by default, to create containers for example.
That is the reason ghcp switched to bubblewrap. Bubblewrap creates the container unprivilege, root is only required for the optional iptables enforcement path, not by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Root specifically is not the exact requirement. The LXC manager invokes host
iptablesandip6tablesdirectly, withoutsudoor an elevation helper, so the MXC process needsCAP_NET_ADMINin that network namespace; running as root is one way to provide it. LXC creation and start are also invoked directly, and this repo documents root or a configured unprivileged LXC setup. Bubblewrap's configured cooperative-proxy path skips iptables and is intended to remain unprivileged, but this repo does not establish which path GitHub Copilot CLI deploys.