Free module
Sandboxing untrusted and AI-written code
Learn to sandbox untrusted and AI-written code hands on: Linux namespaces, cgroups v2, seccomp, capabilities, egress control, bubblewrap and gVisor.
The lessons
Each lesson is free and interactive. Press Start lab to run its commands in a live lab and to sit its quizzes and tasks, with no account needed.
1 · Virtual machine lab
What untrusted code can do
I can list what untrusted code can reach on the machine that runs it.
Read the lesson2 · Virtual machine lab
Linux namespaces with unshare
I can use unshare to hide processes, the network and files from a program.
Read the lesson3 · Virtual machine lab
Resource limits with cgroups v2
I can set memory, CPU and process limits on a program with cgroups.
Read the lesson4 · Virtual machine lab
Seccomp filters and Linux capabilities
I can run a program under a seccomp allow-list and with its capabilities dropped.
Read the lesson5 · Virtual machine lab
Network egress and read-only filesystems
I can limit where sandboxed code may connect and which files it may write.
Read the lesson6 · Virtual machine lab
gVisor, microVMs and choosing a sandbox
I can choose an isolation level for running a given kind of untrusted code.
Read the lesson
Worked in a real lab
Every lesson of this module is worked in a lab started for you alone. The labs it uses:
Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.