pub struct SeccompFilter { /* private fields */ }Expand description
Seccomp filter builder
Implementations§
Source§impl SeccompFilter
impl SeccompFilter
Sourcepub fn from_profile(profile: SeccompProfile) -> Self
pub fn from_profile(profile: SeccompProfile) -> Self
Create filter from profile
Sourcepub fn allow_syscall(&mut self, name: impl Into<String>)
pub fn allow_syscall(&mut self, name: impl Into<String>)
Add syscall to whitelist
Sourcepub fn block_syscall(&mut self, name: impl Into<String>)
pub fn block_syscall(&mut self, name: impl Into<String>)
Block a syscall (deny even if in whitelist)
Sourcepub fn is_allowed(&self, name: &str) -> bool
pub fn is_allowed(&self, name: &str) -> bool
Check if syscall is allowed
Sourcepub fn allowed_syscalls(&self) -> &HashSet<String>
pub fn allowed_syscalls(&self) -> &HashSet<String>
Get allowed syscalls
Sourcepub fn blocked_syscalls(&self) -> &HashSet<String>
pub fn blocked_syscalls(&self) -> &HashSet<String>
Get blocked syscalls
Sourcepub fn allowed_count(&self) -> usize
pub fn allowed_count(&self) -> usize
Count allowed syscalls
Sourcepub fn is_kill_on_violation(&self) -> bool
pub fn is_kill_on_violation(&self) -> bool
Check if killing on violation
Sourcepub fn set_kill_on_violation(&mut self, kill: bool)
pub fn set_kill_on_violation(&mut self, kill: bool)
Set kill on violation
Sourcepub fn profile(&self) -> SeccompProfile
pub fn profile(&self) -> SeccompProfile
Get the profile used to create this filter
Sourcepub fn set_allow_unknown_syscalls(&mut self, allow: bool)
pub fn set_allow_unknown_syscalls(&mut self, allow: bool)
Set whether unknown syscalls should be allowed (warnings only)
Default is false, which means unknown syscalls cause compilation errors. Setting this to true allows filters with unknown syscalls to compile, but those syscalls will be silently ignored.
Sourcepub fn allows_unknown_syscalls(&self) -> bool
pub fn allows_unknown_syscalls(&self) -> bool
Check if unknown syscalls are allowed
Trait Implementations§
Source§impl Clone for SeccompFilter
impl Clone for SeccompFilter
Source§fn clone(&self) -> SeccompFilter
fn clone(&self) -> SeccompFilter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SeccompFilter
impl RefUnwindSafe for SeccompFilter
impl Send for SeccompFilter
impl Sync for SeccompFilter
impl Unpin for SeccompFilter
impl UnwindSafe for SeccompFilter
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