🛡️ spdm-attest
Hardware-rooted PCIe SPDM 1.2/1.3 measurement quote and responder certificate verifier for Confidential GPU enclaves.
spdm-attest completes Layer 1 & 2 of the Fox Hackerz Sovereign AI Zero-Trust Stack: validating PCIe SPDM (Security Protocol and Data Model) quotes, manufacturer DICE certificate chains (NVIDIA/AMD Root CAs), and golden firmware/VBIOS baselines before KMS keys are released or models loaded into VRAM.
🏛️ The Confidential GPU Attestation Gap
In modern sovereign AI infrastructure, multi-tenant GPU clusters (NVIDIA H100/H200/B200 Blackwell, AMD Instinct MI300X) run inside Confidential Computing environments:
- The Host Cannot Be Trusted: Hypervisors and host OS environments are outside the tenant's security perimeter.
- Silicon Root-of-Trust Attestation: Before an inference enclave or key management service (KMS) releases decryption keys, it must cryptographically challenge the GPU over PCIe DOE (Data Object Exchange) using DMTF SPDM.
- Firmware & Microcode Integrity: A compromised VBIOS, downgraded microcode, or disabled Confidential Compute (CC) mode allows host snooping over PCIe/NVLink.
spdm-attest provides an auditable, zero-bloat Rust binary and library to parse and cryptographically verify SPDM measurement quotes and certificate chains.
+----------------------------------------------------------------------------------------------------+
| FOX HACKERZ ZERO-TRUST SOVEREIGN AI STACK |
+----------------------------------------------------------------------------------------------------+
| Layer 4: Artifact Gate | stverify | Model weight (.safetensors) parallel Ed25519 signer/gate|
| Layer 3: Fabric Guard | enclave-xdp | eBPF/XDP driver-level RoCEv2 (UDP/4791) & CIDR monitor |
| Layer 1/2: Attestation | spdm-attest | PCIe SPDM 1.2/1.3 quote, DICE cert chain & PCR baseline |
+----------------------------------------------------------------------------------------------------+
✨ Features
- DMTF SPDM 1.2 / 1.3 Wire-Format Parser: Strict binary decoding of
MEASUREMENTSresponses,MeasurementBlocks, DMTF metric records, and nonces. - Cryptographic Quote Verification: Supports NIST P-384 (
TPM_ALG_ECDSA_ECC_NIST_P384), NIST P-256, and Ed25519 quote signatures. - X.509 / DICE Certificate Chain Validation: Validates device identity certificates through intermediate CAs up to a trusted hardware manufacturer Root CA.
- Replay Protection: Enforces fresh 32-byte initiator challenge nonces to prevent recorded quote replays.
- Golden Baseline Manifests: Compares hardware metrics (Secure Boot ROM, GPU Microcode, PCIe Security Registers, VBIOS) against known-good JSON baselines.
- Synthetic Evidence Generator: Includes
mock-generateto synthesize valid SPDM bundles for local testing and CI without needing physical $40,000 accelerators. - Structured JSON & Exit Codes: Emits detailed reports with per-measurement verdicts, designed for scripting in KMS boot pre-hooks.
📦 Installation
From crates.io
From Source
⚡ Quick Start
1. Generate Synthetic Mock Evidence (For Testing / CI)
Generated artifacts:
root_ca.pem: Manufacturer Root CAcert_chain.pem: SPDM responder certificate chainquote.bin: Raw binary SPDM quote (ECDSA P-384 signed)nonce.hex: Fresh 32-byte challenge noncegolden.json: Golden baseline manifest
2. Inspect SPDM Quote Structure
3. Verify Attestation Quote & Golden Measurements
Output:
============================================================
🛡️ SPDM Hardware Attestation Report
============================================================
Attestation Status : PASSED
SPDM Version : 0x12
Responder Algo : ECDSA-NIST-P384
Cert Chain Verified: true
Signature Verified : true
Replay Check (Nonce): PASSED
Total Blocks : 4
------------------------------------------------------------
Hardware Measurements:
[Block 1] Secure Boot ROM : ✅ MATCH
Digest: d24c0b7550ae4bcb3af423e428be3af4ffdadc6bf3a8b29fe35e2024e5bf73739f67779005c31a1520d08fea83b12657
[Block 2] GPU Microcode : ✅ MATCH
Digest: 176b87d0d9464b40c29aa2818b4407be4dbddb32c416a7ed47200afff11061fef13a22ccd745ddf5ee266f4f638593a6
[Block 3] Hardware Security Config : ✅ MATCH
Digest: 9e8f95dfee3064066f175fb512552c25f439b7a200ef65773e65af6403e9728df133f87d4be21de045fee0f85a6fb422
[Block 4] VBIOS Firmware : ✅ MATCH
Digest: 700d58c7e0d76385c0bf5b97dd261cc6adba6a06739e53ef73c08ad4b7f80933e1a2e8e4530b50538f41bec78d5940f5
============================================================
4. Machine-Readable JSON Output (for KMS Hook Scripts)
🛡️ Integration in KMS Boot Hook
In a Kubernetes or Confidential Virtual Machine (CVM) boot sequence, spdm-attest gates the retrieval of the model decryption key:
#!/bin/bash
# 1. Challenge GPU over PCIe DOE
NONCE=
# 2. Verify SPDM quote and firmware baseline
if ! ; then
fi
# 3. Request KMS model decryption key
🛠️ Rust Library Usage
use ;
let quote_bytes = read?;
let chain_bytes = read?;
let root_ca_bytes = read?;
let options = AttestationOptions ;
let report = verify_attestation?;
if report.success
📄 License
MIT License. Designed and maintained by Fox Hackerz.