Test coverage#
This page lists what the tests under testing/ cover, by family, by
area and by threat, and what no test covers. A test is named by its
number here, and by its file name without .sh in the family
tables. Run and write tests explains the families, the numbering
and how to run them. What the proofs cover, for every input within their
bounds rather than for the inputs a test picks, is on
Proof coverage.
Families#
Operator tests (t?0??) run on the build host. Target tests
(t?1??) run as root in a VM the family boots, against a target
initialized from the initrd with the dm-verity runtime image and a
signed config image.
ci-checks (0)#
Test |
Covers |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The prerelease tag, assets, and repository token, and rejection of missing source, mismatched source and a bundle with the wrong checksum |
build (1)#
Test |
Covers |
|---|---|
|
Helper resolution: |
|
Removed fleet-management commands are absent and rejected |
|
The target binary is a static PIE with OpenSSL 3.5 or newer and
no shared TLS closure, fits the default runtime image, and the
operator binary is dynamic. Runs only where |
|
Where |
|
rpm packages: metadata, file lists, requirements and scriptlets; the clang 23 requirement of both operator packages and the clang path of the Debian one |
|
Initrd generator and installer options, the installer’s
|
|
Test VM scripts: kernel artifact selection, host dependencies, arm64 boot settings, the bundle stamp, the build container, serve mode, node mode only for a core or edge node of the end-to-end tier, whose vTPM keys the builder helper creates before boot, the operator VM’s role and its signing key |
|
The upatch build compiles for BPF instruction set v4, and a
|
|
Script regex matching through |
|
VM-first service configuration and stable public trust across starts |
|
The bash completion: commands and subcommands from |
|
A message goes to standard error and to syslog, and to syslog
alone where standard error is the journal stream
|
signing (2)#
Test |
Covers |
|---|---|
|
ML-DSA-87 only, certificate key identifiers, |
|
The CMS form the kernel verifies, refusal of RSA and ML-DSA-65 keys, a one-bit change in the signed bytes, the signed bytes under a header that ends the loader elsewhere |
|
The trusted set and its digest, revoked certificates left out,
|
|
|
|
Signer identification for a revocation purge, prediction of a revoke event |
|
Two enrolled certificates, both keyrings as |
|
Live |
|
Live |
upatch (3)#
Test |
Covers |
|---|---|
|
Malformed |
|
Decoder metadata, Lua sandbox limits, refusal of bytecode, a decoder of a upatch named with 255 characters, one decoder per map |
|
Map type labels, arena maps only through a serializer |
|
Serializer metadata and the builder’s refusals |
|
Paged serializer JSON and |
|
|
|
|
|
kprobe override and |
|
netfilter attach metadata |
|
Attach kinds the builder refuses |
|
Names and the tree repository are refused rather than cut |
|
Signed XDP device-class masks, object inputs and invalid sections; two XDP programs of one upatch build with disjoint classes and are refused when they share one |
|
|
|
A jar signs into a Java load whose signature covers its data, and
an unload directive of it, by |
|
Prebuilt fixtures load and unload, foreign and own-keyring fixtures are refused, a map fixture exports |
|
Arena serializer pagination on a target |
|
|
|
An unload with the wrong payload refuses |
|
Load, the payload xattr on the pin, unload |
|
|
|
A live |
|
|
|
A loaded upatch labels executable and ordinary files, ORing multiple policy bits with a preexisting xattr; its signed policy section binds verdict programs to shared task and socket policy maps; a path with a pattern labels the regular files of its directory that match, also over a preexisting xattr, and neither a directory nor the target of a symbolic link that matches, nor a file that does not match |
|
A second load of a loaded upatch is refused as |
|
Native XDP class selection, veth pair deduplication with both
endpoint index orderings, cross-namespace pairs, a bridge without
native XDP skipped and listed under |
|
|
|
Live |
|
A Java load under a umask of |
|
The CVE-2026-31431 mitigation of |
|
The CVE-2026-31431 copy-failure detector of |
tpm (4)#
Test |
Covers |
|---|---|
|
Policy digests, names and attestation structures against values computed independently |
|
The initrd’s pending record and its adoption |
|
Register lifecycle before |
|
Config activation in the evidence and its verification. Runs in the register VM |
|
Salted HMAC and policy sessions, ECC and RSA credential
activation, rejected key pins, forged and replayed extension
replies, forged NV, PCR, clock and policy-digest readbacks, and
refusal of TPM logging overrides during bootstrap and enforcement.
An unsalted negative control accepts a forged acknowledgment
with an empty or SHA-256 response HMAC; malformed lengths are refused.
Salted sessions reject it and leave the real measured value unchanged.
|
|
The quotes of |
|
|
|
The production configuration: |
|
Replay, measured load and unload, evidence from the VM’s TPM, challenges with ECC and RSA endorsement keys |
|
The |
|
The keepalive quote under |
image (5)#
Test |
Covers |
|---|---|
|
Image builder and |
|
Settings a config may set, symbolic links and special files |
|
Signer set and revocation records in a config |
|
Local key and repository changes refused, |
|
Candidate removal and its |
|
Bootstrap settings in the initrd, ordered config verification keys, duplicate paths and too many keys |
|
Activation events, the pending latch across a resume and a TPM restart, interruption, locks, symbolic links in state |
|
Long lines and NUL bytes in settings files |
|
Staging without activation or measurement, selection on the next TPM reset and not after a resume or a restart, cancellation, stale parents, malformed records and process death while replacing a staged selection |
|
A new signer may be staged without live enrollment, activation or measurement; same-boot init leaves it staged and cancellation is idempotent |
|
The |
|
Config classification, corruption, live activation from A to B, refusal of a kernel-trusted config signer not named by the runtime |
|
Key and repository changes require a signed config |
|
Signed revocation unlinks the signer and purges its measured tracing and XDP upatches and their archives |
|
An interruption after measurement blocks changes and attestation |
tamperproof (6)#
Test |
Covers |
|---|---|
|
The creation helpers label what they create under a labeled directory |
|
The seal builds with either seccomp layout in |
|
Every tamper and integrity counter has a name and a meaning |
|
Status conditions: both keyrings, register, pins, config activation |
|
The embedded admission and seal objects include image enforcement |
|
Memory locking at startup, failing closed |
|
Output paths: no symbolic links, directories or devices; a failed write removes only the file written, where it was opened |
|
A host name that holds an escape sequence reaches the terminal of
|
|
Device, memory and config-root guards are pinned |
|
A foreign-signed upatch is refused |
|
An unsigned userspace |
|
A valid signature against a keyring of the caller’s is denied |
|
Unmount, lazy unmount, remount and mount over the bpffs |
|
Renames in the bpffs |
|
|
|
Counters move with refusals and root cannot reset them |
|
Map descriptors, pin reads and serializer test runs |
|
|
|
The seal against root, including policy xattr add, update and removal, root at a file system uid that cannot read the label, directly and through an idmapped mount, chattr and rmdir |
|
The |
|
Task authority on exec, fork and failed exec |
|
Output paths aimed at sealed state; |
|
Artifacts brought into the archive, a hidden state directory,
|
|
|
|
Edited attach metadata, name, map count and unload target |
|
Entries root brings into sealed directories |
|
|
|
Unmounts above the bpffs, by subtree and by propagation |
|
Directories, symbolic links and hard links in the bpffs |
|
A load whose archive copy fails is undone |
|
An unlabeled state root bound over the path |
|
An overlay over the state root |
|
A substituted TPM is refused by its session key name; a proxy forwarding the enrolled TPM cannot suppress an extension and make a signed load succeed without measurement |
|
|
|
Config read through a substituted |
|
The lock that keeps register and eventlog in step, the same in a mount namespace of root’s own |
|
The exact keyring check at |
|
Image mount flags, device-mapper table changes, mount changes |
|
|
|
A hidden bpffs cannot make shirudo fall back to host settings |
|
Labels at inode creation |
|
|
|
Descriptors through |
|
Secure-exec mode, no program interpreter, and the library variables a target refuses |
|
A traced task cannot exec shirudo |
|
A mutated loader, the payload binding, links by pin or id |
|
Repeated peeks and concurrent drains |
|
Status reports both keyrings with each certificate’s frozen key |
|
Task policy accumulates across parent exec, child exec and interpreter handlers |
|
Task policy is inherited by a listener and its accepted socket |
|
A load stopped before its extend is counted, reported by status and undone by the next upatch load or unload |
|
The archive directory with its mark evicted takes nothing and lets no labeled archive out; an archive without a record of its load is reported, not restored by init and removed by the next upatch command |
|
An exec of the runtime that fails after its mark is committed
dumps core without authority: the dump cannot unlink a pin or
replace a sealed file, and |
|
A uprobe set through tracefs on the runtime binary leaves the
commands it reaches without authority, counted as
|
|
A load in a namespace with a |
|
A load and an unload stage nothing in sealed state, and the archive holds the bytes the load read |
|
A directory of the config image bound in place of its mount, in a
namespace with a |
|
The directories above the state root carry the ancestor mark; a rename of one and the removal of the mark are refused and counted, and a directory beside the state root still renames |
|
Started under |
|
The exec of the runtime binary by a task that shares its
|
|
The |
|
A module without its signature, a PCI config write,
|
|
From a namespace without |
|
A command writes past the file size limit it was started with,
outlives an interval timer set before its exec, and refuses
another task’s |
|
The test kernel, which signs its modules, passes the pre-flight check of module signatures |
bpm (7)#
Test |
Covers |
|---|---|
|
Subcommands, reference validation before network access, source and tree configuration lines |
|
READMEs of local and OCI packages, archive integrity, a download
kept in a memory file rather than in |
|
|
|
The repository update unit and timer and their package scriptlets, as text |
|
|
|
Beefile policy declarations are serialized into the signed
upatch section, a path with a pattern as it is written;
|
|
|
|
|
|
|
|
A registry that trickles a package fast enough for the low-speed limit is cut off at the transfer’s total deadline |
|
|
|
The token a registry’s realm returns goes with the next request,
the answer’s own member and not one a string or a nested object
names, and a realm that answers with an empty body, or with a NUL
ahead of or behind a token, fails the pull before any request
carries a token, with registry credentials set as without; a
challenge whose scheme only starts with |
|
Tree sync with a selector |
|
Re-sync and the next generation |
|
A delete operation and adding the upatch back |
|
A kconfig selector the target cannot read stops the sync where it is; the operation applies once the config reads |
|
An add whose upatch is already loaded with its payload counts as installed; a direct load of it is still refused |
|
The outcomes record: a line for an applied, an unmatched and a
module-absent operation, one line for each |
|
A publication whose operations carry |
|
In |
|
|
|
In |
|
The signed layers of a publication served under a manifest that
is not the one |
|
A Java upatch through the tree: an |
|
In |
|
A dry run of |
otel (8)#
Test |
Covers |
|---|---|
|
OTLP mapping, retries, S3 uploads, tenant IDs, the insecure override |
|
Map export settings |
|
Exporter units and timers and their package scriptlets, as text |
|
|
|
TLS 1.3 with |
|
OTLP environment variables, headers and limits |
|
Every digest, root, set hash, mask and tree key of the keepalive fixtures recomputes from their example tree |
|
|
|
The map-export service and timer with decoders |
|
Serializer metrics, peek and drain |
|
Precedence of config, environment and command line, a failed export |
|
CA and client certificate selection, the S3 CA |
|
|
end2end (9)#
Test |
Covers |
|---|---|
|
The DNS packet builders the matrix test uses |
|
|
|
Socket families and matching OTLP and ClickHouse snapshots |
|
Privilege and executable-mapping records in maps, OTLP and ClickHouse |
|
DNS over loopback in maps, OTLP and ClickHouse, and a label’s NUL,
dot or byte outside printable ASCII recorded as |
|
The operator package built and installed in an operator VM
without a TPM, which publishes |
|
A signed SHPL section labels five executables; its BPF policy allows unlabeled tasks to exec unlabeled files and 0x1, allows 0x1 to exec 0x2, and denies 0x1 and socket policy B from execing unlabeled files; socket-storage bits allow 127.0.0.1 for policy A and deny it for B; final evidence includes the loaded policy upatch |
|
The backend of |
|
The whole keepalive pipeline on a fresh edge node and node B, run
by |
|
The backend’s history of each node over a tree of segments, run by
|
|
A backward walk on real data, run by |
|
Enrollment through credential activation on a real vTPM, run by
|
|
A shield rolled out and taken back, run by |
|
The |
Quickstart and quick guides#
.github/scripts/check-guides.py runs the Linux quickstart and
quick guides against one interactive VM. It checks that the target is
ready, denies the documented operations, and loads and unloads a signed
upatch. It checks that the TPM answers a credential challenge and that
the evidence matches the predicted register. The remaining guides check
an upatch’s map counter and install and remove a package through a local
OCI registry. The macOS workflow checks the Lima template with
limactl validate.
Unit suites and fuzz targets#
The unit suites in testing/unit/ cover 42 of the modules in
util/: attest, bpm_oci, bpm_package, bpm_state,
bpm_tree, bpm_tree_overlap, bpm_tree_state, chain,
chain_history, conditions, config_update, crypto_openssl,
curl, eventlog, format, hex, identity, io,
java_agent, json, kconfig, kernel_abi,
keepalive, keepalive_quote, kernel_build_id,
kernel_prereq, kernel_release, keys, log, measured,
options,
paths, report, string, sysinfo, timefmt, upatch,
upatch_decode, upatch_pins, upatch_resolve, upatch_verify
and xdp, and
overflow the arithmetic of
include/shirudo/overflow.h. jar covers the
shirudo-build checks of a Java agent’s jar in
tools/shirudo-build/jar.c: stored and deflated manifests, a
missing or empty Premain-Class, one outside the main section, and
every truncation and byte flip of a jar. quote_check covers the rows of
shirudo-quote-check in tools/quote-check/row.c, on quotes a
software P-256 key signs: every reject reason, the signer’s qualified
name, the empty PCR selection and the base64 of each field. The other
modules are reached through the test helpers, the fuzz targets and the binaries
the functional tests run.
Fuzz target |
Input |
|---|---|
|
Evidence as |
|
The report |
|
A Beefile |
|
A repository index |
|
A |
|
A |
|
The Beefile inside a package archive |
|
Certificates and detached CMS signatures |
|
|
|
The config activation history in the target’s state |
|
Map data a Lua decoder reads |
|
The build ID of a uprobe target binary |
|
The eventlog and its replay |
|
Runtime image bootstrap settings and a config image’s verity superblock |
|
The JSON parser |
|
A kernel configuration and |
|
The kernel’s ELF notes |
|
Registry and token server responses |
|
An OCI manifest |
|
|
|
OTLP collector responses and |
|
A load upatch’s program metadata |
|
A row of |
|
The container auth file |
|
The |
|
Serializer output pages |
|
TPM structures in evidence |
|
A upatch tree publication |
|
The tree’s |
|
A |
|
A |
attest-report, bpm-info and upatch-info hold what their
command prints from a file it has not verified to what
text_sanitize() leaves for a terminal, UTF-8 with no control
character but a tab, a line feed and a carriage return before a line
feed, and its JSON to one document util/json.c reads.
Backend tests#
The SQL tests of tools/backend/test/ cover the backend’s schema
against a ClickHouse container (Run the backend tests): the quote
check of every record and the reasons a record is refused, a key’s
trust from untrusted to enrolled, each status check and the
history it reads, node_vulns and its inputs, the
retention script and the views that keep boot baselines, the tree
ingest job on a single publication and on a walk over sealed segments,
the SBOM scan job on a store that holds an image in every state, the
SBOM put job into a file:// and an s3:// store, again and with
another SBOM, and what it refuses (test/sbom-put), the label put job
and the labels each node reads from it (test/labels-put), the
enroll put job, a key bound once and what it refuses
(test/enroll-put), the helper that allows builds
(test/put-shirudo-build), the shield put job, a second version of
a shield and what it refuses (test/shields-put), and the queries
of tools/xtop/sql/, with the names and types of their columns,
over nodes healthy, unhealthy, stale and without a tree or an image, a
tree with one upatch deployed and one still rolling out, the shields
available to append beside those trees, and the findings and images of
their SBOMs (test/xtop-nodes, test/xtop-shields,
test/shields-put, test/xtop-sbom).
The unit tests of tools/xtop/test/ cover how xtop turns the rows
of those queries into nodes, shields, findings and images, the health
percent, the roll-up by image, the status and severity of a shield, the
status of a finding, the commands that create a tree, the search of its
tables and its ClickHouse client;
make -C tools/xtop tests type-checks the
program and runs them (Run the xtop tests).
Coverage by area#
Area |
Tests |
|---|---|
Signed loading |
|
Admission |
|
BPF command policy |
|
Maps, links and serializers |
|
Load and unload |
|
Attach kinds |
Offline metadata: |
bpffs pins and mounts |
|
Seal |
|
Task authority |
|
Keyrings |
|
Signing keys and the trusted set |
|
TPM register |
|
Attestation |
|
Eventlog |
|
Boot and initrd |
|
Config images |
|
Packages and repositories |
|
upatch tree |
|
Policy labels |
upatch labels and Beefile serialization: |
Telemetry |
|
Decoders |
|
Tamper counters |
|
CLI |
|
Build and packaging |
|
CI scripts |
|
Parsers |
|
Coverage by threat#
The threats are those of Threat model.
Threat |
Tests |
|---|---|
T1 Loading unsigned BPF |
|
T2 Detaching or replacing enforcement |
|
T3 Tampering with shirudo’s files and process |
|
T4 Substituting artifacts |
|
T5 Silent state change |
|
T6 The boot window |
|
T7 The delivery path |
|
T8 Quantum-capable adversaries |
|
T9 A target lying about its state |
|
T10 An attempt that leaves no trace |
|
T11 Image-mode config and executable substitution |
|
T12 Interrupted image activation |
|
Coverage of tamper counters#
t6003 checks that every counter has a name and a meaning, and
t6108 that status --json reports the counters as numbers. These
tests assert that a refusal moves its counter:
Counter |
Test |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Coverage of integrity counters#
t6003 checks that every integrity counter has a name and a meaning.
t6154 asserts that a refusal moves ModuleSignature, Kcore
and PciAccess, the last two where the kernel has them, and that
status, its JSON and the keepalive report the counters. No test
moves the others. The test guest boots without UEFI firmware, so it has
no efivarfs for HibernateLocation, and KexecSignature cannot
move while the Kexec guard refuses every kexec image first.
Not covered#
These are verified absences: no test under testing/ exercises them.
Attacks#
Most of these attacks are open threats in Threat model:
attest verifyrun without--ak-nameor without any expectation of the state.An environment that steers an authorized shirudo process, such as
BPM_OCI_SCHEME,BPM_OCI_CA_FILE, proxy variables,SSLKEYLOGFILE.t6136covers the dynamic loader’s variables only.A repository index or tree publication signed with a classical algorithm.
Removing an empty sealed directory,
chattron sealed files, POSIX ACLs on them, and a hard link of a labeled inode into an unsealed directory.t6118covers hard links into sealed directories only.An eventlog larger than the size the readers accept.
Making
initread another boot ID, or miss this boot’s init record by other means than the unlabeled state directoryt6115covers, so that it binds the register again.A target whose kernel runs the lockdown LSM, in integrity or in confidentiality mode. The test kernel enables no lockdown, so
t6154covers whatbpf2refuses on its own.A failure of
shirudo-initrd.servicethat lets the boot continue without enforcement, and a firstinitoutside the initrd.Another LSM denying the read of a seal label. The test kernel runs with
CONFIG_LSM="bpf"alone.bpm config update --base-packagerunning commands from a package fetched from a registry.A boot restore that fails part way, among them one that finds a device another XDP program holds: only a reboot runs the restore.
t3111covers the load, which attaches through the same code.Loading an older artifact signed by the same key, and an unload directive signed by another trusted key than the load.
Stopping a running shirudo with
SIGSTOP,mount_setattr(2), hibernation and/dev/snapshot,/dev/mem, and TPM access overi2c-devorspidev.A write of the
HibernateLocationEFI variable: the test guest boots without UEFI firmware and has no efivarfs.
Tests that assert behavior the threat model lists as a threat to resolve. They change when that threat is resolved:
t2003andt5003assert that a revoked signer’s earlier vouches stay valid.t7003adds a certificate from an OCI reference without a fingerprint to compare it with.
Commands and procedures#
bpm repo update,bpm install,bpm upgradeandbpm uninstallagainst a repository on a target.t7004reads the unit files,t7001checks argument validation and thebpm-indexfuzz target the index parser.bpm config update.upatch loadorupatch unloadrefusingtamperedfor a stale--expect-chain. Onlyattest verifyis tested with that option.status --show-full, and--include-eventlogon a target:t4007reads a log on the host.upatch rewrite-rodatainshirudo-build, whichkernel-obsuses to rewrite its watch lists.The
kernel-cvepackages, andtools/put-shields, which builds and pushes them. A copy of an earlier Beefile of them is a seed of thebeefilefuzz target.The recovery, upgrade and decommissioning procedures of Back up, recover and decommission a target and Upgrade shirudo and the kernel.
Exit statuses.
t8001,t4003andt4102check a few, but no test checks the exit status of every command. No test names the failure categoriesalready_unloaded,attach_target_missing,detach_failed,eventlog_full,kernel_abi_unsupported,lsm_denied,signature_unsupportedorverifier_rejected.Completion against the parsers.
completion/shirudo.bashkeeps its option lists by hand, and no test compares them with the options the commands accept.
Units and boot#
The units on the root file system as installed. The test VM replaces the
ExecStartof each of them with the runtime command before the tests run, so no test runs one as installed.shirudo.service,shirudo-keepalive.serviceandshirudo-bpm-repo-update.serviceare never started.t8102,t8103,t8104andt9105start the map-export and tree-sync services with the replaced command.shirudo-initrd.serviceruns from its template in the initrd of every target VM.A reboot. No test reboots a guest. Restore at boot and the completion of a pending activation run as repeated
initruns and through helpers (t5007), andt4003resets a simulated TPM.
Tamper counters#
No test asserts that a refusal moves LoadUnsigned,
LoadUnverified, LoadKeyringKind, LoadKeyring, MapCreate,
MapWrite, MapFdWrite, ProgRun, ExeIdentity,
KeyringWrite, PinXattr, BpffsMount, SealWrite,
SealUnlink, SealRename, SealSetattr, SealXattr,
SealLabel, SealPerf or TpmExtend. The refusals behind
several of them are tested, the counter is not.
Attach kinds#
fexit,tp_btfandkretprobehave no test, offline or on a target.fmod_retand kprobe override are checked offline only (t3008).kprobe loads run only on a kernel with a kprobe PMU. The test kernel has none, so
t6116leaves out its kprobe case.
Platforms#
Real TPMs. Every TPM test uses
swtpmin the VM or the libtpms simulator helper.Architectures. CI builds and runs the unit tests on arm64 and on riscv64, under QEMU user emulation, with the BPF objects built from the BTF of the x86-64 bpf-next kernel. The CI suite also runs unit,
ci-checksand host functional tests on arm64 withVM=0. Target VM tests, end-to-end tests and fuzzing run on x86-64 only. The test VM boots arm64 too, andt1007checks its arm64 settings without booting. riscv64 has no test VM.Kernels. CI boots bpf-next only.
KERNEL=boots a release kernel by hand.
Parsers and units#
The dm-verity superblock check in
util/config_image.chas no fuzz target.t5001covers truncation and unsupported fields.37 of the 76 modules in
util/have no unit suite of their own.