mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Enforce configured network proxy in codex sandbox (#27035)
## Why `codex sandbox` can start a network proxy from a configured permission profile. Previously, sandbox-level containment was tied to managed network requirements rather than whether a proxy was actually active. This meant config-driven proxy policies were not consistently enforced as the sandbox's only network path. ## What changed - Enable proxy-only network containment whenever `codex sandbox` starts a network proxy. - Apply the same active-proxy check to the macOS and Linux sandbox paths. - Add a Linux regression test that verifies a sandboxed command cannot establish a direct connection while the configured proxy is active. ## Test plan - `just test -p codex-cli debug_sandbox::tests` - `sandbox_with_network_proxy_blocks_direct_loopback_access` runs on Linux to cover the config-driven proxy path end to end.
This commit is contained in:
1 parent
e0ee491df3
commit
85fd52f7e4
7 files changed
+98
-8
No files matched your search
@@ -338,8 +338,8 @@ fn ensure_linux_bubblewrap_is_supported(
|
||||
allow_network_for_proxy: bool,
|
||||
is_wsl1: bool,
|
||||
) -> Result<(), SandboxTransformError> {
|
||||
let requires_bubblewrap = !use_legacy_landlock
|
||||
&& (!file_system_sandbox_policy.has_full_disk_write_access() || allow_network_for_proxy);
|
||||
let requires_bubblewrap = allow_network_for_proxy
|
||||
|| (!use_legacy_landlock && !file_system_sandbox_policy.has_full_disk_write_access());
|
||||
if is_wsl1 && requires_bubblewrap {
|
||||
return Err(SandboxTransformError::Wsl1UnsupportedForBubblewrap);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user