Integration
Checklist
- Install Bubblewrap and util-linux (
apt install bubblewrap util-linux); confirmvendor/bin/pdfx-sandbox-checkprintsRESULT: PASS. - Put the jobs root outside the web root, on a filesystem only the application user can read.
- Create one
JobWorkspaceper job; alwayscleanup()infinally, and sweep stale workspaces from a scheduled task. - Pass only the files a job needs into the workspace and refer to them through
sandboxPath(). - Treat
SandboxUnavailableExceptionas a failed job, never as a reason to retry unsandboxed. - Read results with
resolveOutput(), and treat them as untrusted.
Static vs dynamic binaries
Static executables (such as Go’s pdfcpu) need nothing but the strict default. Dynamic ones need libraries:
SandboxConfig::strict()->withSystemLibraries() or a hand-picked withReadOnlyPaths([...]).
Passwords and secrets
Prefer stdin (run(..., stdin: $secret)) over arguments, since arguments can be visible in process listings on the host.
Laravel
See examples/laravel-example.php. Bind a SecureRunner in a service provider and keep the binary path in config.
Docker / restricted hosts
Bubblewrap needs unprivileged user namespaces. Many container runtimes block them by default; where sandbox creation fails the runner fails closed.