pub struct BubblewrapSandbox { /* private fields */ }Expand description
Linux sandbox using bwrap: the host filesystem is mounted read-only,
the workspace read-write, /tmp is a private tmpfs, PID and (unless
allowed) network namespaces are unshared, and the sandbox dies with its
parent. The credential locations in HOME_SECRET_PATHS are hidden by
default.
Implementations§
Source§impl BubblewrapSandbox
impl BubblewrapSandbox
pub fn new() -> Self
Sourcepub fn default_deny_read(self, paths: impl IntoIterator<Item = PathBuf>) -> Self
pub fn default_deny_read(self, paths: impl IntoIterator<Item = PathBuf>) -> Self
Replace the paths hidden from every command (default:
default_deny_read). An empty list hides nothing beyond each
command’s own SandboxCommand::deny_read.
Sourcepub fn args(&self, cmd: &SandboxCommand) -> Vec<String>
pub fn args(&self, cmd: &SandboxCommand) -> Vec<String>
The bwrap argument list for a spec (before sh -c <command>).
Source§impl BubblewrapSandbox
impl BubblewrapSandbox
Sourcepub fn scoped_args(scope: &BubblewrapScope, command: &[String]) -> Vec<String>
pub fn scoped_args(scope: &BubblewrapScope, command: &[String]) -> Vec<String>
The bwrap argument list for a task-scoped command (see
BubblewrapScope), ending with -- <command...>. Listed paths are
mounted shallowest first, so a narrower grant inside a wider one
keeps its own access; a path listed both ways is writable.
Trait Implementations§
Source§impl Clone for BubblewrapSandbox
impl Clone for BubblewrapSandbox
Source§impl Debug for BubblewrapSandbox
impl Debug for BubblewrapSandbox
Source§impl Default for BubblewrapSandbox
impl Default for BubblewrapSandbox
Source§impl Sandbox for BubblewrapSandbox
impl Sandbox for BubblewrapSandbox
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Short name recorded in receipts, for example
local or bubblewrap.Source§fn is_available(&self) -> bool
fn is_available(&self) -> bool
Whether this backend can run commands here.
Source§fn is_contained(&self) -> bool
fn is_contained(&self) -> bool
Whether the backend confines writes to the workspace.
Source§fn enforces_deny_read(&self) -> bool
fn enforces_deny_read(&self) -> bool
Whether the backend keeps a command from reading the paths in
SandboxCommand::deny_read. Default false: a backend claims it
only when it enforces it, and callers refuse rather than pretend.Source§fn enforces_network_off(&self) -> bool
fn enforces_network_off(&self) -> bool
Whether the backend cuts the network when
SandboxCommand::allow_network is false. Default false, as for
Sandbox::enforces_deny_read.fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 SandboxCommand,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput, ExecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Forget for BubblewrapSandbox
impl Freeze for BubblewrapSandbox
impl Move for BubblewrapSandbox
impl RefUnwindSafe for BubblewrapSandbox
impl Send for BubblewrapSandboxwhere
RawVecInner: Send,
impl Sync for BubblewrapSandboxwhere
RawVecInner: Sync,
impl Unpin for BubblewrapSandbox
impl UnsafeUnpin for BubblewrapSandboxwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<PathBuf>: UnsafeUnpin,
impl UnwindSafe for BubblewrapSandboxwhere
RawVecInner: UnwindSafe,
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