系统证明(CPU)
在跑业务前,用密码学证据确认:实例真的开了机密计算,且启动链是你期望的那一套。CPU 与 GPU 分开证明;本页只讲 CPU。GPU 见 GPU 证明。
先确认实例名称旁有 机密计算 标签,SSH 进去后再测。
#先判断是 TDX 还是 SEV-SNP
sudo dmesg | grep -iE 'tdx: Guest|Memory Encryption|sev-snp|SEV-SNP'
ls -la /dev/tdx_guest /dev/sev-guest 2>&1
| 线索 | 走哪条 |
|---|---|
Memory Encryption Features active: AMD SEV SEV-ES SEV-SNP,且有 /dev/sev-guest | AMD SEV-SNP |
tdx: Guest detected / Intel TDX,且有 /dev/tdx_guest | Intel TDX |
nvidia-smi conf-compute -q 里的 CPU CC Capabilities 可交叉确认。
RTX PRO 6000 CC 样机实测为 SEV-SNP(不是 TDX)。
#AMD SEV-SNP(实测通过)
确认已启用
sudo dmesg | grep -i sev-snp
# 期望:Memory Encryption Features active: AMD SEV SEV-ES SEV-SNP
# systemd 也可能打印:Detected confidential virtualization sev-snp
固件副本在:
ls -la /boot/OVMF.amdsev.fd /boot/vmlinuz /boot/initrd.img
sha256sum /boot/OVMF.amdsev.fd
# 样机:fea1855b6c983324246e6d3fb6642be200c0a38fd17b94884a45130ffb0b3a81
用 snpguest 证明
# 一次性
curl -fsSL https://github.com/virtee/snpguest/releases/download/v0.10.0/snpguest \
-o /usr/local/bin/snpguest && chmod +x /usr/local/bin/snpguest
snpguest ok
# 期望 SEV / SEV-ES / SNP 均为 ENABLED;Debug Swap 等为 DISABLED
取报告、拉证书、校验(Turin 代用 turin):
mkdir -p /tmp/snp-attest
snpguest report /tmp/snp-attest/report.bin /tmp/snp-attest/nonce.bin --random
snpguest fetch ca pem /tmp/snp-attest/ turin
snpguest fetch vcek pem /tmp/snp-attest/ /tmp/snp-attest/report.bin
snpguest verify certs /tmp/snp-attest/
snpguest verify attestation /tmp/snp-attest/ /tmp/snp-attest/report.bin
样机通过时可见:
- - ARK 自签 → ASK 由 ARK 签 → VCEK 由 ASK 签
- - 报告 TCB 与证书一致
- -
VEK signed the Attestation Report! - -
Debug Allowed: false(snpguest display report ...)
核对启动测量(MATCH)
用 sev-snp-measure 按机内固件 + kernel + initrd + cmdline 重算,与报告 Measurement 比对:
# 一次性
apt-get update && apt-get install -y pipx
pipx install sev-snp-measure
export PATH="$HOME/.local/bin:$PATH"
# 报告中的 Measurement(去掉空格)
snpguest display report /tmp/snp-attest/report.bin | sed -n '/^Measurement:/,/^Host Data:/p'
# 去掉 cmdline 前导 initrd=... 一项再算
CMDLINE=$(sed 's/^initrd=[^ ]* //' /proc/cmdline)
# vCPU 数量与类型以机内为准:样机 30 × EPYC-Turin
sev-snp-measure --mode snp \
--vcpus=$(nproc) --vcpu-type=EPYC-Turin \
--ovmf=/boot/OVMF.amdsev.fd \
--kernel=/boot/vmlinuz \
--initrd=/boot/initrd.img \
--append="$CMDLINE"
样机结果:Expected 与 Report Measurement 完全一致(MATCH)。
vcpu-type 必须匹配 CPU 代际(Turin 用 EPYC-Turin;错用 Genoa/v4 会对不上)。
内核升级后下次平台侧重新开机,测量会变——把可信构建的 hex 存档以便对比。
#Intel TDX
若 dmesg 显示 TDX(本台 RTX PRO 6000 CC 样机不是这条):
sudo dmesg | grep -iE 'tdx: Guest|Memory Encryption'
# 期望:tdx: Guest detected / Memory Encryption Features active: Intel TDX
固件常见 /boot/OVMF.inteltdx.fd。证明走 Intel DCAP / quote(/dev/tdx_guest),关注:TD debug DISABLED、quote 对 Intel 根校验通过、TCB OK、kernel/initrd/cmdline 与事件日志 MATCH。远程方应用 nonce 绑定 quote 再验;无 nonce 不能证明新鲜度。
(TDX 逐步命令随工具包版本变化;有 TDX 机型时再按机内预置脚本或 Intel 公开工具补跑。)