Skip to main content

Module sandbox

Module sandbox 

Source
Expand description

Isolation policy for running untrusted commands on fleet nodes.

SandboxSpec is deliberately data, not behaviour: a side-effect-free description of what a command may touch. It serializes to JSON so a policy is reviewable in a pull request and testable with no hypervisor, no /dev/kvm, and no VM to boot.

Sandbox is the execution seam. A backend turns a spec plus a command into an outcome; Sandbox::is_isolated reports honestly whether the backend actually enforced anything, so a degraded run is visible rather than silently unprotected.

No hypervisor backend is wired up yet. The libkrun one cannot be built or tested on this machine - libkrun is Linux-only in nixpkgs - so it lives behind a feature gate rather than shipping unexercised FFI.

Modules§

vfkit
macOS sandbox backend built on vfkit (Virtualization.framework).

Structs§

DirectSandbox
A backend that enforces nothing; the default when no hypervisor is available.
SandboxCommand
A command to run inside a sandbox.
SandboxOutput
What a sandboxed command produced.
SandboxSpec
What a sandboxed command is permitted to touch.

Enums§

NetworkPolicy
Whether a sandboxed command may reach the network.
SandboxError
Why a sandbox could not run a command.
SpecError
Why a SandboxSpec is not enforceable.

Traits§

Sandbox
Executes commands under an isolation policy.