Skip to content

Commit a49eec8

Browse files
committed
fix(worker): remove cap_drop to allow nix to work in containers
Security is already provided by multiple isolation layers: - NixOS container (systemd-nspawn) - Podman container isolation - RFC1918 network blocking via iptables - Read-only repo mount - Resource limits (memory, CPU, PIDs)
1 parent d015acd commit a49eec8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/worker/builder/podman.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,10 @@ async fn run_build_in_container(
179179
cpu_period: Some(100000),
180180
cpu_quota: Some(state.config.container_cpu_quota),
181181
pids_limit: Some(state.config.container_pids_limit),
182-
// Security hardening
182+
// Security: prevent privilege escalation
183+
// Note: We don't drop all capabilities since nix needs CHOWN/SETUID/etc.
184+
// Security is provided by: NixOS container + Podman isolation + RFC1918 network blocking
183185
security_opt: Some(vec!["no-new-privileges:true".to_string()]),
184-
cap_drop: Some(vec!["ALL".to_string()]),
185186
// Temp filesystem for build artifacts
186187
tmpfs: Some(
187188
[("/tmp".to_string(), "size=2G,mode=1777".to_string())]

0 commit comments

Comments
 (0)