mirror of
https://github.com/openai/codex.git
synced 2026-10-22 17:58:46 +00:00
## Why The Linux sandbox uses bubblewrap for filesystem isolation and seccomp for syscall filtering, but its command type, syscall-filter module, and integration test suite still used Landlock names. ## What changed - Rename `LandlockCommand` to `LinuxSandboxCommand`, `src/landlock.rs` to `src/seccomp.rs`, and `tests/suite/landlock.rs` to `tests/suite/sandbox.rs`, updating imports and existing tests. - Clarify the retained legacy Landlock implementation and its filesystem-policy limitations. - Update the README to describe existing network filtering, `AF_VSOCK` and `io_uring` restrictions, and managed-proxy Unix socket behavior, including allowed Unix socket pairs. Sandbox enforcement behavior is unchanged. GitOrigin-RevId: be4769d5a10b90605990eb58451e83fdf1c31222
51 lines
1.3 KiB
Rust
51 lines
1.3 KiB
Rust
//! Linux sandbox helper entry point.
|
|
//!
|
|
//! On Linux, `codex-linux-sandbox` applies:
|
|
//! - in-process restrictions (`no_new_privs` + seccomp), and
|
|
//! - bubblewrap for filesystem isolation.
|
|
#[cfg(target_os = "linux")]
|
|
mod bazel_bwrap;
|
|
#[cfg(target_os = "linux")]
|
|
mod bundled_bwrap;
|
|
#[cfg(target_os = "linux")]
|
|
mod bwrap;
|
|
#[cfg(target_os = "linux")]
|
|
mod daemon_mounts;
|
|
#[cfg(target_os = "linux")]
|
|
mod exec_util;
|
|
#[cfg(target_os = "linux")]
|
|
mod fd_mount;
|
|
#[cfg(target_os = "linux")]
|
|
mod launcher;
|
|
#[cfg(target_os = "linux")]
|
|
mod linux_run_main;
|
|
#[cfg(target_os = "linux")]
|
|
mod proxy_lifecycle;
|
|
#[cfg(target_os = "linux")]
|
|
mod proxy_routing;
|
|
#[cfg(target_os = "linux")]
|
|
mod seccomp;
|
|
#[cfg(target_os = "linux")]
|
|
mod wslg;
|
|
|
|
#[cfg(target_os = "linux")]
|
|
pub use bundled_bwrap::find_bundled_bwrap_for_exe;
|
|
#[cfg(target_os = "linux")]
|
|
pub use bwrap::GLOB_SCAN_PROGRAM;
|
|
#[cfg(target_os = "linux")]
|
|
pub use bwrap::expand_unreadable_globs_in_environment;
|
|
|
|
/// Exit status returned when bundled bubblewrap fails digest verification.
|
|
#[cfg(target_os = "linux")]
|
|
pub const BUNDLED_BWRAP_DIGEST_VERIFICATION_FAILURE_EXIT_CODE: i32 = 8;
|
|
|
|
#[cfg(target_os = "linux")]
|
|
pub fn run_main() -> ! {
|
|
linux_run_main::run_main();
|
|
}
|
|
|
|
#[cfg(not(target_os = "linux"))]
|
|
pub fn run_main() -> ! {
|
|
panic!("codex-linux-sandbox is only supported on Linux");
|
|
}
|