<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kaushik Kachireddy</title>
    <description>The latest articles on DEV Community by Kaushik Kachireddy (@kaushikkachireddy).</description>
    <link>https://dev.to/kaushikkachireddy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4263859%2F172dd6da-acd5-4c53-8c92-c840c553c57e.jpg</url>
      <title>DEV Community: Kaushik Kachireddy</title>
      <link>https://dev.to/kaushikkachireddy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kaushikkachireddy"/>
    <language>en</language>
    <item>
      <title>Building OpenAI + Cisco's Shirudo from source (on the wrong distro, on purpose)</title>
      <dc:creator>Kaushik Kachireddy</dc:creator>
      <pubDate>Wed, 25 Nov 2026 05:56:25 +0000</pubDate>
      <link>https://dev.to/kaushikkachireddy/building-openai-ciscos-shirudo-from-source-on-the-wrong-distro-on-purpose-1g5b</link>
      <guid>https://dev.to/kaushikkachireddy/building-openai-ciscos-shirudo-from-source-on-the-wrong-distro-on-purpose-1g5b</guid>
      <description>&lt;p&gt;On November 23, 2026, OpenAI and Cisco released &lt;a href="https://github.com/shirudo-dev/shirudo" rel="noopener noreferrer"&gt;Shirudo&lt;/a&gt;&lt;br&gt;
(盾, "shield"), an open-source Linux runtime-security tool. It uses eBPF to drop temporary, signed&lt;br&gt;
"shields" (they call them upatches) onto a running service, blocking an exploit without a reboot while&lt;br&gt;
you test and roll out the real patch. In the launch demo, a shield written by OpenAI's Codex stopped a&lt;br&gt;
live Java4Shell exploit against a running Elasticsearch instance, no restart needed.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;It works. I built it from source, booted a test VM on the &lt;code&gt;bpf-next&lt;/code&gt; kernel it needs with a software
TPM, and watched enforcement come up green and block unsigned BPF loads in real time.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Why a VM, and why the "wrong" distro
&lt;/h2&gt;

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

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

&lt;p&gt;Everything below ran on a 6-vCPU / 12 GB Debian 12 VM with nested KVM. The patches, the full recipe, and&lt;br&gt;
the demo script are in the repo: &lt;a href="https://github.com/kaushik0x7d2/shirudo-from-source" rel="noopener noreferrer"&gt;kaushik0x7d2/shirudo-from-source&lt;/a&gt;.&lt;br&gt;
In order:&lt;/p&gt;

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

&lt;p&gt;What comes out the far end is a statically-linked &lt;code&gt;shirudo&lt;/code&gt; (15.7 MB) and &lt;code&gt;shirudo-build&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  It runs, and it enforces
&lt;/h2&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Twelve BPF programs, five maps, and a post-quantum ML-DSA signature, pushed to the local OCI registry as&lt;br&gt;
a signed package. Compile, sign, publish: all clean.&lt;/p&gt;
&lt;h2&gt;
  
  
  The last mile: block the attack, then release it
&lt;/h2&gt;

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

&lt;p&gt;With that sorted, here is the actual result.&lt;/p&gt;

&lt;p&gt;First, the shield syncs to the target. The operator pushes the signed shield and appends it to the tree.&lt;br&gt;
On the target, &lt;code&gt;shirudo bpm tree sync&lt;/code&gt; pulls and applies it, no reboot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;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..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the attack, with the shield loaded. &lt;code&gt;attack.php&lt;/code&gt; stands in for a php2shell compromise:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;write note.txt:               ok          &amp;lt;- benign write, allowed
write shell.php:              refused      &amp;lt;- blocked: no writing executable .php
rename note.txt note.php:     refused      &amp;lt;- blocked
mkdir d.php:                  refused      &amp;lt;- blocked
run a command:                did not run  &amp;lt;- blocked: no shell spawn
connect 127.0.0.1 port 8443:  ok           &amp;lt;- loopback, allowed
connect 1.1.1.1 port 80:      errno 13     &amp;lt;- blocked: no egress to the internet (EACCES)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Then I release the shield. The operator deletes it from the tree and the target re-syncs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# shirudo-runtime upatch list
  none
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same attack, shield gone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;h2&gt;
  
  
  Verdict
&lt;/h2&gt;

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

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

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

&lt;p&gt;&lt;em&gt;Built and tested in a throwaway KVM guest. The &lt;code&gt;shirudo&lt;/code&gt; binary and the app-sandbox shield are real&lt;br&gt;
artifacts from that VM, and no production systems were touched. Patches, build recipe and demo script:&lt;br&gt;
&lt;a href="https://github.com/kaushik0x7d2/shirudo-from-source" rel="noopener noreferrer"&gt;github.com/kaushik0x7d2/shirudo-from-source&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ebpf</category>
      <category>linux</category>
      <category>security</category>
      <category>openai</category>
    </item>
  </channel>
</rss>
