Skip to content

Commit d7b7a0c

Browse files
committed
fix(docker): set apparmor=unconfined on sandbox containers
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 c0ffa93 commit d7b7a0c

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
@@ -927,6 +927,13 @@ fn build_container_create_body(
927927
"SYS_PTRACE".to_string(),
928928
"SYSLOG".to_string(),
929929
]),
930+
// AppArmor's default Docker profile blocks mount(2) with MS_SHARED
931+
// even when SYS_ADMIN is granted, which prevents ip-netns from
932+
// creating network namespaces for proxy-mode isolation. The sandbox
933+
// enforces its own isolation via seccomp, Landlock, and network
934+
// namespaces, so the host AppArmor profile adds no meaningful
935+
// defence here.
936+
security_opt: Some(vec!["apparmor=unconfined".to_string()]),
930937
extra_hosts: Some(vec![
931938
format!("{HOST_DOCKER_INTERNAL}:host-gateway"),
932939
format!("{HOST_OPENSHELL_INTERNAL}:host-gateway"),

0 commit comments

Comments
 (0)