Select the elevated Windows sandbox for network proxies (#33445)

## Why

Windows firewall enforcement is tied to the logon-user sandbox identities. Proxy-enforced commands therefore need the elevated backend even when the configured sandbox mode is the default restricted-token mode.

## What changed

- Select the elevated Windows sandbox backend whenever a command uses the managed network proxy.
- Remove configuration and startup checks that required users or managed requirements to select the elevated sandbox explicitly.
- Start and expose managed network proxy state consistently on Windows.

## Testing

- Verify that proxy enforcement selects the elevated backend for the restricted-token sandbox mode.

GitOrigin-RevId: e01ac052587721c468a8fbcf4e2c7c5a185a3e05
This commit is contained in:
iceweasel-oai
2026-07-15 23:19:00 +00:00
committed by copyberry
parent 7d1218a997
commit 4bc2c723ef
23 changed files with 58 additions and 496 deletions
+1 -6
View File
@@ -987,12 +987,7 @@ impl Session {
)
});
let (network_proxy, session_network_proxy) =
if let Some(spec) = config
.permissions
.network
.as_ref()
.filter(|spec| !cfg!(target_os = "windows") || spec.enabled())
{
if let Some(spec) = config.permissions.network.as_ref() {
let current_exec_policy = exec_policy.current();
let (network_proxy, session_network_proxy) = Self::start_managed_network_proxy(
spec,