Dev.to Security 🔐 Cybersecurity 👁 0 📖 8 min read

Building OpenAI + Cisco's Shirudo from source (on the wrong distro, on purpose)

On November 23, 2026, OpenAI and Cisco released Shirudo (盾, "shield"), an open-source Linux runtime-security tool. It uses eBPF to drop temporary, signed "shields" (they call them upatches) onto a running service, blocki

On November 23, 2026, OpenAI and Cisco released Shirudo
(盾, "shield"), an open-source Linux runtime-security tool. It uses eBPF to drop temporary, signed
"shields" (they call them upatches) onto a running service, blocking an exploit without a reboot while
you test and roll out the real patch. In the launch demo, a shield written by OpenAI's Codex stopped a
live Java4Shell exploit against a running Elasticsearch instance, no restart needed.

I run a small homelab, and the announcements left my actual question unanswered: can I run this today,
and what does it cost to get there? So I built it from source and booted it in a VM. This is what I
found, including the point where the tool itself shows you why it isn't ready for your servers.

TL;DR

  • It works. I built it from source, booted a test VM on the bpf-next kernel it needs with a software TPM, and watched enforcement come up green and block unsigned BPF loads in real time.
  • The headline trick works end to end. I pushed a signed app-sandbox shield to a running target and it contained a php2shell-style attack: the web shell never got written, the shell never spawned, outbound traffic was refused, and normal requests kept working. I removed the shield, re-synced, and the same attack went straight through. No reboot either way.
  • You can't deploy it on a normal fleet yet. It wants a custom patched kernel with no fallback, a real TPM 2.0, and a toolchain newer than stable distros carry. It also takes over BPF loading, so it can't run next to Falco, Tetragon, or Cilium.
  • I built it on Debian 12, which it doesn't support, on purpose. It took about ten fixes. One of them is a single-line patch that happens to be the clearest demonstration of its kernel requirement.

Why a VM, and why the "wrong" distro

Before touching it I read the docs. Shirudo is blunt about what a production target needs: a bpf-next
kernel carrying its out-of-tree patches ("no compatibility mode and no fallback for an older kernel"), a
TPM 2.0 ("there is no mode without a TPM"), systemd 256 or newer, a dracut UKI boot, and LLVM 23. An
enforcing host only lets signed loaders install BPF, so it can't share a machine with Tetragon, Falco,
Cilium, or bpftrace. That isn't an early-days rough edge. It's a different operating model.

None of that was going to run on my boxes, which was the point. I wanted a throwaway VM to learn on, and
I picked a Debian 12 build host deliberately. If it compiles there, where make target-deps builds its
own OpenSSL, libcurl and tss2 from source, then the kernel is the one dependency I genuinely can't paper
over, and I'd hit every soft spot on the way. The test VM it boots runs a prebuilt bpf-next kernel the
project ships, so I didn't have to compile a kernel myself.

The build saga

