pub struct ExecPolicy {
pub allowlist_mode: AllowlistMode,
pub allowed_commands: HashSet<String>,
pub default_safe_commands: HashSet<String>,
}Expand description
Execution policy — controls which binaries agents can run.
Fields§
§allowlist_mode: AllowlistModeAllowlist enforcement mode.
allowed_commands: HashSet<String>Explicitly allowed binary names.
default_safe_commands: HashSet<String>Default safe commands always allowed.
Implementations§
Source§impl ExecPolicy
impl ExecPolicy
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Create a permissive policy (all allowed).
Sourcepub fn enforced(commands: Vec<&str>) -> Self
pub fn enforced(commands: Vec<&str>) -> Self
Create an enforced policy with only the given commands.
Sourcepub fn is_binary_allowed(&self, binary: &str) -> bool
pub fn is_binary_allowed(&self, binary: &str) -> bool
Check if a binary is allowed.
Trait Implementations§
Source§impl Clone for ExecPolicy
impl Clone for ExecPolicy
Source§fn clone(&self) -> ExecPolicy
fn clone(&self) -> ExecPolicy
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 ExecPolicy
impl Debug for ExecPolicy
Source§impl Default for ExecPolicy
impl Default for ExecPolicy
Source§impl<'de> Deserialize<'de> for ExecPolicy
impl<'de> Deserialize<'de> for ExecPolicy
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 ExecPolicy
impl RefUnwindSafe for ExecPolicy
impl Send for ExecPolicy
impl Sync for ExecPolicy
impl Unpin for ExecPolicy
impl UnsafeUnpin for ExecPolicy
impl UnwindSafe for ExecPolicy
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