Allow network policy to enable transparent TCP capture (#61851)

## What changed

- Add `transparent_tcp` to network configuration and managed requirements, defaulting to off. When enabled, route outbound TCP from managed Linux sandbox commands through the managed SOCKS5 proxy without requiring an executor startup flag.
- Propagate the setting through local and remote execution, require an enabled SOCKS5 proxy, and check the executor's `networkProxyTransparentTcp` capability before remote launches.
- Refresh the live proxy when switching between permission profiles with different network settings.

## Testing

Add coverage for configuration-driven sandbox capture, rejection of unsupported launch contexts, execution parameter propagation, and live permission profile changes.

GitOrigin-RevId: c4db87056de116f433a128806bef673802f35397
This commit is contained in:
viyatb-oai
2026-11-16 18:19:16 +00:00
committed by copyberry
parent fef47a6769
commit effad7568c
29 changed files with 312 additions and 39 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ The Rust sandbox helper includes the TCP stack. Codex starts it automatically.
The Linux host needs distro `bwrap` on `PATH`, user and network namespaces, IPv6,
and read/write access to `/dev/net/tun`.
Use full managed SOCKS5 mode for native database ports and an isolated PID namespace.
For executor-wide capture and HTTP CONNECT routing, see the [exec-server setup](../exec-server/README.md#transparent-tcp).
For proxy configuration, executor-wide capture and HTTP CONNECT routing, see the [exec-server setup](../exec-server/README.md#transparent-tcp).
The private DNS stub maps up to 8,192 names to stable addresses in `198.18.0.0/15`
and `fdc0:de00::/96`. The relay sends the original name and port to the attributed proxy;
@@ -506,6 +506,7 @@ fn managed_proxy_inner_command_includes_route_spec() {
for managed_network in [
ManagedNetworkSandboxContext::default(),
ManagedNetworkSandboxContext {
transparent_tcp: false,
loopback_ports: vec![8080, 9090],
allow_local_binding: true,
allow_unix_sockets: vec!["/tmp/daemon.sock".to_string()],