Repository navigation
fix(attest): derive Nitro Enclave device_id from the EC2 instance id - #1302
Merged
Merged
Conversation
kvinwang
force-pushed
the
fix/nitro-enclave-device-id
branch
2 times, most recently
from
September 22, 2026 01:20
b372e3a to
91af2bc
Compare
kvinwang
force-pushed
the
fix/nitro-enclave-device-id
branch
from
September 22, 2026 01:32
91af2bc to
5b6e294
Compare
kvinwang
added a commit
that referenced
this pull request
Sep 25, 2026
…ed cases #1247 hashes the SNP chip_id into device_id, #1343 requires a 20-byte SNP app_id, #1302 derives the Nitro Enclave device_id from PCR4, and #1303 gates Nitro Enclave key release. Record the expected results in the capability- blocked platform cases, and note in tc-kms-keys-certs-003 that public handover stays on by default (#1307). Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 8, 2026
…ed cases #1247 hashes the SNP chip_id into device_id, #1343 requires a 20-byte SNP app_id, #1302 derives the Nitro Enclave device_id from PCR4, and #1303 gates Nitro Enclave key release. Record the expected results in the capability- blocked platform cases, and note in tc-kms-keys-certs-003 that public handover stays on by default (#1307). Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 8, 2026
…ed cases #1247 hashes the SNP chip_id into device_id, #1343 requires a 20-byte SNP app_id, #1302 derives the Nitro Enclave device_id from PCR4, and #1303 gates Nitro Enclave key release. Record the expected results in the capability- blocked platform cases, and note in tc-kms-keys-certs-003 that public handover stays on by default (#1307). Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 10, 2026
…ed cases #1247 hashes the SNP chip_id into device_id, #1343 requires a 20-byte SNP app_id, #1302 derives the Nitro Enclave device_id from PCR4, and #1303 gates Nitro Enclave key release. Record the expected results in the capability- blocked platform cases, and note in tc-kms-keys-certs-003 that public handover stays on by default (#1307). Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 11, 2026
…ed cases #1247 hashes the SNP chip_id into device_id, #1343 requires a 20-byte SNP app_id, #1302 derives the Nitro Enclave device_id from PCR4, and #1303 gates Nitro Enclave key release. Record the expected results in the capability- blocked platform cases, and note in tc-kms-keys-certs-003 that public handover stays on by default (#1307). Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 11, 2026
…ed cases #1247 hashes the SNP chip_id into device_id, #1343 requires a 20-byte SNP app_id, #1302 derives the Nitro Enclave device_id from PCR4, and #1303 gates Nitro Enclave key release. Record the expected results in the capability- blocked platform cases, and note in tc-kms-keys-certs-003 that public handover stays on by default (#1307). Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 16, 2026
…ed cases #1247 hashes the SNP chip_id into device_id, #1343 requires a 20-byte SNP app_id, #1302 derives the Nitro Enclave device_id from PCR4, and #1303 gates Nitro Enclave key release. Record the expected results in the capability- blocked platform cases, and note in tc-kms-keys-certs-003 that public handover stays on by default (#1307). Signed-off-by: Kevin Wang <wy721@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GetDeviceId for DstackVerifiedReportsplits an NSM module ID on the first hyphen:For the currently observed Nitro Enclave module ID shape, the extracted value is the literal string
"i"for every enclave.AppInfo::device_idissha256(get_devide_id()), so every Nitro Enclave reports the same device ID. Consequently,DstackApp.isAppAllowedcannot useallowedDeviceIdsto distinguish parent EC2 instances.The committed real capture
dstack-attest/tests/nitro_attestation.bindemonstrates the bug through the full COSE-verified path.Fix
Use attested PCR4 as the Nitro Enclave device identity. AWS documents PCR4 as the SHA-384 measurement of the parent EC2 instance ID. Unlike parsing
module_id, this uses an explicitly defined attestation field and does not depend on the opaque hypervisor module ID current string representation.NitroPcrsnow retains PCR4 from the signature-verified PCR map, andGetDeviceIdreturns that measurement. The real attestation fixture asserts its expected PCR4 and the serialized report snapshot now includes it.Verification
cargo fmt --all -- --checkgit diff --check7b3574ad9b7e88ec8335e8ce967315fac77218441e97eea9795de704d7f2678d0b298ecda39b544c1689669f48cba5e8, matchingSHA384(48 zero bytes || "i-0827e799ec9232d44")The complete GitHub Actions suite passed on the previous revision; the final parser-path hardening is being revalidated by CI.
Deployment note
This changes
device_idfor Nitro Enclave deployments. AnyDstackAppcontract withallowAnyDevice = falsemust add the new value before its enclaves can boot against an upgraded KMS. The new contract value issha256(PCR4). Apps withallowAnyDevice = trueare unaffected.Nothing meaningful is invalidated by the change: the old value carried no per-instance information, so no existing allowlist entry was distinguishing devices.
No other platform is affected.