shirudo attest#
Produce a TPM-signed evidence document for this target, and activate the operator’s credential challenge when given one.
Runs on: target, as root with the runtime binary. Requires: a TPM and a
measurement register bound this boot by init. Changes measured state:
no.
Usage#
shirudo attest [--nonce=<nonce>] [--pcrs=<list>] [--challenge=<challenge>]
[-o <path> | --output=<path>]
shirudo attest verify ...
shirudo attest predict ...
shirudo attest challenge ...
shirudo attest --list-cmds
Every option takes its value after = or as the next argument, and
-o is --output. attest with no argument produces evidence. It
does not print help. The subcommands run on the operator host:
shirudo attest verify, shirudo attest predict, shirudo attest challenge.
Description#
attest collects and signs, with the TPM’s attestation key:
a quote over the selected PCRs with the nonce,
a certification of the measurement register (NV index
0x01818E00) with the nonce,this boot’s eventlog, the config activation records, and the firmware and systemd measurement logs,
the public areas and names of the attestation key and the endorsement key, and the endorsement certificate when the TPM holds one.
The attestation key is a fixed-template primary under the endorsement
hierarchy. With --challenge, attest activates the credential the
operator made for that key and includes it, which proves that the key
lives in the same TPM as the endorsement key (shirudo attest challenge).
Both keys are primaries under the endorsement hierarchy, created from the templates below, so one TPM always yields the same keys and names. A builder that creates them from the same templates in the same TPM reads the names the evidence will carry. The endorsement key is the ECC one, or the RSA one when the TPM holds only an RSA endorsement certificate.
Field |
Attestation key |
Endorsement key |
|---|---|---|
Type |
ECC |
ECC, or RSA |
Name algorithm |
SHA-256 |
SHA-256 |
Attributes |
|
|
Authorization policy |
Empty |
|
Symmetric |
Null |
AES-128 in CFB mode |
Scheme |
ECDSA with SHA-256 |
Null |
Key |
NIST P-256, KDF null |
NIST P-256, KDF null; or RSA-2048, exponent 0 (65537) |
|
Empty |
32 zero bytes each for x and y; 256 zero bytes for RSA |
The endorsement key templates are the TCG EK Credential Profile’s default low-range templates, L-2 for ECC and L-1 for RSA.
Without --nonce, attest warns that the evidence proves no
freshness.
Attest targets describes the procedure from enrollment to verification.
Options#
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
|
none |
Freshness value from the verifier, carried in the quote and the certification. |
|
|
0-7, 9, 11-15 |
PCRs to quote. |
|
|
none |
Credential challenge from |
|
|
standard output |
Write the evidence to |
Exit status#
Status |
Meaning |
|---|---|
0 |
The evidence was written. |
1 |
No TPM answered ( |
2 |
A usage error: an unknown option, an option given twice, a value
missing or empty, or an argument. An invalid |
Files and environment#
Reads the TPM,
/var/lib/shirudo/eventlog, the config activation records and the firmware and systemd event logsWrites
--output
Examples#
On the operator host, make a nonce:
operator$ openssl rand -hex 32
On the target, produce evidence for that nonce:
target# shirudo attest --nonce=a707993af885f29e88a1f9e936a3ccf9806b8d8b02c43dfe56fe571ce0f200d3 --output=ev.json
attest prints nothing on success and writes ev.json with mode
0600. The document is JSON with the keys schema, kind
(shirudo-attestation), version_id, ts, boot_id, nonce,
pcr_bank, pcr_mask, pcrs, ak, ek, quote,
register, eventlog, config, credential,
ek_certificate and logs. Read the attestation key name to pin at
enrollment:
operator$ jq -r .ak.name ev.json
000b6e354140b22198138167393ecd1233cfc27e8b16ef0b2b60cce88563c5588dbc