Skip to content

Commit 182cbc6

Browse files
authored
fix(docker): set apparmor=unconfined on sandbox containers (ai-openshell#1078)
Docker's default AppArmor profile blocks mount(2) with MS_SHARED even when SYS_ADMIN is granted, which prevents ip-netns from creating network namespaces required for proxy-mode network isolation. The sandbox enforces its own isolation (seccomp, Landlock, network namespaces), so the host AppArmor profile provides no meaningful additional defence inside a container that already holds SYS_ADMIN.
1 parent 51351e4 commit 182cbc6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • crates/openshell-driver-docker/src

‎crates/openshell-driver-docker/src/lib.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,13 @@ fn build_container_create_body(
928928
"SYS_PTRACE".to_string(),
929929
"SYSLOG".to_string(),
930930
]),
931+
// AppArmor's default Docker profile blocks mount(2) with MS_SHARED
932+
// even when SYS_ADMIN is granted, which prevents ip-netns from
933+
// creating network namespaces for proxy-mode isolation. The sandbox
934+
// enforces its own isolation via seccomp, Landlock, and network
935+
// namespaces, so the host AppArmor profile adds no meaningful
936+
// defence here.
937+
security_opt: Some(vec!["apparmor=unconfined".to_string()]),
931938
extra_hosts: Some(vec![
932939
format!("{HOST_DOCKER_INTERNAL}:host-gateway"),
933940
format!("{HOST_OPENSHELL_INTERNAL}:host-gateway"),

0 commit comments

Comments
 (0)