Skip to content

eBPF-based security platform

docs: list the twelve tampered reasons once and link to them

Daniel Borkmann7125c22196c0
diff --git a/Documentation/operate/run/read-status.rst b/Documentation/operate/run/read-status.rst
index ad810cb4..64ac0f09 100644
--- a/Documentation/operate/run/read-status.rst
+++ b/Documentation/operate/run/read-status.rst
@@ -503,12 +503,75 @@ precedence: ``tampered``, ``lsm-off``, ``init-pending``,
``tampered``
~~~~~~~~~~~~
-A ``tampered`` verdict has one of five reasons. Each shows as an
-``ALERT`` condition. The lines below are what ``status`` prints in each
-state, cut to the verdict and the condition that raised it. ``<pinned>``,
-``<live>`` and ``<root>`` stand for the values of your target.
+A ``tampered`` verdict has one of twelve reasons, which the ``Status``
+line prints in parentheses. Each comes with a condition at ``ALERT``,
+whose detail says more. :ref:`status-json-verdicts` gives them in the
+order ``status`` checks them.
-The register does not replay from the eventlog:
+.. list-table::
+ :header-rows: 1
+ :widths: 34 18 48
+
+ * - Reason
+ - Condition
+ - What happened
+ * - ``live register differs from the eventlog replay``
+ - ``ChainIntact``
+ - Something extended or replaced the register without a matching
+ eventlog record, the eventlog of this boot was altered or hidden,
+ or the index is not the one ``init`` bound. The ``TPM
+ measurement`` section shows which lines disagree.
+ * - ``the archive of a loaded XDP upatch differs from what was
+ loaded``
+ - ``UpatchesMeasured``
+ - The sealed archive of a loaded XDP upatch changed or is gone.
+ ``upatch reconcile`` refuses to run, so new devices stay
+ uncovered.
+ * - ``a loaded upatch is missing a link or its archive``
+ - ``UpatchesMeasured``
+ - A loaded upatch has fewer link pins than its signed metadata
+ implies, so part of it is detached, or its sealed archive is gone
+ or unusable.
+ * - ``a upatch is pinned or archived without a record of this boot``
+ - ``UpatchesMeasured``
+ - A load stopped between its pins and its extend, so the upatch runs
+ while the register does not cover it, an unload stopped after its
+ extend, or an archive came back after its unload. The next
+ ``upatch load`` or ``upatch unload``, and every ``bpm`` command
+ that loads or unloads, undoes them before it acts and records the
+ undo in the journal. What stopped the load, or who brought the
+ archive back, is the question for the incident.
+ * - ``this boot's records do not fold to the measurement register``
+ - ``UpatchesMeasured``
+ - The eventlog from the init record on does not give the value the
+ TPM reports, or a record's digest does not follow from its
+ fields. Every ``upatch load`` and ``upatch unload`` refuses.
+ * - ``the selected config cannot be verified against its records``
+ - ``ConfigActive``
+ - The detail names the cause, see below.
+ * - ``the keyring init froze is gone``
+ - ``KeyringSealed``
+ - The ``.bpf`` keyring ``init`` sealed is gone.
+ * - ``keyring serial swap detected``
+ - ``KeyringSealed``
+ - The live ``.bpf`` keyring is not the one ``init`` sealed.
+ * - ``the dm-verity keyring init froze is gone``
+ - ``KeyringSealed``
+ - The same for ``.dm-verity``.
+ * - ``dm-verity keyring serial swap detected``
+ - ``KeyringSealed``
+ - The same for ``.dm-verity``.
+ * - ``a keyring holds a link init did not freeze``
+ - ``KeyringSealed``
+ - The kernel trusts that link for signatures from then on. The
+ keyring section lists it under ``Other links`` with ``(not
+ frozen)``.
+ * - ``the config key init froze is gone``
+ - ``KeyringSealed``
+ - The config key is gone from ``.dm-verity``.
+
+The lines below are what ``status`` prints for the first reason, cut to
+the verdict and the condition that raised it:
.. code-block:: text
@@ -516,68 +579,6 @@ The register does not replay from the eventlog:
...
ChainIntact ALERT live register differs from the eventlog replay
-Something extended or replaced the register without a matching eventlog
-record, the eventlog of this boot was altered or hidden, or the index is
-not the one ``init`` bound. The ``TPM measurement`` section shows which
-lines disagree.
-
-A upatch is pinned or archived without a record:
-
-.. code-block:: text
-
- Status: tampered (a upatch is pinned or archived without a record of this boot)
- ...
- UpatchesMeasured ALERT 1 pinned or archived without a record of this boot: <name>
-
-A load was stopped between its pins and its extend, so the upatch runs
-while the register does not cover it, an unload was stopped after its
-extend, or an archive came back after its unload, which ``init`` would
-not restore. The next ``upatch load`` or ``upatch unload``, and every
-``bpm`` command that loads or unloads, undoes those pins and archives
-before it acts and records the undo in the journal. What stopped the
-load, or who brought the archive back, is the question for the
-incident.
-
-The live keyring is not the one ``init`` sealed:
-
-.. code-block:: text
-
- Status: tampered (keyring serial swap detected)
- ...
- KeyringSealed ALERT pinned serial <pinned>, live serial <live>: swapped
-
-The keyring ``init`` sealed is gone:
-
-.. code-block:: text
-
- Status: tampered (the keyring init froze is gone)
- ...
- KeyringSealed ALERT pinned serial <pinned>, the .bpf keyring is gone
-
-The same for ``.dm-verity`` reads ``dm-verity keyring serial swap
-detected`` or ``the dm-verity keyring init froze is gone``.
-
-A keyring holds a link ``init`` did not freeze, which the kernel trusts
-for signatures from then on:
-
-.. code-block:: text
-
- Status: tampered (a keyring holds a link init did not freeze)
- ...
- KeyringSealed ALERT the dm-verity keyring holds 1 link init did not freeze
-
-The keyring section lists that link under ``Other links`` with
-``(not frozen)``. If instead the config key is gone from
-``.dm-verity``, the reason is ``the config key init froze is gone``.
-
-The config cannot be verified against its records:
-
-.. code-block:: text
-
- Status: tampered (the selected config cannot be verified against its records)
- ...
- ConfigActive ALERT the config PCR, activation records and mounted config disagree
-
The detail of ``ConfigActive`` names the cause:
- ``the config PCR, activation records and mounted config disagree``: the config PCR does not hold the value the activation
diff --git a/Documentation/reference/cli/status.rst b/Documentation/reference/cli/status.rst
index 04938068..b1900a0f 100644
--- a/Documentation/reference/cli/status.rst
+++ b/Documentation/reference/cli/status.rst
@@ -39,34 +39,10 @@ report. The roles come from what is present:
The report shows seven conditions, each ``OK``, ``WARN`` or ``ALERT``:
``LsmAttached``, ``KeyringSealed``, ``ChainIntact``,
``UpatchesMeasured``, ``TpmMeasured``, ``ConfigActive`` and
-``XdpCovered``. The verdict is the first of these that applies:
-
-.. list-table::
- :header-rows: 1
- :widths: 20 80
-
- * - Verdict
- - Applies when
- * - ``tampered``
- - The live register differs from the eventlog replay, the archive
- of a loaded XDP upatch differs from what was loaded, a loaded
- upatch is missing a link or its archive, a upatch is pinned or
- archived without a record of this boot, the selected config
- cannot be verified against its records, the ``.bpf`` or
- ``.dm-verity`` keyring is not the one ``init`` froze or is gone,
- a keyring holds a link ``init`` did not freeze, or the config key
- is gone from ``.dm-verity``.
- * - ``lsm-off``
- - The LSM link is not pinned.
- * - ``init-pending``
- - ``init`` has not frozen a ``.bpf`` keyring this boot.
- * - ``reboot-pending``
- - A config activation is pending until the next reboot.
- * - ``degraded``
- - No TPM answered, no register is bound this boot, or a device an
- XDP upatch selects does not run it.
- * - ``ok``
- - None of the above.
+``XdpCovered``. The verdict is the first that applies of ``tampered``,
+``lsm-off``, ``init-pending``, ``reboot-pending``, ``degraded`` and
+``ok``, and its reason the first cause that applies:
+:ref:`status-json-verdicts` lists them with the condition each raises.
The human report follows the verdict with the conditions, the tamper
and integrity counters that moved this boot and the loaded upatches. Three sections
diff --git a/Documentation/reference/formats/status-json.rst b/Documentation/reference/formats/status-json.rst
index 00c3e219..b29d8abc 100644
--- a/Documentation/reference/formats/status-json.rst
+++ b/Documentation/reference/formats/status-json.rst
@@ -60,7 +60,7 @@ determined, as noted.
* - ``reason``
- string or ``null``
- The reason the human report prints after the verdict, ``null``
- for ``ok``, see `Reasons`_.
+ for ``ok``, see `Verdicts`_.
* - ``conditions``
- array of object
- Seven conditions, each with ``type``, ``status`` and ``detail``,
@@ -147,92 +147,84 @@ determined, as noted.
- object
- The upatch tree, see `upatch_tree`_.
+.. _status-json-verdicts:
+
Verdicts
--------
-``status`` takes the first verdict in this order whose condition holds.
-
-.. list-table::
- :header-rows: 1
- :widths: 18 82
-
- * - ``status``
- - Condition
- * - ``tampered``
- - The live register differs from the eventlog replay, the archive
- of a loaded XDP upatch differs from what was loaded, a loaded
- upatch is missing a link or its archive, a upatch is pinned or
- archived without a record of this boot, the selected config
- cannot be verified against its activation records, a keyring
- ``init`` pinned is gone, the ``.bpf`` or ``.dm-verity`` keyring's
- serial differs from the pinned serial, a keyring holds a link
- ``init`` did not freeze, or the config key ``init`` froze is gone
- from ``.dm-verity``.
- * - ``lsm-off``
- - The LSM link is not pinned. Enforcement is off.
- * - ``init-pending``
- - No ``.bpf`` keyring is recorded: ``init`` has not completed.
- * - ``reboot-pending``
- - A config activation is pending until the next reboot.
- * - ``degraded``
- - No register is bound this boot: no TPM answered, or the NV index
- is not written. Or a device an XDP upatch selects does not run
- it.
- * - ``ok``
- - None of the above.
-
-Reasons
-~~~~~~~
-
-``reason`` is ``null`` for ``ok`` and otherwise one of these strings.
-For ``tampered`` it names the first cause that applies, in the order
-listed. For ``degraded`` it is ``no TPM answered`` when no TPM
-answered, ``no register bound this boot`` when no register is bound,
-else ``a device an XDP upatch selects does not run it``.
+``status`` takes the first verdict in this order whose condition holds,
+and ``reason`` names the first of its causes that applies, in the order
+of the table. ``reason`` is ``null`` for ``ok``. The third column names
+the condition that is not ``OK`` with it.
.. list-table::
:header-rows: 1
- :widths: 18 82
+ :widths: 16 50 34
* - ``status``
- ``reason``
+ - Condition
* - ``tampered``
- ``live register differs from the eventlog replay``
+ - ``ChainIntact`` ``ALERT``
* -
- ``the archive of a loaded XDP upatch differs from what was
loaded``
+ - ``UpatchesMeasured`` ``ALERT``
* -
- ``a loaded upatch is missing a link or its archive``
+ - ``UpatchesMeasured`` ``ALERT``
* -
- ``a upatch is pinned or archived without a record of this boot``
+ - ``UpatchesMeasured`` ``ALERT``
* -
- ``this boot's records do not fold to the measurement register``
+ - ``UpatchesMeasured`` ``ALERT``
* -
- ``the selected config cannot be verified against its records``
+ - ``ConfigActive`` ``ALERT``
* -
- - ``the keyring init froze is gone``
+ - ``the keyring init froze is gone``: the ``.bpf`` keyring
+ - ``KeyringSealed`` ``ALERT``
* -
- - ``keyring serial swap detected``
+ - ``keyring serial swap detected``: the ``.bpf`` keyring's serial
+ differs from the one ``init`` pinned
+ - ``KeyringSealed`` ``ALERT``
* -
- ``the dm-verity keyring init froze is gone``
+ - ``KeyringSealed`` ``ALERT``
* -
- ``dm-verity keyring serial swap detected``
+ - ``KeyringSealed`` ``ALERT``
* -
- - ``a keyring holds a link init did not freeze``
+ - ``a keyring holds a link init did not freeze``: ``.bpf`` or
+ ``.dm-verity``
+ - ``KeyringSealed`` ``ALERT``
* -
- - ``the config key init froze is gone``
+ - ``the config key init froze is gone``: from ``.dm-verity``
+ - ``KeyringSealed`` ``ALERT``
* - ``lsm-off``
- - ``LSM not attached, enforcement off``
+ - ``LSM not attached, enforcement off``: the LSM link is not pinned
+ - ``LsmAttached`` ``ALERT``
* - ``init-pending``
- - ``.bpf keyring absent before init``
+ - ``.bpf keyring absent before init``: ``init`` has not completed
+ - ``KeyringSealed`` ``WARN``
* - ``reboot-pending``
- ``a config activation is pending until the next reboot``
+ - ``ConfigActive`` ``WARN``
* - ``degraded``
- - ``no register bound this boot``
- * -
- ``no TPM answered``
+ - ``ChainIntact`` and ``TpmMeasured`` ``WARN``
+ * -
+ - ``no register bound this boot``: a TPM answered, but the NV index
+ is not written
+ - ``ChainIntact`` and ``TpmMeasured`` ``WARN``
* -
- ``a device an XDP upatch selects does not run it``
+ - ``XdpCovered`` ``WARN``
+ * - ``ok``
+ - ``null``: none of the above
+ - No condition at ``ALERT``
Conditions
----------