pub struct Policy {Show 43 fields
pub fs_writable: Vec<PathBuf>,
pub fs_readable: Vec<PathBuf>,
pub fs_denied: Vec<PathBuf>,
pub deny_syscalls: Option<Vec<String>>,
pub allow_syscalls: Option<Vec<String>>,
pub net_allow_hosts: Vec<String>,
pub net_bind: Vec<u16>,
pub net_connect: Vec<u16>,
pub no_raw_sockets: bool,
pub no_udp: bool,
pub http_allow: Vec<HttpRule>,
pub http_deny: Vec<HttpRule>,
pub http_ports: Vec<u16>,
pub https_ca: Option<PathBuf>,
pub https_key: Option<PathBuf>,
pub max_memory: Option<ByteSize>,
pub max_processes: u32,
pub max_open_files: Option<u32>,
pub max_cpu: Option<u8>,
pub random_seed: Option<u64>,
pub time_start: Option<SystemTime>,
pub no_randomize_memory: bool,
pub no_huge_pages: bool,
pub no_coredump: bool,
pub deterministic_dirs: bool,
pub hostname: Option<String>,
pub fs_isolation: FsIsolation,
pub workdir: Option<PathBuf>,
pub cwd: Option<PathBuf>,
pub fs_storage: Option<PathBuf>,
pub max_disk: Option<ByteSize>,
pub on_exit: BranchAction,
pub on_error: BranchAction,
pub fs_mount: Vec<(PathBuf, PathBuf)>,
pub chroot: Option<PathBuf>,
pub clean_env: bool,
pub env: HashMap<String, String>,
pub gpu_devices: Option<Vec<u32>>,
pub cpu_cores: Option<Vec<u32>>,
pub num_cpus: Option<u32>,
pub port_remap: bool,
pub uid: Option<u32>,
pub policy_fn: Option<PolicyCallback>,
}Expand description
Sandbox policy configuration.
Fields§
§fs_writable: Vec<PathBuf>§fs_readable: Vec<PathBuf>§fs_denied: Vec<PathBuf>§deny_syscalls: Option<Vec<String>>§allow_syscalls: Option<Vec<String>>§net_allow_hosts: Vec<String>§net_bind: Vec<u16>§net_connect: Vec<u16>§no_raw_sockets: bool§no_udp: bool§http_allow: Vec<HttpRule>§http_deny: Vec<HttpRule>§http_ports: Vec<u16>TCP ports to intercept for HTTP ACL. Defaults to [80] (plus 443 when
https_ca is set). Override with http_ports to intercept custom ports.
https_ca: Option<PathBuf>PEM CA cert for HTTPS MITM. When set, port 443 is also intercepted.
https_key: Option<PathBuf>PEM CA key for HTTPS MITM. Required when https_ca is set.
max_memory: Option<ByteSize>§max_processes: u32§max_open_files: Option<u32>§max_cpu: Option<u8>§random_seed: Option<u64>§time_start: Option<SystemTime>§no_randomize_memory: bool§no_huge_pages: bool§no_coredump: bool§deterministic_dirs: bool§hostname: Option<String>§fs_isolation: FsIsolation§workdir: Option<PathBuf>§cwd: Option<PathBuf>§fs_storage: Option<PathBuf>§max_disk: Option<ByteSize>§on_exit: BranchAction§on_error: BranchAction§fs_mount: Vec<(PathBuf, PathBuf)>§chroot: Option<PathBuf>§clean_env: bool§env: HashMap<String, String>§gpu_devices: Option<Vec<u32>>§cpu_cores: Option<Vec<u32>>§num_cpus: Option<u32>§port_remap: bool§uid: Option<u32>§policy_fn: Option<PolicyCallback>Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Policy
impl<'de> Deserialize<'de> for Policy
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 Policy
impl !RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnsafeUnpin for Policy
impl !UnwindSafe for Policy
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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