File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,6 +172,36 @@ jobs:
172172 - name : Test
173173 run : mise run test:python
174174
175+ rootless-caps :
176+ name : Rootless capability tests
177+ needs : pr_metadata
178+ if : needs.pr_metadata.outputs.should_run == 'true'
179+ runs-on : ubuntu-24.04
180+ steps :
181+ - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
182+
183+ - uses : actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
184+ with :
185+ toolchain : " 1.95.0"
186+ cache : false
187+
188+ - name : Run supervisor capability tests without CAP_SETPCAP
189+ run : |
190+ sudo useradd -m testuser
191+ sudo chmod a+rx /home/runner /home/runner/work /home/runner/work/OpenShell
192+ sudo chmod -R a+rX "$GITHUB_WORKSPACE"
193+ sudo cp -r /home/runner/.rustup /home/testuser/.rustup
194+ sudo chown -R testuser: /home/testuser/.rustup
195+ sudo mkdir -p /home/testuser/.cargo
196+ sudo cp /home/runner/.cargo/config.toml /home/testuser/.cargo/ 2>/dev/null || true
197+ sudo chown -R testuser: /home/testuser/.cargo
198+ sudo -u testuser env \
199+ PATH="/home/testuser/.cargo/bin:/home/testuser/.rustup/toolchains/1.95.0-x86_64-unknown-linux-gnu/bin:$PATH" \
200+ CARGO_HOME="/home/testuser/.cargo" \
201+ RUSTUP_HOME="/home/testuser/.rustup" \
202+ CARGO_TARGET_DIR="/home/testuser/target" \
203+ bash -c "cd $GITHUB_WORKSPACE && cargo test -p openshell-supervisor-process --lib -- capability_bounding drop_privileges"
204+
175205 markdown :
176206 name : Markdown
177207 needs : pr_metadata
Original file line number Diff line number Diff line change @@ -16,10 +16,14 @@ Each sandbox workload has two trust levels:
1616The supervisor keeps enough privilege to manage the sandbox, but the agent child
1717loses that privilege before user code runs. On Linux, child setup clears the
1818capability bounding set during privilege drop so later execs cannot regain
19- container-granted capabilities. This is fail-closed: the supervisor retains
20- ` CAP_SETPCAP ` solely to perform the clear, and spawning the workload or SSH shell
21- aborts unless the bounding set ends up empty. A ` setpcap ` ` EPERM ` is tolerated
22- only when the set is already empty; any other outcome fails the spawn.
19+ container-granted capabilities. When ` CAP_SETPCAP ` is available, this is
20+ fail-closed: the supervisor clears the bounding set and aborts if capabilities
21+ remain. When ` CAP_SETPCAP ` is unavailable (rootless Podman with AppArmor
22+ user-namespace restrictions, or similar environments), the supervisor logs a
23+ warning, emits an OCSF ` DetectionFinding ` alert, and continues with the
24+ bounding set intact. In this degraded mode the child process relies on seccomp
25+ to block dangerous syscalls; Landlock filesystem restrictions are applied
26+ independently and may also be active.
2327
2428## Startup Flow
2529
You can’t perform that action at this time.
0 commit comments