docs(mxc): recommend pc_least_privilege with registryRead capability - #3649
Open
craig-armadin wants to merge 3 commits into
Open
craig-armadin wants to merge 3 commits into
craig-armadin wants to merge 3 commits into
Conversation
The MXC section sets pc_least_privilege = false, so a sandbox runs in an ordinary AppContainer. There the sandbox can reach host services that issue network requests on its behalf, and a workload sends outbound HTTP even when it declares no network_policies. The sandbox does not open a socket itself; the host service makes the request. pc_least_privilege = true alone is not usable. With an empty pc_capabilities the sandbox cannot initialize Winsock and most runtimes exit during startup. pc_capabilities = ["registryRead"] grants read access to the Winsock catalog keys so the process starts. socket() still fails with WSAEACCES, and the capability adds no registry reach beyond what pc_least_privilege = false already grants. - Set pc_least_privilege = true and pc_capabilities = ["registryRead"] in the MXC example configuration. - Document what pc_least_privilege controls, that it defaults to false, and that registryRead is required alongside it. - Direct workloads that need network access to egress_proxy rather than an internetClient capability, which network_policies cannot constrain. The driver example and README carry the same values and are updated separately. Measured on Windows 11 build 26200.9168 with MXC kit v0.8.0. Signed-off-by: craig-armadin <craig.wright@armadin.com>
The example leaves pc_least_privilege commented out, which resolves to false, so a sandbox runs in an ordinary AppContainer. There the sandbox can reach host services that issue network requests on its behalf, and a workload sends outbound HTTP even when it declares no network_policies. pc_least_privilege = true alone is not usable. With an empty pc_capabilities the sandbox cannot initialize Winsock and most runtimes exit during startup. pc_capabilities = ["registryRead"] grants read access to the Winsock catalog keys so the process starts, and adds no registry reach beyond what pc_least_privilege = false already grants. - Set pc_least_privilege = true and pc_capabilities = ["registryRead"], and uncomment both so the effective values are visible in the example. - Note that pc_least_privilege defaults to false when omitted, that registryRead is required alongside it, and that egress_proxy rather than an internetClient capability grants network access. Measured on Windows 11 build 26200.9168 with MXC kit v0.8.0. Signed-off-by: craig-armadin <craig.wright@armadin.com>
The README configuration block sets pc_least_privilege = false, so a sandbox runs in an ordinary AppContainer. There the sandbox can reach host services that issue network requests on its behalf, and a workload sends outbound HTTP even when it declares no network_policies. pc_least_privilege = true alone is not usable. With an empty pc_capabilities the sandbox cannot initialize Winsock and most runtimes exit during startup. pc_capabilities = ["registryRead"] grants read access to the Winsock catalog keys so the process starts, and adds no registry reach beyond what pc_least_privilege = false already grants. - Set pc_least_privilege = true and pc_capabilities = ["registryRead"], matching the gateway config reference and the driver example. - Note that pc_least_privilege defaults to false and that registryRead is required alongside it. Measured on Windows 11 build 26200.9168 with MXC kit v0.8.0. Signed-off-by: craig-armadin <craig.wright@armadin.com>
craig-armadin
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
September 23, 2026 23:47
|
Thank you for your interest in contributing to OpenShell, @craig-armadin. This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer. To get vouched:
See CONTRIBUTING.md for details. |
|
All contributors have signed the DCO ✍️ ✅ |
Author
|
I have read the DCO document and I hereby sign the DCO. |
This branch has not been deployed
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.
Summary
All three published MXC driver configurations show
pc_least_privilegedisabled,and none document what the setting does or that it defaults to
falsewhenomitted. This updates the three examples to the secure combination and adds the
short explanation needed to choose between them.
Related Issue
No issue required: documentation fix to published example configuration.
Changes
docs/reference/gateway-config.mdx- MXC example now setspc_least_privilege = trueandpc_capabilities = ["registryRead"]; adds twoparagraphs covering the
falsedefault, whyregistryReadis requiredalongside LPAC, and why
egress_proxyrather thaninternetClientis the wayto grant network access.
crates/openshell-driver-mxc/examples/mxc-gateway.toml- both keys uncommentedand set, with comments noting the default and the capability requirement.
crates/openshell-driver-mxc/README.md- configuration block matches, with thesame note.
No code changes; defaults in
MxcComputeConfigare untouched.Testing
Verified on Windows 11 build 26200.9168 with MXC kit v0.8.0, against each of the
three published configurations.
Without
pc_least_privilege, a sandboxed process that holds no networkcapability and whose policy grants no network access can still cause an outbound
HTTPS request to an arbitrary external URL. It calls
WinHttpGetProxyForUrlwithWINHTTP_AUTOPROXY_CONFIG_URLand an attacker-chosenlpszAutoConfigUrl; thefetch is performed by
WinHttpAutoProxySvcoutside the container. The requestarrives at the destination with
User-Agent: WinHttp-Autoproxy-Service/5.1,confirmed with per-run cache-busting URLs so the hits could not be attributed to
caching or to the host. Direct sockets remain denied throughout —
socket()returnsWSAEACCES.With
pc_least_privilege = true, the same call fails and no request reaches thedestination.
pc_least_privilege = truewith the default emptypc_capabilitiespreventsWinsock initialization, and workloads that link a network-capable runtime
terminate during startup rather than running without network access. Adding
registryReadrestores startup;socket()still returnsWSAEACCES.Adding
registryReaddoes not widen registry access. LPAC dropsALL APPLICATION PACKAGES, which is the SID a non-LPAC sandbox reads theregistry through;
registryReadrestores access to a subset of the same keys.The Winsock catalog keys under
HKLM\SYSTEM\CurrentControlSet\Services\WinSock2\ParameterscarryReadKeyACEs for both SIDs — which is why LPAC alone breaks
WSAStartup, and why thiscapability repairs it. Across 17,143 keys sampled, no key grants
registryReadwithout also granting
ALL APPLICATION PACKAGES, so the recommendedconfiguration reaches a strict subset of the published one: 16,154 keys
against 16,298.
mise run pre-commitpasses — ran the subtasks that apply to a docs-onlychange:
license:check(1142 files, all SPDX headers present) andmarkdown:lint(145 files, 0 errors).markdown:formatproduces nochanges. The remaining
pre-commitsubtask isrust:lint, which this diffcannot affect.
Checklist