Files, paths and xattrs#
The files, directories, pins and extended attributes shirudo reads and
writes. In the Protection columns, “seal” means the inode carries the
security.bpf.shirudo label (see Seal labels and task marks), “dm-verity”
means a read-only mount of a verified image and “bpffs” means the
guards of the private bpffs.
Operator host#
Path |
Written by |
Mode |
Purpose |
|---|---|---|---|
|
|
|
Default keys directory. |
|
|
|
ML-DSA-87 private key, PEM. |
|
|
|
Self-signed X.509 certificate of the signing key, DER. |
|
|
|
Transient during a key replacement. |
|
none |
none |
Read by |
|
none |
none |
Searched in this order when |
|
none |
none |
The compiler |
|
operator package, |
|
Checks keepalive quotes for a telemetry backend. A static PIE. It reads standard input alone and writes no file. See shirudo-quote-check. |
|
|
none |
Temporary object, removed after packaging. |
|
|
|
Staging directory of a package build ( |
|
administrator |
none |
Operator settings, such as |
Output files the caller names: .upatch artifacts and .vouch
files with mode 0644, .bee packages with mode 0600.
Target persistent state#
Everything under /var/lib/shirudo on the state file system is
sealed. The first init labels every regular file and directory there.
From then on shirudo labels what it creates, and ignores an entry without
the label as foreign. In the initrd, init binds
/sysroot/var/lib/shirudo writable over /var/lib/shirudo.
Path |
Written by |
Mode |
Purpose |
|---|---|---|---|
|
|
|
State root. |
|
installer, |
none |
Checked by the |
|
|
|
A certificate installed without a config image. |
|
|
none |
Trusted and revoked sets read when no config image is mounted.
|
|
|
|
Archive of every loaded upatch, restored by |
|
measuring commands |
|
Append-only eventlog, one JSON record per line. See Eventlog events. |
|
|
|
Lock of |
|
|
|
Installed packages. |
|
|
|
Cached, verified package index of a repository. |
|
|
|
Package download before it is verified and extracted. |
|
|
none |
Extracted package: |
|
|
|
The installed package archive. |
|
|
|
Tree cursor: tree id, last sequence number and projection root, and the generation, manifest digest and head of the publication the target last accepted. |
|
|
|
Append-only record of applied tree operations. |
|
|
|
One line for every tree operation the target processed, applied or not, with its outcome and the roots after it. Never pruned. |
|
|
|
The operation in progress, removed when it completes or when the next sync finds it at or below the cursor. |
|
|
|
Fetched artifacts, named by their OCI layer digest. |
|
|
|
|
|
|
|
Config activation record and its event history. |
|
|
|
Candidate config for the next TPM boot and its parent activation sequence and boot counts. Removed on cancellation, successful boot initialization or a live update to a different root. |
|
|
|
Fetched config images, named by their dm-verity root hash. |
|
|
none |
Staging directory of a fetch. |
The paths in the table are relative to /var/lib/shirudo/.
Target per-boot state#
init creates /run/shirudo with mode 0700. When it lies on the
same file system as /run, init mounts a private tmpfs there
(nosuid, nodev, noexec, 16 MiB) and labels it. systemd
carries /run from the initrd into the root file system.
Path |
Written by |
Protection |
Purpose |
|---|---|---|---|
|
|
seal, |
The initrd’s eventlog record. The next append on the root file
system adopts it into |
|
|
bpffs |
Private bpffs ( |
|
|
dm-verity |
The runtime image, mounted read-only, |
|
|
dm-verity |
The active config image, mounted read-only, |
|
|
dm-verity |
A config image being activated. Its mapping is
|
|
|
seal, |
The agent jar of a loaded Java upatch, readable by every JVM.
|
|
|
none, |
A |
Runtime image#
shirudo-gen-runtime lays out the runtime image. Paths are relative
to /run/shirudo/runtime/.
Path |
Content |
|---|---|
|
The runtime binary. |
|
Binaries added with |
|
Runtime settings. |
|
First config verification certificate. Additional
|
|
The initial BPF signing certificate. |
Library paths |
The interpreter and shared libraries of a dynamically linked binary. |
Config image#
Paths are relative to /run/shirudo/config/. On a target with a
config image, shirudo reads these instead of the host files of the same
name under /etc/shirudo.
Path |
Content |
|---|---|
|
Settings the config image may carry. |
|
Package repositories. |
|
Repository certificates. |
|
upatch tree source. |
|
Labels that tree selectors match. |
|
Vouched BPF signing certificates. |
|
Revoked certificates. |
See Configuration for the keys of each file.
Private bpffs pins#
Every pin lives under /run/shirudo/bpffs/. The lsm/inode_unlink
guard refuses removing a pin (counter PinUnlink) and the mount guards
refuse unmounting or covering the bpffs (BpffsUmount). A task without
runtime authority cannot open a pin that is not a directory, by path or
by BPF_OBJ_GET (ObjGet). Directories stay listable.
Pin |
Content |
|---|---|
|
Link of |
|
Links of the other admission and gate hooks. |
|
Links of the mount and bpffs guards. |
|
Links of the exec identity, directory entry and kexec guards. |
|
Links of the ioctl guard and the dm-verity device recorders. |
|
Links of the seal hooks, one per hook, such as
|
|
Map |
|
Map |
|
Map |
|
Task storage maps of runtime authority and expected config roots. |
|
Maps |
|
Map of the dm-verity devices shirudo set up, with their root hashes. |
Pins of a upatch#
Each loaded upatch has a directory upatches/<bpffs-name>/ in the
private bpffs. <bpffs-name> is the upatch name with every .
written as ~d.
Pin |
Content |
|---|---|
|
The link of the only attached program, when the artifact has no XDP. |
|
Attachment |
|
XDP program |
|
A program with the test-run role. |
|
The serializer program of |
|
The upatch’s maps, less those whose name contains |
Extended attributes#
Name |
On |
Value and rules |
|---|---|---|
|
Every regular file and directory of shirudo’s writable state:
|
64 lowercase hex characters, the SHA-256 of the attribute name,
the same on every build. The seal treats any value as the label.
Only a task with runtime authority may set it ( |
|
Executable inodes carrying task policy bits. |
Exactly 8 bytes, the target-native representation of a |
|
Each directory above |
|
|
Each |
32 bytes, the |
Host configuration#
Path |
Use |
|---|---|
|
On the root file system: the source of the initrd’s bootstrap file and the settings of a host without images. In the initrd: the bootstrap file. See Configuration. |
|
In the initrd only: the certificates the dracut module copies in. |
|
Repository of a host without a config image. Written by |
|
Repository certificate of a host without a config image, |
|
Tree source of a host without a config image. |
|
Node labels of a host without a config image. |
|
|
|
|
|
|
shirudo refuses a configuration file under /etc/shirudo or
/var/lib/shirudo that is not a regular file, is owned by another
user than root or the caller, or is writable by group or others, and
the same for each directory its path leads through unless that
directory is root’s and sticky. A symbolic link on the path must be
root’s or the caller’s, and the directory that holds it is checked like
the directories of its target. A shirudo.conf that sets
tpm.owner_auth must also not be readable by group or others. The
EnvironmentFile paths are read by systemd, not by shirudo.
Kernel and system interfaces#
Path |
Read for |
|---|---|
|
The TPM, through the default TCTI |
|
Creating and checking the dm-verity mappings of the images. |
|
Pre-flight: BPF LSM active, bpffs supported. |
|
The |
|
The firmware and systemd event logs |
|
Attaching kprobe and kretprobe programs. |
|
Attaching |
|
Kernel build ID and configuration, matched by tree selectors. |
|
|
|
Whether |
Temporary files#
The target commands create none. bpm info and bpm key keep a
downloaded package in a memory file, memfd:shirudo-bpm-package, and
upatch map --s3-uri its snapshot in memfd:shirudo-map-snapshot:
a file of /tmp or of TMPDIR, which root chooses, could be
created in a sealed directory bound there, with the label and content
from a registry.