pub struct SecurityConfig {
pub drop_all_caps: bool,
pub keep_caps: Vec<LinuxCapability>,
pub no_new_privs: bool,
pub fail_on_cap_error: bool,
}Expand description
Declarative security policy.
Fields§
§drop_all_caps: boolDrop all capabilities before exec.
Note: capability operations require CAP_SETPCAP or root.
If the process lacks these privileges, the operation will log a warning and continue (unless fail_on_cap_error is set).
keep_caps: Vec<LinuxCapability>Optional allowlist of capabilities to keep after drop_all_caps.
Only meaningful when drop_all_caps = true.
no_new_privs: boolEnable no_new_privs for the child process.
This flag works without root privileges. Failures to set this flag are always fatal (spawn will fail).
fail_on_cap_error: boolWhen true, capability drop failures abort the spawn instead of logging and continuing.
Default: false (best-effort - non-fatal).
Implementations§
Trait Implementations§
Source§impl Clone for SecurityConfig
impl Clone for SecurityConfig
Source§fn clone(&self) -> SecurityConfig
fn clone(&self) -> SecurityConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SecurityConfig
impl Debug for SecurityConfig
Source§impl Default for SecurityConfig
impl Default for SecurityConfig
Source§fn default() -> SecurityConfig
fn default() -> SecurityConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SecurityConfig
impl RefUnwindSafe for SecurityConfig
impl Send for SecurityConfig
impl Sync for SecurityConfig
impl Unpin for SecurityConfig
impl UnsafeUnpin for SecurityConfig
impl UnwindSafe for SecurityConfig
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