synos-attest-tpm2 — TPM2 attestation CLI
tags: [general]
synos-attest-tpm2 — TPM2 attestation CLI
Section titled “synos-attest-tpm2 — TPM2 attestation CLI”Classification: PUBLIC
Crate: fruit/crates/synos-attest-tpm2/
Milestone: v42+
License: Apache-2.0
Version: v111.0.0 “Last Light”
What It Is
Section titled “What It Is”synos-attest-tpm2 is a TPM 2.0 PCR attestation CLI and library for Syn_OS, reading PCRs 0-7+14 via tss-esapi and producing serde-serialisable AttestationReport records that can be verified against operator-supplied PcrPolicy files. It gracefully degrades when no TPM hardware is present, returning AttestResult::TpmUnavailable instead of panicking. The crate replaces the legacy synos-tpm-attest envelope API via compatibility re-exports, making migration a simple crate-name change.
Architecture
Section titled “Architecture”Modules
Section titled “Modules”| Module | Purpose |
|---|---|
pcr | PCR read path: read_pcrs() opens ESAPI context, reads PCRs 0-7+14, returns PcrSet |
report | Attestation report generation (attest) and AttestationReport serde serialization |
policy | PcrPolicy loader from TOML files and verify() pure-function policy checker |
findings | Findings emission to /var/log/synos/findings.jsonl for integration with synos-findings-store |
compat | Legacy API compatibility layer re-exporting EnvelopeReport, produce_report_tpm, produce_report_simulated, etc. |
error | AttestError type with IO, TPM, and policy error variants |
How It’s Wired
Section titled “How It’s Wired”- tss-esapi — The
pcrmodule usestss-esapi(already a workspace dependency, zero new Cargo.lock entries) for hardware PCR reads. When/dev/tpmrm0or/dev/tpm0are absent, context open fails gracefully. - synos-findings-store — The
findingsmodule emits attestation results as structured findings to/var/log/synos/findings.jsonl, making TPM state observable to ALFRED,synos-doctor, and the security findings pipeline. - Policy verification —
verify()is a pure function: it never performs I/O, making it safe to call from async contexts, test harnesses, and policy-as-code pipelines. - Compatibility API —
compatre-exports the fullsynos-tpm-attestenvelope API (EnvelopeReport,PcrMeasurement,ReportMode,produce_report_simulated,produce_report_tpm,read_envelope_report,write_envelope_report) so consumers migrate by changing only the crate name. - TOML policy —
toml0.8 parses operator-supplied/etc/synos/attest-policy.tomlfiles intoPcrPolicystructures for expected PCR value assertions.
Future Ideas
Section titled “Future Ideas”- Add
synos-attest-tpm2-remotefor TPM 2.0 remote attestation using the Attestation Key (AK) and EK certificate chain. - Implement
policyas a Datalog-like DSL for complex PCR correlation rules across multiple boot events. - Wire attestation results into
synos-icarusso that PQC key generation can be gated on verified TPM boot state.