Isolation Model#
Every run gets a fresh box that is thrown away afterwards. The box is built from 8 separate layers of protection, all of them features of the Linux kernel itself. To break out, code would have to beat all eight at once.
Rustbox does not wrap a container. It sets up the kernel's own protections directly, in a fixed order, and the Rust compiler checks that order: if a step is missing, rustbox does not build.
The 8 layers#
| Layer | In plain words | Kernel feature | What it stops |
|---|---|---|---|
| 1. PID namespace | Own processes | CLONE_NEWPID | Seeing or signalling other programs |
| 2. Mount namespace | Private files | CLONE_NEWNS + chroot | Reading anything outside its folder |
| 3. Network namespace | No internet | CLONE_NEWNET | Any network use (no connections, no DNS in Judge mode) |
| 4. Cgroups v2 | Memory and CPU limits | cgroup controllers | Eating all memory, copying itself forever, hogging the CPU |
| 5. Seccomp-BPF | 51 risky actions blocked | BPF syscall filter | Dangerous requests: ptrace, mount, bpf, io_uring |
| 6. Capabilities | No special powers | Bounding + ambient sets | All 5 capability sets zeroed, so no way to gain admin powers |
| 7. Credential drop | Runs as a normal user | setresuid/setresgid | Running as admin (root) |
| 8. NO_NEW_PRIVS | No way to gain powers | prctl(PR_SET_NO_NEW_PRIVS) | Getting admin powers back through setuid programs |
Own processes, private files, no internet (layers 1-3)#
Linux namespaces give the box its own view of the world. The code inside sees itself as the only program (PID 1), has no network and sees only a small set of files.
We use PID, IPC, UTS, mount and network namespaces. We deliberately skip user namespaces: they have a long history of security holes, and rustbox does not need them to set up the box.
Memory and CPU limits (layer 4, cgroups v2)#
Cgroups are the only Linux feature that can stop a program for using too much real memory (not just reserved memory). Every box gets its own cgroup with hard limits on memory, number of processes and CPU time.
When code goes over its memory limit, the kernel stops it and Rustbox records an MLE (too much memory) result. That result comes from the kernel's own out-of-memory record, not a guess from the exit code.
51 risky actions blocked (layer 5, seccomp-BPF)#
A small filter inside the kernel checks every request the program makes to the system (every syscall). Rustbox blocks 51 of them, including io_uring (a past source of kernel exploits), ptrace (spying on other programs), bpf (loading code into the kernel), mount and pivot_root (changing the file system) and ways out of a namespace.
A blocked request gets one of three answers: ENOSYS ("not available") for requests that language runtimes try and then work around, EPERM ("not allowed") for harmless checks, and KILL for requests only an exploit would make.
See Seccomp Filtering for the full list.
No admin powers (layers 6-8)#
Once the box is set up, every power is removed in three steps, always in this order:
- Remove the powers the program could gain later (bounding and ambient capabilities)
- Switch from admin to a normal user (unprivileged UID/GID)
- Clear every remaining power and set NO_NEW_PRIVS, so the program can never get them back
The compiler checks this order. Running code before all three steps are done is a type error, not a check that happens while running.
A fresh box for every run#
Every run gets a new box built from scratch. Nothing is reused, nothing is kept warm, nothing is shared between runs. When the run ends, the box is deleted and everything it used is freed.
Attack tests#
Rustbox is tested against 147 attacks in all 8 supported languages:
- Programs that copy themselves forever or eat all memory
- Trying to leave the box's folder (chroot escapes)
- Trying to get around the blocked actions
- Trying to become admin with setuid, capabilities or ptrace
- Trying to reach the network
- Tricks with file links (symlinks and hardlinks)
- Attacks using signals
Result: 0 break-outs across 22 kinds of attack in 8 languages.
Why trust Rustbox cloud#
- It is not a wrapper around containers. It uses the same kernel features, set up in a fixed order that the compiler checks.
- Every result comes from what the kernel recorded, not a guess. When we say "too much memory" (
MLE), it is because the kernel's out-of-memory killer stopped the program, not because the exit code looked odd. - The attack tests run on every release, so a weaker box is caught before it ships.
- Each blocked action gets the right answer, not one blanket rule. Requests that runtimes try for speed (io_uring, process_vm_readv) get a polite "not available" instead of the program being killed.