Skip to content

eBPF-based security platform

docs: say where the quote checker and attest verify check apart

John Fastabend145f1dfda46b
diff --git a/Documentation/reference/cli/attest-verify.rst b/Documentation/reference/cli/attest-verify.rst
index a5038913..25dc74e9 100644
--- a/Documentation/reference/cli/attest-verify.rst
+++ b/Documentation/reference/cli/attest-verify.rst
@@ -67,6 +67,10 @@ a note. A ``verdict: ok`` then says only that the document is consistent
in itself. Pin the keys at enrollment (:doc:`attest-challenge`) and always
give the expected state.
+:doc:`quote-check` checks a keepalive quote with code of its own, not
+with ``verify``'s, and checks fewer fields of the attestation key; its
+page lists the differences.
+
Options
-------
@@ -240,5 +244,6 @@ Related
- :doc:`attest`
- :doc:`attest-predict`
- :doc:`attest-challenge`
+- :doc:`quote-check`
- :doc:`/operate/run/attest`
- :doc:`/security/threat-model`
diff --git a/Documentation/reference/cli/quote-check.rst b/Documentation/reference/cli/quote-check.rst
index 9c2f1a7c..16635014 100644
--- a/Documentation/reference/cli/quote-check.rst
+++ b/Documentation/reference/cli/quote-check.rst
@@ -120,6 +120,62 @@ and the program does not decide which keys a backend accepts.
:doc:`attest-challenge` and :doc:`attest-verify` tie an attestation key
to a TPM.
+Compared with attest verify
+---------------------------
+
+``shirudo attest verify`` checks the signature and the signer of the
+quotes in an evidence document with code of its own,
+:src:`util/attest.c`, where this program has
+:src:`tools/quote-check/row.c`. Both parse the key with the same
+``TPMT_PUBLIC`` parser, which refuses a curve other than NIST P-256 and
+an ECDSA hash other than SHA-256, and both check the signer as the
+key's qualified name under the endorsement hierarchy. They differ in
+these:
+
+.. list-table::
+ :header-rows: 1
+ :widths: 36 32 32
+
+ * - Check
+ - ``shirudo-quote-check``
+ - ``shirudo attest verify``
+ * - The key is an ECC key with the ECDSA scheme
+ - Yes, step 2
+ - Yes
+ * - The key has no symmetric algorithm
+ - No: the parser also takes AES-128-CFB
+ - Yes
+ * - The key's attributes include restricted, sign, fixedTPM,
+ fixedParent and sensitiveDataOrigin
+ - No
+ - Yes
+ * - The signer's name is compared
+ - With ``memcmp()``
+ - In constant time, with ``memneq_explicit()``
+ * - After a check fails
+ - Stops: the first failure decides the reason
+ - Goes on and reports every check, unless a structure does not
+ parse
+ * - A key that is no point of the curve
+ - ``bad_signature``
+ - The signature check fails
+
+The attribute check would prove little here. The ``ak`` field travels
+with the row from the node, so its attributes are what the node
+declares, and a software P-256 key can carry the same bits (U1 of
+:doc:`/security/threat-model`). That a key is a TPM's comes only from
+credential activation, :doc:`attest-challenge` and ``shirudo attest
+--challenge``, and from pinning its name in :doc:`attest-verify`; a
+backend treats every node as ``untrusted`` until it has done that (R17).
+The signer's name is public, so the comparison needs no constant time.
+
+.. note::
+
+ The two verifiers are separate code: a check added to one, or a fix
+ to one, does not reach the other. Change both, and their tests, in
+ the same commit. D10 of :doc:`/security/threat-model` is the
+ consolidation into one function.
+
Output
------
diff --git a/Documentation/security/threat-model.rst b/Documentation/security/threat-model.rst
index 89eeb4f7..bf5e079d 100644
--- a/Documentation/security/threat-model.rst
+++ b/Documentation/security/threat-model.rst
@@ -44,7 +44,7 @@ Every entry has a stable ID that commits, issues and other pages cite:
- Residual risks: known and bounded limits of the mechanisms.
* - U1 to U20
- Threats to resolve: gaps in the code that are not closed yet.
- * - D1 to D9
+ * - D1 to D10
- Deferred mitigations that are in scope.
Each threat is explained in prose and then summarized in a fact box.
@@ -1903,6 +1903,15 @@ D9 Perf events across exec
that marks it (T3), tracked in `issue 11
<https://github.com/shirudo-dev/shirudo/issues/11>`__.
+D10 One verifier of a TPM quote
+ Check a quote's signature, its signer and the attestation key's
+ public area in one function of :src:`util/tpm_wire.c`, a
+ ``tpm_quote_signed()``, that ``shirudo attest verify`` and
+ ``shirudo-quote-check`` both call. Each has its own code today, and
+ the two check different fields of the key
+ (:doc:`/reference/cli/quote-check`), so a check or a fix one gains
+ can miss the other (R17, T9).
+
Out of scope
------------