pub struct SecurityConfig {
pub seccomp: SeccompMode,
pub no_new_privileges: bool,
pub cap_add: Vec<String>,
pub cap_drop: Vec<String>,
pub privileged: bool,
}Expand description
Parsed security configuration for guest process enforcement.
Fields§
§seccomp: SeccompModeSeccomp filter mode.
no_new_privileges: boolSet PR_SET_NO_NEW_PRIVS before exec.
cap_add: Vec<String>Linux capabilities to add.
cap_drop: Vec<String>Linux capabilities to drop.
privileged: boolPrivileged mode (disables all restrictions).
Implementations§
Source§impl SecurityConfig
impl SecurityConfig
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validate that the security configuration can be enforced at runtime.
Returns an error if custom seccomp profiles are specified, since they are not yet supported and would silently fall through to no filtering.
Sourcepub fn from_options(
security_opt: &[String],
cap_add: &[String],
cap_drop: &[String],
privileged: bool,
) -> Self
pub fn from_options( security_opt: &[String], cap_add: &[String], cap_drop: &[String], privileged: bool, ) -> Self
Parse security config from CLI-style options.
Accepts the same format as Docker:
seccomp=unconfined— disable seccompseccomp=<path>— custom profileno-new-privilegesorno-new-privileges=true— enable (default)no-new-privileges=false— disable
Sourcepub fn to_env_vars(&self) -> Vec<(String, String)>
pub fn to_env_vars(&self) -> Vec<(String, String)>
Encode as environment variables for passing to guest-init.
Returns a list of (key, value) pairs with A3S_SEC_* prefix.
Sourcepub fn from_env_vars() -> Self
pub fn from_env_vars() -> Self
Parse from guest-init environment variables.
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 · 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§impl<'de> Deserialize<'de> for SecurityConfig
impl<'de> Deserialize<'de> for SecurityConfig
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 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