[WSLC] Reject unenforceable network schema at parse time - #681
Open
SohamDas2021 wants to merge 1 commit into
Open
[WSLC] Reject unenforceable network schema at parse time#681SohamDas2021 wants to merge 1 commit into
SohamDas2021 wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
SohamDas2021
marked this pull request as ready for review
July 27, 2026 20:20
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
WSLC cannot enforce per-host egress filtering: the runner would apply in-container iptables, but the SDK's Privileged flag does not grant CAP_NET_ADMIN, so the run aborts at exec. Reject up front instead -- an allowlist with defaultPolicy='block', or a blocklist with defaultPolicy='allow'. Bare defaults with no host lists (full cutoff / full NAT) stay enforceable and are left as-is. Also reject network.allowLocalNetwork=true: a WSLC container runs in the NAT'd WSL2 VM and MXC never consults the flag (only explicit experimental.wslc portMappings wire inbound forwards), so honoring it would promise reachability the backend never delivers. Documents both rejections in the WSLC getting-started guide. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f3ae1af2-7b79-4340-a5ce-a5402e7ede3d
SohamDas2021
force-pushed
the
user/sodas/wslc-network-schema-reject
branch
from
July 28, 2026 20:42
fcba698 to
f191dca
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds early validation for WSLC network options that cannot be enforced.
Changes:
- Rejects effective host filtering and
allowLocalNetwork: true. - Adds parser tests for accepted and rejected combinations.
- Documents WSLC network limitations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/core/wxc_common/src/config_parser.rs |
Adds WSLC validation and tests. |
docs/wsl/wsl-container-getting-started.md |
Documents unsupported network policies. |
Comment on lines
+280
to
+284
| WSLC **cannot** enforce per-host egress filtering. `allowedHosts` with | ||
| `defaultPolicy: "block"` (an allowlist) or `blockedHosts` with | ||
| `defaultPolicy: "allow"` (a blocklist) would require in-container `iptables` | ||
| rules, but a WSLC container runs in its own network namespace **without** | ||
| `CAP_NET_ADMIN` (the SDK's `Privileged` flag does not grant it), so those rules |
Comment on lines
+976
to
+979
| let msg = "WSLc: network.allowLocalNetwork=true is not supported. A WSLc \ | ||
| container runs in the NAT'd WSL2 VM and MXC does not honor a \ | ||
| blanket inbound-listen grant; expose specific ports with \ | ||
| experimental.wslc portMappings instead."; |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📖 Description
The parser now rejects, at parse time, WSLc network configs that WSLc cannot honor (previously these were either silently ignored or failed late at
execwhen the runner lackedCAP_NET_ADMIN):🔗 References
🔍 Validation
✅ Checklist
Cargo.lock, thedependency-feed-checkcheck passes (see docs/pull-requests.md)📋 Issue Type
GitHub Actions runs the PR validation build automatically. The ADO pipeline
(
MXC-PR-Build) is the Azure version of the PR pipeline, kept in parity with the GitHubActions build; it runs on merge to
main, and Microsoft reviewers with write access can trigger iton a PR with
/azp run. See docs/pull-requests.md.If the
dependency-feed-checkcheck fails on a new dependency, the crate must be added tothe feed before the PR can pass. See docs/pull-requests.md
for the steps.
Microsoft Reviewers: Open in CodeFlow