Add seccomp-BPF syscall filter for job isolation (#99 PR 3/6)#103
Merged
Add seccomp-BPF syscall filter for job isolation (#99 PR 3/6)#103
Conversation
Default-deny syscall whitelist inspired by AXIS sandbox. Blocks ptrace, mount, bpf, unshare while allowing GPU compute (ioctl, mmap) and MPI (socket). Opt-in via SPUR_SECCOMP=1 env var. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
042af8c to
e7cd727
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third PR in the isolation series (#99). Adds a default-deny seccomp-BPF syscall filter inspired by the AXIS sandbox.
Changes
seccomp.rsmodule with ~150 whitelisted syscallspre_exec— inherited by all child processesPR_SET_NO_NEW_PRIVSto prevent setuid escalationGPU access verification
seccomp whitelist includes
ioctl(syscall 16) for GPU driver communication andmmap(syscall 9) for VRAM mapping. HIP and CUDA workloads work normally.Tests (5 new)
test_dangerous_syscalls_not_in_whitelist— ptrace, mount, bpf, unshare blockedtest_gpu_syscalls_in_whitelist— ioctl, mmap, mprotect allowedtest_network_syscalls_in_whitelist— socket, connect allowedtest_allowed_syscalls_sorted_and_deduped— 100-200 unique syscallstest_bpf_filter_builds— BPF program construction works🤖 Generated with Claude Code