shirudo attest verify#
Check an evidence document offline against the pinned keys and the state you expect the target to be in.
Runs on: operator host, offline. It uses no TPM. Requires: the evidence and the nonce it was requested with. Changes measured state: no.
Usage#
shirudo attest verify --evidence=<evidence> --nonce=<nonce>
[--ak-name=<name>] [--ek-name=<name>]
[--expect-credential=<credential>]
[--cert=<certificate>]... [--upatch=<file>]...
[--expect=[java:]<name>=<digest>]... [--tree-root=<digest>]
[--expect-chain=<register>] [--allow-runtime-events]
[--expect-config-root=<root>
(--expect-config-pcr=<pcr> | --expect-config-nvpcr=<name>)]
[--expect-pcr=<pcr>=<value>]...
[--expect-bind-pcr=<pcr>=<value>]...
[--strict-anchor] [--require-initrd] [--json]
Every option takes its value after = or as the next argument. On a
host where enforcement is up the image gate refuses --cert. Run
verify where enforcement is not up.
Description#
verify prints one line per check, OK or FAIL, and one per
note, NOTE, followed by verdict: ok or verdict: fail. It
checks:
the nonce, in the document, the quote and the register certification
the attestation key: restricted, fixed to its TPM, its name matching its public area and, with
--ak-name, the pinned namethe endorsement key: its name and the TCG default template, and with
--ek-namethe pinned name. With--expect-credential, the credential the target recoveredthe quote and the register certification: signed by the attestation key as an endorsement primary, covering the listed PCRs and index, of one TPM boot: the same reset and restart counts
the config root history against the quoted config PCR, and with
--expect-config-rootthe approved rootthe register’s public area against the recorded PCR 9 and 11 binding, the init record of this TPM reset, the eventlog replay to the certified value and the anchor in PCR 9
the expected state: with
--cert(and--upatch,--expect,--tree-root) the init event, and the events after boot, which fail unless--allow-runtime-events. With--expect-chain, the register value
Without --ak-name, verify warns that the signer is not pinned, and
a document from any TPM passes the key checks. Without --cert or
--expect-chain, it compares no state and prints the register value as
a note. A verdict: ok then says only that the document is consistent
in itself. Pin the keys at enrollment (shirudo attest challenge) and always
give the expected state.
shirudo-quote-check checks a keepalive quote’s signature and signer
with the same functions as verify, and fewer fields of the
attestation key; its page lists the differences.
Options#
Option |
Argument |
Description |
|---|---|---|
|
|
Required. The document |
|
|
Required. The nonce the evidence was requested with. |
|
|
The attestation key name pinned at enrollment. |
|
|
The endorsement key name pinned at enrollment. |
|
|
The credential of the challenge given to the target. Needs
|
|
|
A certificate the target enrolls. Repeat for each, up to 16. |
|
|
An artifact archived on the target at boot. Repeatable, each
upatch name once across |
|
|
An archived upatch by name and payload digest, |
|
|
The upatch tree projection root at boot. Needs |
|
|
The register value after the expected events. |
|
none |
Accept loads, unloads and revocations after boot. |
|
|
The approved config image root hash. Needs
|
|
|
The PCR the config activation extends. |
|
|
The TPM name of the config NvPCR the config activation extends,
in place of |
|
|
A PCR value the quote must carry. Repeatable. |
|
|
A PCR value the register was bound under. Repeatable. |
|
none |
Require PCR 9 to hold only the anchor. |
|
none |
Print one JSON object: |
|
none |
Fail unless |
Exit status#
Status |
Meaning |
|---|---|
0 |
|
1 |
|
2 |
A usage error: an unknown option, an option given twice, the same
PCR twice to |
Examples#
Verify evidence against the predicted register value, with the attestation key pinned:
operator$ shirudo attest verify --evidence=ev.json --nonce=$NONCE --ak-name=<ak-name> --expect-chain=<register>
OK nonce matches the request
OK attestation key: restricted, fixed to this TPM
OK attestation key: name matches its public area
OK attestation key: the pinned key
OK endorsement key: name matches its public area
OK endorsement key: TCG default template under the endorsement policy
OK quote: ECDSA signature by the attestation key
OK quote: signed by the key as an endorsement primary
OK quote: carries the nonce
OK quote: covers the PCRs the document lists
OK quote: PCR digest matches the listed values
OK register: ECDSA signature by the attestation key
OK register: signed by the key as an endorsement primary
OK register: carries the nonce
OK register: certification names the listed index
OK register: certified contents match the listed value
OK quote and certification are of one TPM boot
OK config: config root history matches the quoted PCR
NOTE config root has no operator approval; use --expect-config-root with --expect-config-pcr
NOTE config records a selection; direct TPM writer protection is deferred
OK eventlog: this boot has an init record
OK register: the document names index 0x01818E00 and PCRs 9 and 11
OK register: public area is bound to PCRs 9 and 11 as recorded
NOTE binding: made in the initrd
OK eventlog: one init record for this TPM reset (1 this boot)
OK register: init record is of the TPM's current reset count
OK eventlog: 2 records replay to the certified value
OK anchor: record digest matches the index name
OK anchor: PCR 9 equals the recorded value extended by the anchor
OK state: register equals the expected value
NOTE event after boot: upatch_load basic
verdict: ok
$NONCE holds the nonce given to shirudo attest, <ak-name> the
name pinned at enrollment and <register> the
register_after_events line of shirudo attest predict.
Verify against the enrolled certificates and require an initrd binding.
Events after boot fail the check without --allow-runtime-events:
operator$ shirudo attest verify --evidence=ev.json --nonce=$NONCE --ak-name=<ak-name> --cert=cert.der --require-initrd --strict-anchor
The end of that report, for a target that loaded and unloaded a upatch after boot:
OK binding: made while the initrd ran
OK eventlog: one init record for this TPM reset (1 this boot)
OK register: init record is of the TPM's current reset count
OK eventlog: 3 records replay to the certified value
OK anchor: record digest matches the index name
OK anchor: PCR 9 equals the recorded value extended by the anchor
FAIL state: init event covers the expected certificate, set and tree root
FAIL state: 2 events after boot change the register
NOTE event after boot: upatch_load shirudo-test-basic
NOTE event after boot: upatch_unload shirudo-test-basic
verdict: fail
The first FAIL line says that the target enrolls a certificate set
other than the one given: that target enrolls two certificates and the
command names one.