Quick check
document field is a COSE_Sign1 structure signed by the Nitro Secure Module (NSM). It chains to AWS’s Nitro Attestation PKI root certificate. The nonce you provide is embedded in the document, proving it was generated fresh for your request.
If the worker is not running in an enclave, the endpoint returns enclave: false with an error.
What’s in the attestation document
The COSE_Sign1 document contains a CBOR-encoded payload with:| Field | Description |
|---|---|
module_id | Enclave instance identifier |
timestamp | When the document was generated (milliseconds since epoch) |
pcrs | Platform Configuration Registers (PCR0 = enclave image hash, PCR1 = kernel, PCR2 = application) |
nonce | Your nonce, echoed back to prove freshness |
certificate | The NSM signing certificate (X.509 DER) |
cabundle | Certificate chain from the NSM cert to the AWS Nitro root CA |
Verification steps
1. Decode the document
Thedocument field is base64-encoded. Decode it, then parse as CBOR. The outer structure is COSE_Sign1: [protected_headers, unprotected_headers, payload, signature].
The payload is another CBOR-encoded map containing the attestation fields above.
2. Check the nonce
Extract thenonce field from the payload and confirm it matches what you sent. This proves the document was generated for your specific request, not replayed from an earlier one.
3. Verify PCR values
PCR0 is the hash of the enclave image. Each build produces a deterministic PCR0 value. You can compare it against the expected value to confirm the exact code running inside the enclave. Current PCR values are published by CI after each build and served at the same endpoint.4. Verify the signature
The COSE_Sign1 signature covers["Signature1", protected_headers, external_aad, payload]. Verify it using the public key from the certificate field. Then validate the certificate chains through cabundle to the AWS Nitro Attestation PKI root.
This confirms the document was produced by a real Nitro Secure Module, not fabricated.
Example: JavaScript verification
Why this matters
The attestation document proves three things:- The worker runs in a Nitro Enclave (the NSM signature is unforgeable outside real hardware)
- The exact code is what you expect (PCR0 matches the published build hash)
- The proof is fresh (your nonce is embedded in the signed document)