pub struct Syscalls {
pub allowed: HashSet<i64>,
pub denied: HashSet<i64>,
}Expand description
Syscall filtering configuration.
By default, a strict whitelist of ~40 safe syscalls is allowed. Use this to customize the allowed syscalls for specific use cases.
§Example
ⓘ
use evalbox_sandbox::Syscalls;
// Start with default whitelist, add specific syscalls
let syscalls = Syscalls::default()
.allow(libc::SYS_openat)
.allow(libc::SYS_socket);
// Or deny specific syscalls (removes from whitelist)
let syscalls = Syscalls::default()
.deny(libc::SYS_clone);Fields§
§allowed: HashSet<i64>Additional syscalls to allow beyond the default whitelist.
denied: HashSet<i64>Syscalls to deny (removes from whitelist).
Implementations§
Source§impl Syscalls
impl Syscalls
Sourcepub fn allow_many(self, syscalls: impl IntoIterator<Item = i64>) -> Self
pub fn allow_many(self, syscalls: impl IntoIterator<Item = i64>) -> Self
Allow multiple syscalls.
Sourcepub fn deny_many(self, syscalls: impl IntoIterator<Item = i64>) -> Self
pub fn deny_many(self, syscalls: impl IntoIterator<Item = i64>) -> Self
Deny multiple syscalls.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Syscalls
impl RefUnwindSafe for Syscalls
impl Send for Syscalls
impl Sync for Syscalls
impl Unpin for Syscalls
impl UnsafeUnpin for Syscalls
impl UnwindSafe for Syscalls
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more