#[non_exhaustive]pub struct SecurityProfile {
pub standard: SecurityPreset,
pub seccomp: SeccompProfile,
pub capabilities: CapabilityConfig,
pub no_new_privileges: bool,
pub run_as_user: Option<u32>,
pub run_as_group: Option<u32>,
}Expand description
Per-process security context applied by the sandbox.
The standard preset provides safe defaults; individual fields can be
overridden for fine-grained control.
Expansion table:
| Preset | no_new_privileges | seccomp | capabilities |
|---|---|---|---|
Privileged | false | Unconfined | no drops |
Baseline | true | RuntimeDefault | drop NET_RAW, SYS_PTRACE, SYS_ADMIN |
Restricted | true | RuntimeDefault | drop ALL, no adds allowed |
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.standard: SecurityPresetHigh-level policy preset. Overrides other fields to safe defaults.
seccomp: SeccompProfileSeccomp profile to apply before exec.
capabilities: CapabilityConfigLinux capability adjustments.
no_new_privileges: boolSet PR_SET_NO_NEW_PRIVS before exec, preventing privilege escalation
via setuid binaries or file capabilities.
run_as_user: Option<u32>Run as this UID. None = inherit from calling process.
run_as_group: Option<u32>Run as this GID. None = inherit from calling process.
Trait Implementations§
Source§impl Clone for SecurityProfile
impl Clone for SecurityProfile
Source§fn clone(&self) -> SecurityProfile
fn clone(&self) -> SecurityProfile
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 SecurityProfile
impl Debug for SecurityProfile
Source§impl Default for SecurityProfile
impl Default for SecurityProfile
Source§impl<'de> Deserialize<'de> for SecurityProfile
impl<'de> Deserialize<'de> for SecurityProfile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SecurityProfile
impl RefUnwindSafe for SecurityProfile
impl Send for SecurityProfile
impl Sync for SecurityProfile
impl Unpin for SecurityProfile
impl UnsafeUnpin for SecurityProfile
impl UnwindSafe for SecurityProfile
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