pub enum SeccompProfile {
Minimal,
IoHeavy,
Compute,
Network,
Unrestricted,
}Expand description
Seccomp filter profile
Variants§
Minimal
Minimal profile - only essential syscalls
IoHeavy
IO-heavy profile - includes file operations
Compute
Compute profile - includes memory operations
Network
Network profile - includes socket operations
Unrestricted
Unrestricted - allow most syscalls
Implementations§
Source§impl SeccompProfile
impl SeccompProfile
Sourcepub fn all() -> Vec<Self>
pub fn all() -> Vec<Self>
Get all profiles
Examples found in repository?
examples/seccomp_profiles.rs (line 10)
5fn main() {
6 println!("=== Sandbox RS - Seccomp Profiles ===\n");
7
8 println!("Available seccomp profiles:\n");
9
10 for profile in SeccompProfile::all() {
11 println!("Profile: {:?}", profile);
12 println!(" Description: {}", profile.description());
13
14 // Note: Actual syscall filtering would require kernel-level seccomp
15 // For now, we just demonstrate the API
16 println!(" Note: Syscall filtering requires root and proper seccomp setup\n");
17 }
18
19 println!("\nProfile Usage Example:");
20 println!(" let sandbox = SandboxBuilder::new(\"my-box\")");
21 println!(" .seccomp_profile(SeccompProfile::IoHeavy)");
22 println!(" .build()?;");
23}Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Get description of profile
Examples found in repository?
examples/seccomp_profiles.rs (line 12)
5fn main() {
6 println!("=== Sandbox RS - Seccomp Profiles ===\n");
7
8 println!("Available seccomp profiles:\n");
9
10 for profile in SeccompProfile::all() {
11 println!("Profile: {:?}", profile);
12 println!(" Description: {}", profile.description());
13
14 // Note: Actual syscall filtering would require kernel-level seccomp
15 // For now, we just demonstrate the API
16 println!(" Note: Syscall filtering requires root and proper seccomp setup\n");
17 }
18
19 println!("\nProfile Usage Example:");
20 println!(" let sandbox = SandboxBuilder::new(\"my-box\")");
21 println!(" .seccomp_profile(SeccompProfile::IoHeavy)");
22 println!(" .build()?;");
23}Trait Implementations§
Source§impl Clone for SeccompProfile
impl Clone for SeccompProfile
Source§fn clone(&self) -> SeccompProfile
fn clone(&self) -> SeccompProfile
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 moreSource§impl Debug for SeccompProfile
impl Debug for SeccompProfile
Source§impl PartialEq for SeccompProfile
impl PartialEq for SeccompProfile
impl Eq for SeccompProfile
impl StructuralPartialEq for SeccompProfile
Auto Trait Implementations§
impl Freeze for SeccompProfile
impl RefUnwindSafe for SeccompProfile
impl Send for SeccompProfile
impl Sync for SeccompProfile
impl Unpin for SeccompProfile
impl UnwindSafe for SeccompProfile
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