Configuration#
Every file shirudo takes settings from, every key, and the rules each
reader applies. shirudo config prints the settings in effect, see
shirudo config.
Files#
Each authenticated file is vouched for by the one before it, from the signed UKI on, as Figure 1 shows.
File |
Location |
Authenticated by |
|---|---|---|
Initrd bootstrap |
|
The UKI’s Secure Boot signature, checked by the boot chain, not by shirudo |
Runtime bootstrap |
|
The runtime image’s dm-verity root, pinned by
|
Config settings |
|
The config image’s signed dm-verity root |
Repository definitions, tree subscription, node labels, trusted and revoked keys |
The config image, see Config image |
The config image’s signed dm-verity root |
Host file |
|
Nothing. Read on operator hosts. A target takes its settings from the bootstrap files and the config image. |
Unit environment files |
|
Nothing. See Environment variables. |
The two bootstrap files are different files with different required
keys. shirudo-gen-initrd --bootstrap-conf <file> embeds the initrd
bootstrap. shirudo-gen-runtime --bootstrap-conf <file> installs the
runtime bootstrap into the runtime image. See Image and initrd generators.
Figure 1. Where a target’s settings come from, and what authenticates each file.#
Bootstrap keys#
Key |
Value |
Initrd bootstrap |
Runtime bootstrap |
Meaning |
|---|---|---|---|---|
|
Absolute path prefix |
Required |
Refused |
Prefix of the runtime image files, see Image files |
|
64 hexadecimal digits |
Required |
Refused |
Expected dm-verity root hash of the runtime image |
|
Absolute path prefix under |
Allowed |
Required |
Config image selected at boot while
|
|
Absolute path under |
Allowed |
Required |
Repeatable, at most 16 DER certificates. Init enrolls them in
|
|
Decimal integer, 0 to 15, not 9 or 11 |
Allowed |
Required, or |
PCR that config activation extends |
|
|
Allowed |
Required, or |
Extend the config NvPCR, NV index |
The runtime bootstrap’s config.* values are the ones in effect: the
root file system’s run of init and every later command read only the
runtime bootstrap.
Bootstrap rules:
A
runtime.*key in the runtime bootstrap is refused withEINVAL.A
config.*orruntime.*key not in the table is refused withEINVAL. A repeatedruntime.imageorruntime.root_hashis refused withEINVAL.A repeated
config.verification_keyadds another allowed certificate. A repeated path is refused withEEXISTand more than 16 entries withE2BIG. Runtime loading also rejects duplicate public keys and certificates other than ML-DSA-87.A
config.verification_keyoutside/run/shirudo/runtime/is refused withEPERM.A path is valid when it is absolute and contains no
//,/./or/../, does not end in/..and is not/.A non-blank line that is not a comment and has no
=is refused withEINVAL. A line longer than 4223 bytes is refused withE2BIG.Every other key in a bootstrap file is a setting, read as in Settings.
init reports a refused bootstrap file with init: authenticated
image settings: <error> or, for the runtime bootstrap in the initrd,
image: load runtime config: <error>, and exits with status 1.
Every other command fails with shirudo: image state: <error> and exit
status 1.
Settings#
Key |
Value |
Default |
Set in |
|---|---|---|---|
|
Decimal integer, |
|
Config image |
|
Literal password, or |
Empty |
Both bootstrap files |
|
TCTI string, at most 255 bytes. |
|
Both bootstrap files |
|
Comma-separated exact DNS names, at most 1023 bytes |
Empty |
Runtime bootstrap on a target, host file on an operator host |
|
Absolute path, or empty |
Empty |
Config image |
|
|
Empty |
Config image |
|
1 to 128 characters from |
Empty |
Config image |
|
|
|
Config image |
|
Decimal integer, 0 to 10 |
|
Config image |
|
|
Empty |
Config image |
|
Decimal integer, 1 to 8388608 |
|
Config image |
|
Decimal integer, 1 to 8388608 |
|
Config image |
Key |
Effect |
|---|---|
|
|
|
Owner hierarchy authorization for defining the NV index. Needed
only when the TPM’s owner password is set. The initrd copy is
read while |
|
TPM connection for tpm2-tss. With a config image active, a value
that does not begin with |
|
HTTPS hosts that may negotiate |
|
|
|
OTLP/HTTP base URL. |
|
Sent as the |
|
|
|
Further attempts after a failed OTLP or S3 request. |
|
Object store for a snapshot larger than
|
|
Largest OTLP log record. Must not exceed
|
|
Largest OTLP request body. |
On a target, the effective settings combine the files as follows:
tpm.owner_auth,tpm.tctiandtls.classical_hostscome from the bootstrap. The config image cannot carry them.eventlog.max_bytesandmap_export.*come from the config image. A value in a bootstrap file applies only while no config image is active, as forstatusduring an activation it cannot verify.On a host without a config image,
SHIRUDO_TPM_TCTIandSHIRUDO_TPM_OWNER_AUTHoverride the file. A target refuses both, see Environment variables.
See Map logs and metrics for what the map_export.*
destinations receive.
Syntax and validation#
All three files and the host file share one syntax:
One
key = valueper line. Blanks around the key and the value are removed.A line whose first non-blank character is
#is a comment.A later line sets a key again, except the repeatable bootstrap
config.verification_key, which adds another certificate.A line without
=is ignored, except in a bootstrap file and in the config image.
How each reader treats a bad value:
Value |
Result |
|---|---|
Unknown key |
Warning |
Unknown |
Warning. Map export is invalid: |
Unknown |
Warning. No host may use classical key exchange. |
Invalid |
Warning. The value is ignored. |
Line longer than 4223 bytes in the host file |
Warning. The line is ignored. |
Line containing a NUL byte |
The file is refused with |
The config image’s etc/shirudo/shirudo.conf is checked again when an
image is validated, before its root is extended into the config PCR. The
image is refused when:
the file is missing;
a line is longer than 1023 bytes or contains a NUL byte (
E2BIG);a non-blank line that is not a comment has no
=(EINVAL);a key is neither
eventlog.max_bytesnormap_export.*(EPERM);eventlog.max_bytesis not a decimal integer (EINVAL);the map export settings are invalid (
EINVAL).
Ownership and mode#
A settings, repository, tree or certificate file, and the registry auth
file and CA certificate that REGISTRY_AUTH_FILE and
BPM_OCI_CA_FILE name, read from a path under /etc/shirudo or
/var/lib/shirudo is refused with EPERM unless:
it is a regular file owned by root or by the effective user;
it is not writable by group or others;
every directory the path leads through is owned by root or the effective user and is not writable by group or others, or is root’s and sticky;
every symbolic link on the path is owned by root or the effective user.
The path is resolved one name at a time, so the directory that holds a
symbolic link is checked as well as the directories of the link’s
target. A link may lead out of /etc/shirudo, to the distribution’s
CA certificates for example, when every link and directory on the way
passes. A file that the path no longer names when the check runs, one
renamed over in between, is opened again and checked in full, up to
three more times. Only a name renamed over before every check is
refused, with ESTALE. Troubleshoot by symptom
gives the messages.
A file that sets tpm.owner_auth must also not be readable by group or
others, mode 0600 or stricter. This applies to the initrd bootstrap
and the host file. Files read from the runtime and config images are
checked by their dm-verity roots instead. shirudo-gen-runtime
installs the runtime bootstrap with mode 0644.
Config image#
A config image is a directory tree of regular files and directories on
one file system, at most 65536 entries and 32 levels deep. Symbolic
links, devices, FIFOs and sockets are refused with EPERM.
Path in the image |
Content |
|---|---|
|
Required. |
|
One repository definition each, see Repository definition. |
|
Repository certificates named by |
|
The upatch tree subscription, see Tree subscription. |
|
The labels tree selectors match, see Node labels. |
|
Further BPF signing certificates. Each needs a
|
|
A revoked certificate. |
See Manage signing keys for the trusted and revoked sets and Config images and dm-verity for activation.
Runtime image#
Path in the image |
Content |
|---|---|
|
The target binary ( |
|
Further executables ( |
|
The runtime bootstrap ( |
|
The initial BPF signing certificate ( |
|
The first config verification certificate ( |
|
Additional config verification certificates (repeat |
The ELF interpreter and libraries |
Copied at their own paths for a dynamic binary. |
shirudo’s part of the initrd#
Path in the initrd |
Content |
|---|---|
|
The initrd bootstrap. The dracut module’s install step fails when it cannot read the file. |
|
The primary certificate. The pre-flight check and the
|
|
Copied from |
The shirudo binary |
At its path on the root file system. |
Image files#
runtime.image and config.image name a path prefix. The files are
the prefix with a suffix:
Suffix |
Runtime image |
Config image |
Content |
|---|---|---|---|
|
Required |
Required |
ext4 file system |
|
Required |
Required |
dm-verity superblock and hash tree |
|
Required |
Required |
Root hash as exactly 64 lowercase hex digits, no newline |
|
Not read |
Required |
Detached CMS signature over the 64 root hash bytes |
Repository definition#
etc/shirudo/bpm/registries.d/<name>.conf in the config image, or the
same path under / on a host without one. <name> is the
repository name: 1 to 127 characters from A-Z, a-z, 0-9,
., _, -, not starting with ..
Key |
Value |
|---|---|
|
Required. |
|
Optional. The OCI repository containing the signed index. When
omitted, it defaults to |
|
Required. DER certificate that verifies the repository’s signed
index. With a config image, |
Lines without = and other keys are ignored. Leading blanks of a value
are removed, trailing blanks are kept.
Tree subscription#
etc/shirudo/bpm/upatch-tree.conf in the config image, or
/etc/shirudo/bpm/upatch-tree.conf on a host without one. Without the
file, bpm tree sync does nothing.
Key |
Value |
|---|---|
|
Required. |
|
Required. Tag or digest of the tree publication, without |
Either value may be enclosed in double quotes. An opening quote without
a closing one is refused with EINVAL. Lines without = and other
keys are ignored. See upatch tree for the
publication.
Node labels#
etc/shirudo/node.labels in the config image, or
/etc/shirudo/node.labels on a host without one.
One
key=valueper line. Lines starting with#and lines without=are ignored.A line longer than 511 bytes, more than 64 labels, or a key or value longer than 255 bytes is an error for the tree operation being matched.
Blanks after the
=and at the end of the line are removed. Blanks between the key and the=are kept as part of the key, so writeenv=prod, notenv = prod.Without the file, a tree operation whose selector names a label does not match.