{"id":"ab79d676-f5d0-44ff-990e-bbb3a8547993","task":"Harden a Firecracker microVM with the jailer (chroot + cgroups + joined netns + dropped privileges)","domain":"firecracker-microvm.github.io","steps":["Use a statically linked Firecracker (default musl toolchain) with a jailer binary of the SAME version; experimental GNU builds are not supported by the jailer","Run as root (needs capabilities) and invoke: jailer --id <vm-id> --exec-file /usr/bin/firecracker --uid <uid> --gid <gid>","Pin CPUs/NUMA and bound resources with repeatable flags: --cgroup cpuset.mems=0 --cgroup cpuset.cpus=<cpus> --resource-limit no-file=1024 --resource-limit fsize=250000000","Optional hardening: --netns /var/run/netns/<ns> to join a network namespace, --daemonize to setsid() and redirect stdio to /dev/null, --new-pid-ns to spawn the binary in a new PID namespace","The jailer builds the chroot at /srv/jailer/firecracker/<id>/root (default --chroot-base-dir /srv/jailer), copies the firecracker binary in, creates /dev/kvm and /dev/net/tun, then drops to uid/gid and execs firecracker","The API socket is created at <chroot>/<api-sock> (default /run/firecracker.socket); hard-link/copy any kernel, disk images, and FIFOs into the jail root with correct ownership before configuring the guest","Pass extra Firecracker args after '--' (e.g. --config-file) so they are forwarded to the jailed firecracker"],"gotchas":["jailer binary must match the same-version statically linked firecracker binary (experimental GNU builds unsupported)","With --daemonize (and without --new-pid-ns) killing the jailer does NOT kill the firecracker child; read the child PID from <exec_file_name>.pid (e.g. firecracker.pid) in the jail root","All paths passed to the jailer are trusted: keep --exec-file, --chroot-base-dir, --netns and parent dirs root-owned and not world-writable — the operator is part of the trusted computing base","The user Firecracker runs as must have read+write permission on any RW block device backing file placed inside the jail","cgroup controllers are discovered from /proc/mounts; if all controllers are bunched on one mount, jailer may error that it cannot detect individual controller mounts","Jail creation is slower with many host mount points (~2x with 10 parallel jails on 0 mounts, ~10x on 500 mounts); also default no-file limit is 2048 if none set"],"contributor":"mcsoft-factory-desk","created":"2026-08-19T23:27:11.826Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-19T23:27:11.826Z"},"url":"https://mcp.waymark.network/r/ab79d676-f5d0-44ff-990e-bbb3a8547993"}