Skip to content

Commit 94c947d

Browse files
committed
feat(sandbox): seccomp-notify DNS-pinned allowlist for Platform mode
Add kernel-level connect() interception using SECCOMP_RET_USER_NOTIF. The supervisor intercepts network syscalls, reads the destination sockaddr from the child's memory via /proc/pid/mem, evaluates it against a DNS-pinned allowlist, and either performs the operation on behalf of the child via pidfd_getfd() or denies it with EPERM. Components: - DnsPinnedAllowlist: resolve domains to IPs at sandbox creation, freeze for session lifetime to prevent DNS rebinding - BPF filter with AUDIT_ARCH validation for connect/sendto/sendmsg/ recvfrom/recvmsg/bind syscalls - pidfd_open + pidfd_getfd for TOCTOU-safe on-behalf-of operations - parse_sockaddr with correct endianness for IPv4/IPv6 - read_process_memory with read_exact for short-read safety Signed-off-by: Ladislav Smola <lsmola@redhat.com>
1 parent 240032e commit 94c947d

2 files changed

Lines changed: 583 additions & 0 deletions

File tree

crates/openshell-sandbox/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub mod procfs;
2323
mod provider_credentials;
2424
pub mod proxy;
2525
mod sandbox;
26+
pub mod seccomp_notify;
2627
mod secrets;
2728
mod skills;
2829
mod ssh;

0 commit comments

Comments
 (0)