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.

8No way to gain powersNO_NEW_PRIVS
7Runs as a normal usercredential drop, UID 60000+
6No special powerscapabilities zeroed
551 risky actions blockedseccomp-BPF
4Memory and CPU limitscgroups v2
3No internetnetwork namespace
2Private filesmount namespace + chroot
1Own processesPID namespace
[ your code ]
To break out, code would have to beat all eight at once

The 8 layers#

LayerIn plain wordsKernel featureWhat it stops
1. PID namespaceOwn processesCLONE_NEWPIDSeeing or signalling other programs
2. Mount namespacePrivate filesCLONE_NEWNS + chrootReading anything outside its folder
3. Network namespaceNo internetCLONE_NEWNETAny network use (no connections, no DNS in Judge mode)
4. Cgroups v2Memory and CPU limitscgroup controllersEating all memory, copying itself forever, hogging the CPU
5. Seccomp-BPF51 risky actions blockedBPF syscall filterDangerous requests: ptrace, mount, bpf, io_uring
6. CapabilitiesNo special powersBounding + ambient setsAll 5 capability sets zeroed, so no way to gain admin powers
7. Credential dropRuns as a normal usersetresuid/setresgidRunning as admin (root)
8. NO_NEW_PRIVSNo way to gain powersprctl(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:

  1. Remove the powers the program could gain later (bounding and ambient capabilities)
  2. Switch from admin to a normal user (unprivileged UID/GID)
  3. 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.