Everything below ran on a 6-vCPU / 12 GB Debian 12 VM with nested KVM. The patches, the full recipe, and
the demo script are in the repo: kaushik0x7d2/shirudo-from-source.
In order:

  1. clang-23 with the BPF target. Debian 12 tops out well below clang 23. apt.llvm.org carries 23 for bookworm on its experimental channel, and llvm.sh 23 wants software-properties-common first.
  2. Purge console-setup. Its post-install hook fails on a headless VM and jams dpkg and apt until you remove it.
  3. autotools. tpm2-tss's bootstrap needs autoconf, automake, libtool and autoconf-archive, or you get autoreconf: not found.
  4. make target-deps. This builds OpenSSL 3.5.9, libcurl 8.18 and tpm2-tss 4.2 as static libs into build/target-deps/. Bookworm ships OpenSSL 3.0, which is too old; 3.5 is the first release with ML-DSA, and Shirudo's signatures need it.
  5. An OpenSSL 3.5 CLI. target-deps builds OpenSSL libs-only (no-apps), but the build probes run the openssl binary to check for ML-DSA. I built the CLI from the staged source, then had to patchelf --set-rpath it to its own 3.5 libs (it kept picking up the system 3.0 at runtime) and give it an openssl.cnf, since install_sw doesn't write one.
  6. CC=clang. The build uses -fstrict-flex-arrays=3. gcc-12 doesn't know the flag; clang-23 does.
  7. The static-link chain. Since the deps are static-only, the operator binary needs the transitive link set that non-static pkg-config leaves out: -lm -ldl for LuaJIT, the full --static chain for tss2, libcurl, libssl and libcrypto, and -ltss2-tcti-device for the nodl tctildr.
  8. The kernel wall, in one line. On the first run, every bpm, upatch and status command died with shirudo: image state: Invalid argument. The reason is worth sitting with. Shirudo's identity_read() calls bpf_obj_get_opts(..., BPF_F_PATH_FD), and BPF_F_PATH_FD only exists on kernel 6.7 and up. On my host's 6.1 kernel that syscall returns EINVAL for the unknown flag, and the startup check only tolerates ENOENT, EPERM and EACCES. One line to also treat EINVAL as "no identity, proceed as operator" gets you past it on an old host. That line is the entire kernel requirement in miniature. On a 6.7-or-patched kernel you never reach it.
  9. kvm group and a libguestfs flag. The test-VM image build needs you in the kvm group, and bookworm's virt-customize (1.48) predates --no-selinux-relabel, which is a no-op on the Ubuntu guest anyway, so I dropped it.
  10. BPF header path. shirudo build compiles upatches against headers at the baked /usr/local/share/shirudo/bpf/include. make install populates it; I just copied the vendored libbpf and bpf/lib headers there.

What comes out the far end is a statically-linked shirudo (15.7 MB) and shirudo-build.

It runs, and it enforces

The test VM boots on the bpf-next kernel with a software TPM, and all twelve in-guest preflight checks
pass (cert_kernel_support, kernel_keyring, embedded_loader, tpm2_reachable: device:/dev/tpmrm0).
Here is shirudo status inside the guest:

Status:                ok
Conditions:
  LsmAttached        OK  lsm/bpf link present and pinned
  KeyringSealed      OK  bpf serial 511726677, dm-verity serial 993023512, pins match
  ChainIntact        OK  live register equals the eventlog replay
  UpatchesMeasured   OK  every pinned or archived upatch is in this boot's records
  TpmMeasured        OK  NV index 0x01818E00 readable
  ConfigActive       OK  config 16496e550cee.. is active
  XdpCovered         OK  every device an XDP upatch selects runs it

Tamper attempts (this boot):
  LoadNotLoader   15  program load that is not a signed loader
  MapCreate        1  map creation by another executable
  BpfCommand       8  detach, update, delete or unclassified bpf() command

The block to look at is "Tamper attempts". Shirudo governs bpf() itself. Only signed loaders may
install BPF, and it counts and refuses every load that isn't one. That is why it can't coexist with
Tetragon or Falco: on an enforcing host, their loaders are what shows up in the LoadNotLoader count.

Building and pushing a shield

Next I built, signed and pushed Shirudo's own app-sandbox shield, the one that sandboxes a php2shell-style
Apache compromise. It stops the process writing .php files, stops it spawning a shell, and stops egress
to anything but loopback and private ranges.

wrote 0.upatch (insns=9408 ... maps=5 progs=12 name=app-sandbox)
wrote 0.unload.upatch (insns=1320 ... name=app-sandbox UNLOAD)
put-shields: pushed oci://127.0.0.1:15444/hardening/app-sandbox:1.0.0
             sha256:cf83f2acf308eac6c1dc3f529c7d1ba946957f4bffd082fa8e633c5b0586cc11

