Security model#
shirudo restricts the bpf() system call so that only loaders signed
with the operator’s key install BPF code, root included. Every change to
the set of loaded upatches is measured in the TPM, and an operator
checks that measurement with evidence the TPM signs. This page is the short
version of the Threat model, which states each mechanism, its
limits and the gaps not closed yet.
What shirudo provides#
Goal |
Mechanism |
Limit |
Threat model |
|---|---|---|---|
Only signed BPF enters the kernel |
|
Any artifact the key ever signed loads. In-kernel BPF users and classic BPF are outside the gate. |
T1, R16, R18 |
Enforcement stays attached |
Detach, update and foreign attach commands are refused; pins, descriptors and the private bpffs mount are guarded. |
The pins depend on the mount tree; a stopped runtime command keeps its descriptors. |
T2, R3, U17 |
Only shirudo changes its state |
The seal labels |
Offline writes bypass it. |
T3, R19 |
Every change is measured |
Loads, unloads, revocations and tree operations extend a TPM NV
register whose writes |
Initial session-key enrollment trusts the initrd; the config PCR is not guarded. |
T5, R4, U9 |
A verifier can tell |
|
Only the TPM-signed parts are evidence, and only with the verifier pinning the key, the binding and the expected state. |
T9, U1 |
Attempts leave a trace |
Guards count their refusals in a frozen map that |
Some refusals move no counter; telemetry is the target’s own account. |
T10, R17 |
Delivered content is authentic |
Indexes, tree publications and configs are signed; the kernel verifies loaders and config roots. |
A registry can withhold and replay signed content. |
Main adversary#
The adversary shirudo is built against is root on the target without the signing key: a compromised administrator account, a container escape, a persistence implant. Capabilities do not stop it, so shirudo does not rest on capabilities. A task gains authority only by a successful exec of a file on the dm-verity runtime image, and the guards let only such tasks through. Root can still run the runtime binary, so the command interface is the boundary: root can make shirudo do anything a shirudo command does, and every such change to the loaded set is measured.
The other adversaries are unprivileged code, root with mount-namespace and device control, the network and the registries, a malicious collector, and the holder of a compromised signing key. The adversaries section says what each can do.
What shirudo assumes#
The properties above hold only on a deployment that provides the assumptions. In brief:
A trusted kernel with the BPF LSM, the signed-loader ABI and the kernel project patches
Module signatures, no 32-bit compatibility, no resume device in the UKI and no writes under mounted file systems
Secure Boot with a signed, measured UKI and an authenticated kernel command line
Config signing keys chosen by the authenticated runtime image
A TPM 2.0 reachable only through the kernel driver
A runtime image without generic tools
An operator host that keeps the signing key safe
shirudo checks only some of these. The pre-flight of shirudo init
checks that the BPF LSM is active, that the kernel has the
signed-loader ABI and that it checks module signatures. The target
checks a config’s signature against the runtime image’s keys itself. It
does not check the rest of the kernel configuration or the boot chain
(U10).
What you must do#
The deployer and the verifier each have a part that no code does for them. The duties section lists it in full. The essentials:
Build and boot the kernel as Hardening checklist describes.
Start every shirudo unit from the runtime image, and keep the units’ environment files empty.
Verify each target with
shirudo attest verifyand always pass--ak-name, the binding PCRs, an expected state and the expected config root, as Attest targets describes.Treat
shirudo status, keepalives and tamper counters as the target’s own account, and atamperedstatus as an incident (Respond to a tampered target).