Commit bfefed4
authored
SEV_SNP attestations support (#88)
* [FEAT] SEV-SNP attestation verifier (WIP): protos, certs, fixtures, envelope foundation
Adds the SEV-SNP combined-attestation verifier under src/server/utils/sev-snp,
replacing the dead Nitro path (dispatch wiring + crypto legs to follow). Includes
ts-proto decoders for go-tpm-tools/go-sev-guest, pinned roots (Nitro, Google vTPM,
AMD Milan VCEK/VLEK), real GCP+AWS hardware fixtures, and the envelope/binding
helpers + nonce-key extraction (fixture-tested, 2/2).
* [FEAT] SEV-SNP: NitroTPM COSE_Sign1 (ES384) verifier, fixture-tested
Verifies the AWS NitroTPM document: COSE_Sign1 ES384 signature against the leaf,
leaf->cabundle->pinned Nitro root chain (node X509, P-384), and returns PCR8/PCR11
+ user_data. Test against the real aws_combined.b64 confirms the COSE sig, chain,
user_data==sha512(nonceCommitment) binding, PCR11=base, and PCR8=expectedPCR8(app,
SHA-384). now-param so production uses the real clock; tests use the leaf window.
* [FEAT] SEV-SNP AWS leg: SEV report + NitroTPM verifiers, end-to-end fixture-tested
Adds sev-report.ts (AMD report ABI reconstruction + ECDSA-P384 over SHA-384 +
VLEK->ASVK->ARK Milan chain + report_data binding) and verify.ts verifyAwsLeg /
verifyCombinedSevSnp assembling SEV + NitroTPM + PCR8/PCR11 + nonce-key
extraction. SEV protos moved to proto-sevsnp/ and regenerated with forceLong=
bigint (uint64 TCB/policy must not be lossy) + importSuffix=.ts (nodenext) via
generate-proto-sevsnp.sh. 5/5 tests reproduce the Go verifier on aws_combined.b64.
* [FEAT] SEV-SNP GCP leg: go-tpm-tools AK chain + TPM2 quote verifier, fixture-tested
gcp.ts verifyGcpLeg: decode go-tpm-tools Attestation, AK cert -> Google vTPM
root chain, SEV report (VCEK) bound to sha512(akPub||bound), AK-signed TPM2
quote (TPMS_ATTEST extraData==sha256(bound), PCR digest over provided PCRs) ->
PCR8/PCR11, PCR8==expectedPCR8(app, SHA-256). Wired into verifyCombinedSevSnp
dispatcher. 6/6 tests; GCP reproduces app=26d33fd8/base=edf6d8b9(SHA-256).
* [FEAT] SEV-SNP attestor dispatch: replace dead Nitro path, pin app+base
extractPublicKeys now dispatches attestationReport.type: 'gcp' -> CS JWT
(unchanged), 'sev-snp' -> verifyCombinedSevSnp; Nitro branch removed (dead
legacy). New allowlist.ts pins the cross-cloud app bundle (PCR8) and per-cloud
base UKI (PCR11) hashes — the SEV-SNP substitute for CS peer image_digest
cross-binding — seeded with the live pair and overridable via env. 7/7 tests.
* [FEAT] SEV-SNP attestor pins only base UKI, not app digest
Drop app-hash pinning: the attestor pins only the per-cloud base UKI (its root
of trust) and publishes the cross-cloud app digest into the claim context (via
pcr0) for the claim consumer to verify against its own policy. allowlist.ts now
exposes assertSevSnpBaseAllowed(base); BAKED_APPS / SNP_APP_ALLOWLIST removed.
* [FIX] SEV-SNP attestor: lint (absolute #src imports + import sort)
* [FEAT] SEV-SNP allowlist: pin one base per cloud (GCP + AWS)
One per-cloud base UKI: GCP edf6d8b9, AWS d06cfa5e. The AWS base is now stable
because the image build pins the kernel + systemd stub package versions (was
drifting on unpinned linux-image-aws). App digests are not pinned here.
* [REFACTOR] SEV-SNP: move certs/fixtures/protos out of src; unify proto-gen
Addresses PR review (keep certs & fixtures outside src):
- certs -> cert/sev-snp/ (existing root cert/ convention), fixtures ->
fixtures/sev-snp/. Loaded CWD-relative like the existing ./cert/ certs; the
server runs from the repo root (WORKDIR /app, COPY ./, npm start from src).
- proto-sevsnp/ -> proto/snp/; folded its codegen into generate-proto.sh (one
script, two protoc calls) and removed the standalone generate-proto-sevsnp.sh.
Regen verified byte-identical (google wrappers come from protoc's include).
- BAKED_BASES + the allowlist test updated to the current per-cloud bases
(GCP e51ea77d, AWS 48329081). verify.test.ts: 7/7 green.1 parent 217dd5a commit bfefed4
30 files changed
Lines changed: 14662 additions & 41 deletions
File tree
- cert/sev-snp
- fixtures/sev-snp
- proto/snp
- src
- proto
- google/protobuf
- scripts
- server/utils
- sev-snp
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
0 commit comments