Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c37dcb4
Protect managed MITM CA private key
winston-openai Jun 19, 2026
c5014b5
Deny persisted MITM keys across reloads
winston-openai Jun 19, 2026
eed3df1
Merge remote-tracking branch 'origin/main' into dev/winston/mitm-ca-k…
winston-openai Jun 19, 2026
1d8b3c0
Protect persisted MITM keys without an active proxy
winston-openai Jun 19, 2026
961a820
Fix argument comment lint
winston-openai Jun 19, 2026
351971a
Route direct filesystem enforcement through bubblewrap
winston-openai Jun 19, 2026
845fa93
Merge main into MITM CA key isolation
winston-openai Jun 19, 2026
56f35ba
chore: merge main into MITM CA key isolation
viyatb-oai Jun 23, 2026
937d3c0
Merge branch 'main' into dev/winston/mitm-ca-key-isolation
winston-openai Jun 23, 2026
f7b353e
Keep managed MITM CA keys in process memory
winston-openai Jun 23, 2026
a3cb204
fix: store managed MITM CA key in keyring
viyatb-oai Jun 23, 2026
747e90d
Update managed MITM CA documentation
winston-openai Jun 23, 2026
28558b5
Merge remote-tracking branch 'origin/main' into dev/winston/mitm-ca-k…
winston-openai Jun 23, 2026
a9368d4
fix: integrate latest MITM CA changes
viyatb-oai Jun 23, 2026
4511999
docs: align managed MITM CA storage guidance
viyatb-oai Jun 23, 2026
0756bdf
refactor: rename MITM CA storage type
viyatb-oai Jun 23, 2026
41251e4
Keep managed MITM CA signer in proxy memory
winston-openai Jun 23, 2026
da61e5e
Merge remote-tracking branch 'origin/main' into dev/winston/mitm-ca-k…
winston-openai Jun 23, 2026
8ffe3ad
test: initialize Rustls provider in CA test
viyatb-oai Jun 23, 2026
186d020
fix: bound managed MITM CA artifacts
viyatb-oai Jun 23, 2026
39df9f4
fix: prune inactive MITM CA artifacts
viyatb-oai Jun 23, 2026
f2f8669
Merge remote-tracking branch 'origin/main' into dev/winston/mitm-ca-k…
winston-openai Jun 23, 2026
0a9dfde
Merge remote-tracking branch 'origin/main' into dev/winston/mitm-ca-k…
winston-openai Jun 23, 2026
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Protect persisted MITM keys without an active proxy
  • Loading branch information
winston-openai committed Jun 19, 2026
commit 1d8b3c0438ec37c1830c4daeca0b7441edb67e26
13 changes: 4 additions & 9 deletions codex-rs/cli/src/debug_sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,10 @@ async fn run_command_under_sandbox(
// Proxy containment depends on whether a proxy is active, not whether its
// policy came from managed requirements.
let enforce_managed_network = network.is_some();
let runtime_permission_profile = network.as_ref().map_or_else(
|| config.permissions.effective_permission_profile(),
|network| {
with_managed_mitm_ca_access(
config.permissions.effective_permission_profile(),
network,
sandbox_policy_cwd.as_path(),
)
},
let runtime_permission_profile = with_managed_mitm_ca_access(
config.permissions.effective_permission_profile(),
network.as_ref(),
sandbox_policy_cwd.as_path(),
);

let mut child = match sandbox_type {
Expand Down
2 changes: 1 addition & 1 deletion codex-rs/network-proxy/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ impl NetworkProxy {
}

/// Returns the managed MITM CA private key path child sandboxes must hide.
pub fn managed_mitm_ca_private_key_path(&self) -> Option<AbsolutePathBuf> {
pub fn managed_mitm_ca_private_key_path() -> Option<AbsolutePathBuf> {
crate::certs::managed_ca_private_key_path()
.and_then(|path| {
AbsolutePathBuf::from_absolute_path(path)
Expand Down
26 changes: 15 additions & 11 deletions codex-rs/sandboxing/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ pub fn get_platform_sandbox(windows_sandbox_enabled: bool) -> Option<SandboxType

pub fn with_managed_mitm_ca_access(
permission_profile: PermissionProfile,
network: &NetworkProxy,
network: Option<&NetworkProxy>,
sandbox_policy_cwd: &Path,
) -> PermissionProfile {
let Some(managed_mitm_ca_private_key_path) = network.managed_mitm_ca_private_key_path() else {
let Some(managed_mitm_ca_private_key_path) = NetworkProxy::managed_mitm_ca_private_key_path()
else {
return permission_profile;
};
let managed_mitm_ca_trust_bundle_path = network.managed_mitm_ca_trust_bundle_path();
let managed_mitm_ca_trust_bundle_path =
network.and_then(NetworkProxy::managed_mitm_ca_trust_bundle_path);
with_managed_mitm_ca_paths(
permission_profile,
managed_mitm_ca_trust_bundle_path.as_ref(),
Expand All @@ -100,6 +102,11 @@ fn with_managed_mitm_ca_paths(
managed_mitm_ca_private_key_path: &AbsolutePathBuf,
sandbox_policy_cwd: &Path,
) -> PermissionProfile {
if managed_mitm_ca_trust_bundle_path.is_none()
&& !managed_mitm_ca_private_key_path.as_path().exists()
{
return permission_profile;
}
let (file_system_sandbox_policy, network_sandbox_policy) =
permission_profile.to_runtime_permissions();
let mut file_system_sandbox_policy = match file_system_sandbox_policy.kind {
Expand Down Expand Up @@ -227,14 +234,11 @@ impl PendingSandboxedExecRequest {
source,
}
})?;
let effective_permission_profile =
network.map_or(effective_permission_profile.clone(), |network| {
with_managed_mitm_ca_access(
effective_permission_profile,
network,
native_sandbox_policy_cwd.as_path(),
)
});
let effective_permission_profile = with_managed_mitm_ca_access(
effective_permission_profile,
network,
native_sandbox_policy_cwd.as_path(),
);
let (effective_file_system_policy, effective_network_policy) =
effective_permission_profile.to_runtime_permissions();
Ok(Self {
Expand Down
1 change: 1 addition & 0 deletions codex-rs/sandboxing/src/manager_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ fn managed_mitm_ca_private_key_is_denied_for_unrestricted_profile() {
let managed_private_key_path =
AbsolutePathBuf::from_absolute_path(managed_bundle_dir.path().join("ca.key"))
.expect("absolute managed private key path");
std::fs::write(&managed_private_key_path, "private key").expect("write private key");

let permission_profile = with_managed_mitm_ca_paths(
PermissionProfile::Disabled,
Expand Down
Loading