Skip to content

eBPF-based security platform

docs: say that shirudo verifies a config root before the kernel does

Daniel Borkmann8461756f97a0
diff --git a/Documentation/concepts/background/dm-verity.rst b/Documentation/concepts/background/dm-verity.rst
index 89ea6748..16b72d5d 100644
--- a/Documentation/concepts/background/dm-verity.rst
+++ b/Documentation/concepts/background/dm-verity.rst
@@ -111,10 +111,12 @@ What shirudo adds
shirudo sets up its mappings itself through the device-mapper ioctls,
without a userspace tool on the target: version 1 format, 4096-byte
data and hash blocks, SHA-256 and a salt, with the image files attached
-to read-only loop devices. For a configuration image it adds
-``root_hash_sig_key_desc`` and loads the image's signature into a
-``user`` key in its thread keyring. It then reads back the table the
-kernel holds and checks it.
+to read-only loop devices. For a configuration image it first verifies
+the root hash signature against the runtime image's config
+certificates, then adds ``root_hash_sig_key_desc`` and loads the
+signature into a ``user`` key in its thread keyring, so that the kernel
+checks it again. It then reads back the table the kernel holds and
+checks it.
Because dm-verity checks a block only when it is read, a corrupted
block would surface only when something happens to read it, possibly
@@ -148,6 +150,7 @@ Choosing the active image is up to shirudo's configuration updates; see
The kernel accepts a signature from any key in the keyrings it consults,
not only from ``.dm-verity``. On a kernel whose builtin, secondary or
platform keyring holds other keys, such as a distribution's module
-signing key, those keys can sign a configuration root that the kernel
-accepts. shirudo performs no signer check of its own. The threat model
-lists this under threats to resolve: :doc:`/security/threat-model`.
+signing key, those keys pass the kernel's check of a configuration
+root. They do not pass shirudo's own check before it, which admits only
+the config certificates (assumption A7 of the
+:doc:`/security/threat-model`).
diff --git a/Documentation/concepts/background/keyrings.rst b/Documentation/concepts/background/keyrings.rst
index 4a14dc51..e94603d7 100644
--- a/Documentation/concepts/background/keyrings.rst
+++ b/Documentation/concepts/background/keyrings.rst
@@ -201,6 +201,7 @@ of ``lsm/key_permission``, which both happen within init, a root process
could unlink a key and take signed loading out until the next boot.
For dm-verity, ``.dm-verity`` is consulted only after the builtin
-keyring and, when configured, the secondary and platform keyrings. A key
-there can sign a configuration root as well; see :doc:`dm-verity` and
-:doc:`/security/threat-model`.
+keyring and, when configured, the secondary and platform keyrings, so a
+key there passes the kernel's check of a configuration root as well.
+shirudo's own check against the runtime image's config certificates
+refuses it; see :doc:`dm-verity`.
diff --git a/Documentation/concepts/background/pqc.rst b/Documentation/concepts/background/pqc.rst
index eebedf4f..b1deb578 100644
--- a/Documentation/concepts/background/pqc.rst
+++ b/Documentation/concepts/background/pqc.rst
@@ -132,8 +132,8 @@ verify either form.
* - Signed loaders and unload directives
- The kernel at ``BPF_PROG_LOAD``, against the ``.bpf`` keyring
* - Config image roots, the 64 hex characters of the root hash
- - The kernel's dm-verity signature check, against the
- ``.dm-verity`` keyring and the kernel's own trusted keys
+ - shirudo, against the runtime image's config certificates, then
+ the kernel's dm-verity signature check
* - Vouches for additional signing certificates
- shirudo, against the enrolled trust set
* - Repository indexes
@@ -175,10 +175,6 @@ What stays classical
classical assumptions.
- TLS server authentication. Registries and collectors present WebPKI
certificates, usually RSA or ECDSA.
-- Kernel keys outside shirudo's keyrings. The dm-verity check also
- accepts config signatures from the kernel's built-in trusted keys and,
- depending on the kernel configuration, its secondary and platform
- keyrings. Distribution keys there are usually RSA or ECDSA.
Limits
------
diff --git a/Documentation/concepts/glossary.rst b/Documentation/concepts/glossary.rst
index c7510b2c..f630e7da 100644
--- a/Documentation/concepts/glossary.rst
+++ b/Documentation/concepts/glossary.rst
@@ -101,10 +101,12 @@ it.
``/run/shirudo/config``, that carries what an operator changes
during operation: repositories and their certificates, the tree
subscription, node labels, vouched and revoked certificates, and
- export settings. Its root hash is signed, and the kernel checks the
- signature against its trusted keys, which include the sealed
- ``.dm-verity`` keyring. ``shirudo image update`` activates a new
- config image without a reboot and measures it into a dedicated PCR.
+ export settings. Its root hash is signed: shirudo verifies the
+ signature against the runtime image's config certificates before
+ it maps the image, and the kernel against its trusted keys and the
+ sealed ``.dm-verity`` keyring. ``shirudo image update`` activates a
+ new config image without a reboot and measures it into a dedicated
+ PCR.
See :doc:`/internals/config-images`.
decoder
diff --git a/Documentation/concepts/operator-and-target.rst b/Documentation/concepts/operator-and-target.rst
index e1c03a94..ae162cd9 100644
--- a/Documentation/concepts/operator-and-target.rst
+++ b/Documentation/concepts/operator-and-target.rst
@@ -132,14 +132,13 @@ its measurement PCR. The UKI's initrd carries the runtime image's root
hash, so the measured boot covers it.
The config image holds what an operator changes during operation. Its
-root hash is signed, and the kernel checks the signature against the
-``.dm-verity`` keyring, into which ``init`` enrolls the runtime image's
-config certificate before sealing it. ``shirudo image update`` activates a
-new config image without a reboot and measures it into a separate PCR.
-The kernel also accepts a config signed by a key in its built-in trusted
-keyring and, depending on its configuration, in the secondary or platform
-keyring; the :doc:`/security/threat-model` lists this among the threats to
-resolve.
+root hash is signed. shirudo verifies the signature against the runtime
+image's config certificates before it maps the image. The kernel then
+checks it again against its trusted keys and the ``.dm-verity`` keyring,
+into which ``init`` enrolls those certificates before sealing it. A key
+that only the kernel trusts, in its built-in, secondary or platform
+keyring, fails shirudo's check. ``shirudo image update`` activates a new
+config image without a reboot and measures it into a separate PCR.
Neither image replaces the host's root file system. Both are read-only,
and the config image is mounted ``noexec``. :doc:`/internals/config-images`
diff --git a/Documentation/security/cryptography.rst b/Documentation/security/cryptography.rst
index 0d1f5f3e..a9881073 100644
--- a/Documentation/security/cryptography.rst
+++ b/Documentation/security/cryptography.rst
@@ -44,8 +44,9 @@ Signatures
* - Config root
- The 64 lowercase hex characters of the dm-verity root hash
- The operator's image tooling, with the config key
- - The kernel when shirudo creates the mapping, against the keyrings
- of assumption A7; ``shirudo image verify`` offline
+ - shirudo against the runtime bootstrap's config certificates
+ before it creates the mapping, then the kernel against the
+ keyrings of assumption A7; ``shirudo image verify`` offline
* - Vouch
- The bytes ``shirudo-key-vouch``, a NUL byte, and the DER of the
vouched certificate