{"slug": "building-openai-cisco-s-shirudo-from-source-on-the-wrong-distro-on-purpose", "title": "Building OpenAI + Cisco's Shirudo from source (on the wrong distro, on purpose)", "summary": "A developer built OpenAI and Cisco's open-source Shirudo eBPF runtime-security tool from source on a Debian 12 VM, documenting the full recipe and patches in a public repo. The build required LLVM 23, OpenSSL 3.5 for ML-DSA signatures, and a bpf-next kernel, and the CLI's bpm, upatch and status commands failed with 'image state: Invalid argument' because identity_read() uses BPF_F_PATH_FD, which only exists on kernel 6.7 and later. The writeup concludes Shirudo's TPM 2.0, signed-loader-only enforcement model excludes co-resident tools like Tetragon, Falco and bpftrace, making it a different operating model rather than an early rough edge.", "body_md": "On November 23, 2026, OpenAI and Cisco released [Shirudo](https://github.com/shirudo-dev/shirudo)\n\n(盾, \"shield\"), an open-source Linux runtime-security tool. It uses eBPF to drop temporary, signed\n\n\"shields\" (they call them upatches) onto a running service, blocking an exploit without a reboot while\n\nyou test and roll out the real patch. In the launch demo, a shield written by OpenAI's Codex stopped a\n\nlive Java4Shell exploit against a running Elasticsearch instance, no restart needed.\n\nI run a small homelab, and the announcements left my actual question unanswered: can I run this today,\n\nand what does it cost to get there? So I built it from source and booted it in a VM. This is what I\n\nfound, including the point where the tool itself shows you why it isn't ready for your servers.\n\n`bpf-next` kernel it needs with a software\nTPM, and watched enforcement come up green and block unsigned BPF loads in real time.\nBefore touching it I read the docs. Shirudo is blunt about what a production target needs: a `bpf-next`\n\nkernel carrying its out-of-tree patches (\"no compatibility mode and no fallback for an older kernel\"), a\n\nTPM 2.0 (\"there is no mode without a TPM\"), systemd 256 or newer, a dracut UKI boot, and LLVM 23. An\n\nenforcing host only lets signed loaders install BPF, so it can't share a machine with Tetragon, Falco,\n\nCilium, or bpftrace. That isn't an early-days rough edge. It's a different operating model.\n\nNone of that was going to run on my boxes, which was the point. I wanted a throwaway VM to learn on, and\n\nI picked a Debian 12 build host deliberately. If it compiles there, where `make target-deps` builds its\n\nown OpenSSL, libcurl and tss2 from source, then the kernel is the one dependency I genuinely can't paper\n\nover, and I'd hit every soft spot on the way. The test VM it boots runs a prebuilt `bpf-next` kernel the\n\nproject ships, so I didn't have to compile a kernel myself.\n\nEverything below ran on a 6-vCPU / 12 GB Debian 12 VM with nested KVM. The patches, the full recipe, and\n\nthe demo script are in the repo: [kaushik0x7d2/shirudo-from-source](https://github.com/kaushik0x7d2/shirudo-from-source).\n\nIn order:\n\n`apt.llvm.org` carries 23\nfor bookworm on its experimental channel, and `llvm.sh 23` wants `software-properties-common` first.`console-setup`.` dpkg` and `apt`\nuntil you remove it.`tpm2-tss`'s bootstrap needs `autoconf`, `automake`, `libtool` and `autoconf-archive`,\nor you get `autoreconf: not found`.` make target-deps`.` build/target-deps/`. Bookworm ships OpenSSL 3.0, which is too old; 3.5 is the first release with\nML-DSA, and Shirudo's signatures need it.`target-deps` builds OpenSSL libs-only (`no-apps`), but the build probes run\nthe `openssl` binary to check for ML-DSA. I built the CLI from the staged source, then had to\n`patchelf --set-rpath` it to its own 3.5 libs (it kept picking up the system 3.0 at runtime) and give\nit an `openssl.cnf`, since `install_sw` doesn't write one.`CC=clang`.`-fstrict-flex-arrays=3`. gcc-12 doesn't know the flag; clang-23 does.` pkg-config` leaves out: `-lm -ldl` for LuaJIT, the full `--static` chain for\n`tss2`, `libcurl`, `libssl` and `libcrypto`, and `-ltss2-tcti-device` for the `nodl` tctildr.`bpm`, `upatch` and `status` command died\nwith `shirudo: image state: Invalid argument`. The reason is worth sitting with. Shirudo's\n`identity_read()` calls `bpf_obj_get_opts(..., BPF_F_PATH_FD)`, and `BPF_F_PATH_FD` only exists on\nkernel 6.7 and up. On my host's 6.1 kernel that syscall returns `EINVAL` for the unknown flag, and the\nstartup check only tolerates `ENOENT`, `EPERM` and `EACCES`. One line to also treat `kvm` group and a libguestfs flag.`virt-customize` (1.48) predates `--no-selinux-relabel`, which is a no-op on the Ubuntu\nguest anyway, so I dropped it.`shirudo build` compiles upatches against headers at the baked\n`/usr/local/share/shirudo/bpf/include`. `make install` populates it; I just copied the vendored\nlibbpf and `bpf/lib` headers there.\nWhat comes out the far end is a statically-linked `shirudo` (15.7 MB) and `shirudo-build`.\n\nThe test VM boots on the `bpf-next` kernel with a software TPM, and all twelve in-guest preflight checks\n\npass (`cert_kernel_support`, `kernel_keyring`, `embedded_loader`, `tpm2_reachable: device:/dev/tpmrm0`).\n\nHere is `shirudo status` inside the guest:\n\n```\nStatus:                ok\nConditions:\n  LsmAttached        OK  lsm/bpf link present and pinned\n  KeyringSealed      OK  bpf serial 511726677, dm-verity serial 993023512, pins match\n  ChainIntact        OK  live register equals the eventlog replay\n  UpatchesMeasured   OK  every pinned or archived upatch is in this boot's records\n  TpmMeasured        OK  NV index 0x01818E00 readable\n  ConfigActive       OK  config 16496e550cee.. is active\n  XdpCovered         OK  every device an XDP upatch selects runs it\n\nTamper attempts (this boot):\n  LoadNotLoader   15  program load that is not a signed loader\n  MapCreate        1  map creation by another executable\n  BpfCommand       8  detach, update, delete or unclassified bpf() command\n```\n\nThe block to look at is \"Tamper attempts\". Shirudo governs `bpf()` itself. Only signed loaders may\n\ninstall BPF, and it counts and refuses every load that isn't one. That is why it can't coexist with\n\nTetragon or Falco: on an enforcing host, their loaders are what shows up in the `LoadNotLoader` count.\n\nNext I built, signed and pushed Shirudo's own app-sandbox shield, the one that sandboxes a php2shell-style\n\nApache compromise. It stops the process writing `.php` files, stops it spawning a shell, and stops egress\n\nto anything but loopback and private ranges.\n\n```\nwrote 0.upatch (insns=9408 ... maps=5 progs=12 name=app-sandbox)\nwrote 0.unload.upatch (insns=1320 ... name=app-sandbox UNLOAD)\nput-shields: pushed oci://127.0.0.1:15444/hardening/app-sandbox:1.0.0\n             sha256:cf83f2acf308eac6c1dc3f529c7d1ba946957f4bffd082fa8e633c5b0586cc11\n```\n\nTwelve BPF programs, five maps, and a post-quantum ML-DSA signature, pushed to the local OCI registry as\n\na signed package. Compile, sign, publish: all clean.\n\nMy first attempt at the full attack replay fell over, and not because of Shirudo. The demo fires about\n\nnine commands into the guest in quick succession, each on a fresh SSH connection, and the nested VM's\n\nuser-mode networking couldn't keep up. Connections started dropping at key exchange, and every guest step\n\nreported `SSH did not become ready`. The operator side (push, sign, tree append, release) succeeded the\n\nwhole time; it was purely connection churn into the guest. The fix was boring and complete: run all the\n\nguest steps over one persistent SSH `ControlMaster` connection instead of nine. If you end up poking at\n\nthe test harness yourself, note that `make vm-ssh` opens a new connection per call, which a scripted demo\n\nwill exhaust on a nested guest.\n\nWith that sorted, here is the actual result.\n\nFirst, the shield syncs to the target. The operator pushes the signed shield and appends it to the tree.\n\nOn the target, `shirudo bpm tree sync` pulls and applies it, no reboot:\n\n```\nshirudo-bpm-tree-sync.service: {\"applied\":1,\"skipped\":0,\"tpm_available\":true,\"last_seq\":3, ...}\nupatch load: app-sandbox loaded, 12 programs, keyring 680937881\nupatch load: app-sandbox measured, register b238874dbff3ae10...\nFinished shirudo-bpm-tree-sync.service.\n\n# shirudo-runtime upatch list\n  NAME          LOADED  TYPE  KIND  PAYLOAD\n  app-sandbox   yes     load  bpf   f415cb83331f263b..\n```\n\nNow the attack, with the shield loaded. `attack.php` stands in for a php2shell compromise:\n\n```\nwrite note.txt:               ok          <- benign write, allowed\nwrite shell.php:              refused      <- blocked: no writing executable .php\nrename note.txt note.php:     refused      <- blocked\nmkdir d.php:                  refused      <- blocked\nrun a command:                did not run  <- blocked: no shell spawn\nconnect 127.0.0.1 port 8443:  ok           <- loopback, allowed\nconnect 1.1.1.1 port 80:      errno 13     <- blocked: no egress to the internet (EACCES)\n```\n\nThe compromise is contained. It can't drop a web shell or reach the internet, and the shell it tries to\n\nspawn never runs. The ordinary request path is untouched.\n\nThen I release the shield. The operator deletes it from the tree and the target re-syncs:\n\n```\n# shirudo-runtime upatch list\n  none\n```\n\nSame attack, shield gone:\n\n```\nwrite shell.php:              ok\nrename note.txt note.php:     ok\nmkdir d.php:                  ok\nrun a command:                ran\nconnect 1.1.1.1 port 80:      ok\n```\n\nEverything the shield blocked now goes through. That is the whole pitch in one before-and-after: a signed,\n\nTPM-measured micropatch lands on a running service, shuts down an exploit class, and lifting it restores\n\nnormal behavior, with no restart on either side. On the kernel it asks for, it does what it says.\n\nShirudo is well-built, and its trust model is strict: signed, TPM-attested micropatches that an agent can\n\nauthor, on a kernel that refuses any BPF loader it can't verify. I got it running, enforcing, and doing\n\nthe full block-then-release cycle. For a homelab, or any fleet on stable distro kernels, my call is\n\nwatch, don't deploy:\n\nIf you want what Shirudo is reaching for today, holding a running service between a CVE landing and your\n\npatch window, Falco or Tetragon on a stock kernel will do it now, and Falco slots straight into an\n\nalerting pipeline you probably already have. I'd revisit Shirudo once it has tagged releases and a story\n\nfor distro kernels. I'll be watching the December deep-dive.\n\n*Built and tested in a throwaway KVM guest. The `shirudo` binary and the app-sandbox shield are real\nartifacts from that VM, and no production systems were touched. Patches, build recipe and demo script:\n[github.com/kaushik0x7d2/shirudo-from-source](https://github.com/kaushik0x7d2/shirudo-from-source).*", "url": "https://wpnews.pro/news/building-openai-cisco-s-shirudo-from-source-on-the-wrong-distro-on-purpose", "canonical_source": "https://dev.to/kaushikkachireddy/building-openai-ciscos-shirudo-from-source-on-the-wrong-distro-on-purpose-1g5b", "published_at": "2026-11-25 05:56:25+00:00", "updated_at": "2026-11-25 06:12:30.170737+00:00", "lang": "en", "topics": ["ai-safety", "ai-tools", "developer-tools", "ai-agents"], "entities": ["OpenAI", "Cisco", "Shirudo", "Codex", "Elasticsearch", "Debian", "LLVM", "OpenSSL"], "also_reported_by": [], "takeaway": "Shirudo's CLI fails with 'image state: Invalid argument' on kernels below 6.7 because identity_read() passes BPF_F_PATH_FD to bpf_obj_get_opts and only tolerates ENOENT, EPERM and EACCES, so a bpf-next kernel is mandatory.", "recommendation": {"advice": "Before adopting Shirudo, verify a bpf-next kernel, TPM 2.0, systemd 256+ and LLVM 23, and expect it to exclude Tetragon, Falco, Cilium and bpftrace on enforcing hosts.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/building-openai-cisco-s-shirudo-from-source-on-the-wrong-distro-on-purpose", "markdown": "https://wpnews.pro/news/building-openai-cisco-s-shirudo-from-source-on-the-wrong-distro-on-purpose.md", "text": "https://wpnews.pro/news/building-openai-cisco-s-shirudo-from-source-on-the-wrong-distro-on-purpose.txt", "jsonld": "https://wpnews.pro/news/building-openai-cisco-s-shirudo-from-source-on-the-wrong-distro-on-purpose.jsonld"}}