Twelve BPF programs, five maps, and a post-quantum ML-DSA signature, pushed to the local OCI registry as
a signed package. Compile, sign, publish: all clean.

The last mile: block the attack, then release it

My first attempt at the full attack replay fell over, and not because of Shirudo. The demo fires about
nine commands into the guest in quick succession, each on a fresh SSH connection, and the nested VM's
user-mode networking couldn't keep up. Connections started dropping at key exchange, and every guest step
reported SSH did not become ready. The operator side (push, sign, tree append, release) succeeded the
whole time; it was purely connection churn into the guest. The fix was boring and complete: run all the
guest steps over one persistent SSH ControlMaster connection instead of nine. If you end up poking at
the test harness yourself, note that make vm-ssh opens a new connection per call, which a scripted demo
will exhaust on a nested guest.

With that sorted, here is the actual result.

First, the shield syncs to the target. The operator pushes the signed shield and appends it to the tree.
On the target, shirudo bpm tree sync pulls and applies it, no reboot:

shirudo-bpm-tree-sync.service: {"applied":1,"skipped":0,"tpm_available":true,"last_seq":3, ...}
upatch load: app-sandbox loaded, 12 programs, keyring 680937881
upatch load: app-sandbox measured, register b238874dbff3ae10...
Finished shirudo-bpm-tree-sync.service.

# shirudo-runtime upatch list
  NAME          LOADED  TYPE  KIND  PAYLOAD
  app-sandbox   yes     load  bpf   f415cb83331f263b..

Now the attack, with the shield loaded. attack.php stands in for a php2shell compromise:

write note.txt:               ok          <- benign write, allowed
write shell.php:              refused      <- blocked: no writing executable .php
rename note.txt note.php:     refused      <- blocked
mkdir d.php:                  refused      <- blocked
run a command:                did not run  <- blocked: no shell spawn
connect 127.0.0.1 port 8443:  ok           <- loopback, allowed
connect 1.1.1.1 port 80:      errno 13     <- blocked: no egress to the internet (EACCES)

The compromise is contained. It can't drop a web shell or reach the internet, and the shell it tries to
spawn never runs. The ordinary request path is untouched.

Then I release the shield. The operator deletes it from the tree and the target re-syncs:

# shirudo-runtime upatch list
  none

Same attack, shield gone:

write shell.php:              ok
rename note.txt note.php:     ok
mkdir d.php:                  ok
run a command:                ran
connect 1.1.1.1 port 80:      ok

Everything the shield blocked now goes through. That is the whole pitch in one before-and-after: a signed,
TPM-measured micropatch lands on a running service, shuts down an exploit class, and lifting it restores
normal behavior, with no restart on either side. On the kernel it asks for, it does what it says.

Verdict

Shirudo is well-built, and its trust model is strict: signed, TPM-attested micropatches that an agent can
author, on a kernel that refuses any BPF loader it can't verify. I got it running, enforcing, and doing
the full block-then-release cycle. For a homelab, or any fleet on stable distro kernels, my call is
watch, don't deploy:

  • It won't run on a stock Debian, Ubuntu or Proxmox kernel. The EINVAL patch I used above wasn't me working around a bug. It was the tool correctly telling me my kernel is too old.
  • Every target needs a real TPM 2.0 and a toolchain newer than stable distros ship.
  • It takes over BPF loading, so it can't sit beside the Falco or Tetragon you already run.

If you want what Shirudo is reaching for today, holding a running service between a CVE landing and your
patch window, Falco or Tetragon on a stock kernel will do it now, and Falco slots straight into an
alerting pipeline you probably already have. I'd revisit Shirudo once it has tagged releases and a story
for distro kernels. I'll be watching the December deep-dive.

Built and tested in a throwaway KVM guest. The shirudo binary and the app-sandbox shield are real
artifacts from that VM, and no production systems were touched. Patches, build recipe and demo script:
github.com/kaushik0x7d2/shirudo-from-source.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.