pub struct ExecConfig {
pub default_mode: ExecMode,
pub allow_shell_mode: bool,
pub allowed_commands: Vec<String>,
pub allowlist_mode: AllowlistMode,
pub default_timeout_secs: u64,
pub max_timeout_secs: u64,
}Expand description
Exec configuration.
Governs how the kernel dispatches commands for execution.
Fields§
§default_mode: ExecModeDefault execution mode.
allow_shell_mode: boolAllow shell mode. DANGEROUS — should be false in production.
allowed_commands: Vec<String>Commands allowed to run on the host. If empty, all bare-name commands are permitted (development mode).
allowlist_mode: AllowlistModeAllowlist enforcement mode.
Permissive = empty list means all allowed (dev mode).
Enforced = only listed commands allowed (production).
default_timeout_secs: u64Default timeout for an exec call in seconds.
max_timeout_secs: u64Maximum allowed timeout for an exec call in seconds.
Implementations§
Source§impl ExecConfig
impl ExecConfig
Sourcepub fn is_binary_allowed(&self, name: &str) -> bool
pub fn is_binary_allowed(&self, name: &str) -> bool
Check whether a binary / command name is allowed to execute.
In Permissive mode, returns true when allowed_commands is empty
(all allowed) or when the name is present in the allow-list.
In Enforced mode, only names present in the allow-list are permitted.
Trait Implementations§
Source§impl Clone for ExecConfig
impl Clone for ExecConfig
Source§fn clone(&self) -> ExecConfig
fn clone(&self) -> ExecConfig
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 ExecConfig
impl Debug for ExecConfig
Source§impl Default for ExecConfig
impl Default for ExecConfig
Source§impl<'de> Deserialize<'de> for ExecConfig
impl<'de> Deserialize<'de> for ExecConfig
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 ExecConfig
impl RefUnwindSafe for ExecConfig
impl Send for ExecConfig
impl Sync for ExecConfig
impl Unpin for ExecConfig
impl UnsafeUnpin for ExecConfig
impl UnwindSafe for ExecConfig
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