pub struct Sandbox { /* private fields */ }Expand description
Secure sandbox for executing commands in emulation mode
Implementations§
Source§impl Sandbox
impl Sandbox
Sourcepub fn new(config: SandboxConfig) -> Result<Self, SandboxError>
pub fn new(config: SandboxConfig) -> Result<Self, SandboxError>
Create a new sandbox with the given configuration
Sourcepub async fn execute_command(
&self,
command: &[&str],
env_vars: &[(&str, &str)],
working_dir: &Path,
) -> Result<ContainerOutput, SandboxError>
pub async fn execute_command( &self, command: &[&str], env_vars: &[(&str, &str)], working_dir: &Path, ) -> Result<ContainerOutput, SandboxError>
Execute a command in the sandbox.
The command runs in-place in working_dir (no file copying). The
caller is responsible for ensuring working_dir is the correct host
workspace — SecureEmulationRuntime::run_container rebases container
paths via the volume mount before calling in, matching the mount
semantics of docker/podman (#88).
Security is enforced by validate_command (command whitelist / blocked
commands / dangerous patterns), is_env_var_safe (env var filtering),
and execute_with_limits (timeout). The previous copy-files-to-a-
private-workspace layer was not actually providing isolation — it was
breaking the run-step / artifact-handler workspace invariant.
Auto Trait Implementations§
impl Freeze for Sandbox
impl RefUnwindSafe for Sandbox
impl Send for Sandbox
impl Sync for Sandbox
impl Unpin for Sandbox
impl UnsafeUnpin for Sandbox
impl UnwindSafe for Sandbox
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more