User-defined Playground

shirudo Lab: signed BPF, TPM-measured Playground

Hands-on lab for shirudo, a BPF-based security platform: sign and load upatches, watch tampering get refused, verify the target with its TPM.

shirudo Lab: signed BPF, TPM-measured playground: Hands-on lab for shirudo, a BPF-based security platform: sign and load upatches, watch tampering get refused, verify the target with its TPM.
Machines & network
1 VM · 4 vCPU · 10GiB RAM
Playground host Internet NAT MASQUERADE local (bridge) 172.16.0.0/24 gw 172.16.0.1/24eth0
VM
vCPU ·
eth0
/
ubuntu-26-04
About

shirudo lab

shirudo is a BPF-based security platform: targets run only the BPF their operator signed, every change is measured into the TPM, and functionality ships as signed upatches.

This machine is the operator. The target is a test VM (bpf-next kernel, BPF LSM, software TPM) that runs inside it under QEMU.

iximiuz playgrounds have no /dev/kvm, so the target runs under QEMU TCG (software emulation). Expect the first shirudo-lab target to take a while.

0. Prepare (once per playground)

shirudo-lab setup     # packages + clang/LLVM 23
shirudo-lab build     # test kernel, shirudo, shirudo-build
shirudo-lab target    # boot the protected target ("VM ready")
shirudo-lab shell     # operator shell: shirudo on PATH, $KEYS set

Run target commands with shirudo-lab ssh (interactive) or shirudo-lab run '<cmd>'.

1. The protected target

shirudo-lab run '/usr/local/bin/shirudo status'   # copy of the binary: Permission denied
shirudo-lab run 'shirudo status'                  # trusted runtime binary: Status: ok
shirudo-lab run 'cat /run/shirudo/bpffs/tamper'   # root without runtime authority: denied
shirudo-lab run "shirudo status | sed -n '/^Tamper attempts/,/^$/p'"   # ObjGet counted

2. Life of a upatch (in shirudo-lab shell)

shirudo build testing/fixtures/basic.bpf.c --keys-dir "$KEYS" --vmlinux vendor/linux/vmlinux.h -o basic.upatch
PAYLOAD=$(shirudo upatch info --json basic.upatch | jq -r .payload_sha256)
shirudo build --unload basic --payload-sha256 "$PAYLOAD" --keys-dir "$KEYS" -o basic.unload.upatch
shirudo-lab run 'shirudo upatch load basic.upatch'      # signature checked, load measured
shirudo-lab run 'shirudo upatch list'
shirudo-lab run 'shirudo upatch unload basic.unload.upatch'

3. Attacker's view

shirudo genkey --keys-dir build/lab/attacker-keys
shirudo build testing/fixtures/basic.bpf.c --keys-dir build/lab/attacker-keys --vmlinux vendor/linux/vmlinux.h --name evil -o build/lab/evil.upatch
shirudo-lab run 'shirudo upatch load /workspace/shirudo/build/lab/evil.upatch'   # refused: key not in .bpf keyring
cp basic.upatch build/lab/tampered.upatch
python3 -c "import sys;p=sys.argv[1];b=bytearray(open(p,'rb').read());b[-16]^=255;open(p,'wb').write(b)" build/lab/tampered.upatch
shirudo-lab run 'shirudo upatch load /workspace/shirudo/build/lab/tampered.upatch' # refused: signature broken

4. Verify with the TPM

NONCE=$(openssl rand -hex 32)
shirudo-lab run "shirudo attest --nonce=$NONCE --output=/mnt/shirudo-out/ev.json"
EV=build/test-vm/vms/quickstart/result/ev.json
OWN=build/test-vm/host-bundle-bpf-next-verity/fixtures/own.der
shirudo attest verify --evidence="$EV" --nonce="$NONCE" --ak-name="$(jq -r .ak.name "$EV")" \
  --cert="$KEYS/cert.der" --cert="$OWN" --allow-runtime-events     # verdict: ok

More: Quickstart · Quick guides

Every playground includes
Learn more about playgrounds
Start
Settings