feat(windows): add MXC sandbox policy parity - #16
Merged
Conversation
qedawkins
force-pushed
the
users/qedawkins/windows-mxc-processcontainer
branch
from
July 18, 2026 01:54
d39ef81 to
da628c7
Compare
## Motivation Windows support previously exposed nominal policy features without a tested process-isolation boundary comparable to Linux. Use Microsoft MXC BaseContainer for Windows process containment so AXIS can remain the consistent, platform-neutral policy layer instead of reimplementing the operating-system sandbox. This change targets Linux policy parity for Windows. GPU/AMD policy remains out of scope because that surface is not yet implemented on Linux either. ## Technical Details - Select MXC for the Windows `auto` and `mxc` process backends, and reject the legacy `axis_native` host-spawn path so sandbox requests fail closed. - Require BaseContainer with least-privilege mode and `fallback.allowDaclMutation=false`. AXIS uses MXC's upstream dispatcher without forcing an older AppContainer tier; an unavailable BaseContainer is a launch failure. - Translate filesystem, process, timeout, isolated-identity, child-process, resource, network, inference, and scoped-SSH policy into validated Windows containment. - Add Job Object lifetime and resource enforcement, WFP strict-proxy brokering, managed home/state projection, host-side inference credential handling, token-budget enforcement, and scoped SSH proxying. - Reject unsupported interactive ConPTY policy before launch because the BaseContainer API on Windows build 26300.8772 rejects pseudoconsole startup handles with `ERROR_INVALID_HANDLE`; AXIS does not downgrade isolation to obtain terminal support. - Pin MXC and carry three reviewed patches for ProcessContainer resource fields, atomic child Job assignment, and strict WFP proxy integration. Package the required Windows executables and setup helpers in CI and release artifacts. - Keep vendored patch payloads LF-normalized so Windows checkouts can apply them with whitespace errors treated as fatal. - Document Windows setup, runtime dependencies, capability coverage, isolation guarantees, and fail-closed limitations. ## Test Plan - The Windows MXC adapter and policy unit tests verify BaseContainer-only configuration, disabled DACL fallback, least-privilege mode, use of MXC's upstream dispatcher, missing-executor failure without host fallback, secret-free executor state, command quoting, wire serialization, lifecycle cleanup, and rejection of unsupported policy combinations. Filesystem cases cover case-insensitive overlap, junction aliases, alternate data streams, and device namespace paths. - `test_mxc_processcontainer.ps1` exercises the policy boundary through a real BaseContainer. It checks command execution, secret environment filtering, managed-profile projection, read-only/read-write/default-deny filesystem behavior, paired network block/allow behavior, arbitrary granted executables, process-count and child-denial limits, aggregate memory, CPU rate limiting, timeout descendant cleanup, and absence of host ACL mutation. - `test_mxc_strict_proxy.ps1` exercises the elevated WFP broker as an adversarial network boundary. It permits only the configured HTTPS proxy path, rejects a disallowed proxy destination, blocks direct TCP, DNS, QUIC/UDP, and IPv6 bypasses, correlates audit events, isolates concurrent leases, and verifies fail-closed process termination and stale-lease recovery across broker loss. - `test_mxc_inference.ps1` sends a real BaseContainer client through the strict proxy to a mock provider. It verifies streaming, host-side credential injection, absence of provider secrets in the guest and its output, and rejection of over-budget requests before they reach the provider. - `test_mxc_scoped_ssh.ps1` verifies managed-home projection of generated SSH key, config, known-host, and helper files; denial of the original host key; byte relay to an allowed destination; and rejection of an unlisted destination. - Unit and integration coverage for the WFP protocol, proxy credentials and token budgets, managed-home preparation, and SSH projection exercises invalid inputs and cleanup paths that are unsafe or impractical to induce in E2E. Workflow structure tests ensure Windows CI builds the pinned patched executor, invokes the feature-gated BaseContainer suite, and publishes every required helper. Unsupported hosted images accept only MXC's exact fail-closed result; suitable hosts run the full live suite. ## Submission Checklist - [x] Reviewed the ROCm contribution guidelines. - [x] Confirmed the code builds successfully. - [x] Confirmed existing tests pass and added coverage for the new functionality. - [x] Added or updated documentation for the new Windows policy behavior. - [x] Kept unsupported policy surfaces fail-closed and documented limitations. Signed-off-by: Quinn Dawkins <quinn.dawkins@gmail.com>
qedawkins
force-pushed
the
users/qedawkins/windows-mxc-processcontainer
branch
from
July 18, 2026 02:07
da628c7 to
8a62354
Compare
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.
Motivation
Windows support previously exposed nominal policy features without a tested process-isolation boundary comparable to Linux. Use Microsoft MXC for Windows process containment so AXIS can remain the consistent, platform-neutral policy layer instead of reimplementing the operating-system sandbox.
This change targets Linux policy parity for Windows. GPU/AMD policy remains out of scope because that surface is not yet implemented on Linux either.
Technical Details
autoandmxcprocess backends, and reject the legacyaxis_nativehost-spawn path so sandbox requests fail closed.AXIS_MXC_ALLOW_DACL_MUTATION=1consent.ERROR_INVALID_HANDLE.Test Plan
test_mxc_processcontainer.ps1exercises the common policy boundary through both MXC isolation tiers. It checks missing-executor failure without host fallback, command execution, secret environment filtering, managed-profile projection, read-only/read-write/default-deny filesystem behavior, and paired network block/allow behavior. Its BaseContainer cases additionally verify arbitrary granted executables, process-count and child-denial limits, aggregate memory, CPU rate limiting, timeout descendant cleanup, and absence of host ACL mutation.test_mxc_strict_proxy.ps1exercises the elevated WFP broker as an adversarial network boundary. It permits only the configured HTTPS proxy path, rejects a disallowed proxy destination, blocks direct TCP, DNS, QUIC/UDP, and IPv6 bypasses, correlates audit events, isolates concurrent leases, and verifies fail-closed process termination and stale-lease recovery across broker loss.test_mxc_conpty.ps1verifies interactive terminal behavior on the supported AppContainer/DACL tier, including console detection, size, ANSI output, prompt/input/echo, exit propagation, and ACL restoration. It also verifies that BaseContainer rejects ConPTY before launching MXC on affected Windows builds.test_mxc_inference.ps1sends a real BaseContainer client through the strict proxy to a mock provider. It verifies streaming, host-side credential injection, absence of provider secrets in the guest and its output, and rejection of over-budget requests before they reach the provider.test_mxc_scoped_ssh.ps1verifies managed-home projection of generated SSH key, config, known-host, and helper files; denial of the original host key; byte relay to an allowed destination; and rejection of an unlisted destination.Submission Checklist