Skip to content

Production NSM Verifier: real COSE_Sign1/CBOR decode + X.509 chain to the AWS Nitro root #5

Closed

Description

@scttfrdmn

The nitro provider (#1, evidence v0.2.0) defines Source and Verifier as injected interfaces so the evidence kernel module stays stdlib-only. The provider ships with the universal appraisal logic (nonce binding, PCR policy, claim emission) but no production Verifier — tests use a stub.

A real deployment needs an implementation that:

  • decodes the COSE_Sign1 / CBOR attestation document (a CBOR lib, e.g. fxamacker/cbor + veraison/go-cose),
  • verifies the document signature and that the cabundle cert chain anchors to the AWS Nitro Attestation PKI root,
  • parses module_id, nonce, PCR map, timestamp into nitro.NSMDoc,
  • and a Source that calls the enclave NSM device (Nitro SDK get-attestation-document, supplying the caller nonce).

Where it lives: NOT in the kernel module (which must stay zero-dep). Put it in a subpackage with its own go.mod (e.g. providers/nitro/awsnsm) or in the consuming tool. Decide when a consumer (ground#12 / attest#104) actually wires real enclaves.

Refs: ADR 0001, #1.

Activity

  1. added
    type:feature
    on Jun 9, 2026
  2. scttfrdmn commented on Jun 9, 2026

    @scttfrdmn
    ContributorAuthor

    Implemented in the nitro tool: github.com/provabl/nitro/internal/nsm (v0.1.0).

    • COSE_Sign1/CBOR decode via veraison/go-cose + fxamacker/cbor (doc.go).
    • Embedded AWS Nitro Attestation PKI root (AWS_NitroEnclaves_Root-G1.pem, verified SHA256 64:1A:03:…:5B, CN=aws.nitro-enclaves) + X.509 cabundle chain verification to it, and the COSE ES384 signature check against the leaf (verifier.go).
    • File document source + a /dev/nsm device source behind the nsm build tag (source_*.go).

    Kept out of the kernel as planned — the evidence module stays stdlib-only; the producer depends on it. Tested deterministically with a self-signed ES384 fixture (no AWS/enclave needed): valid / wrong-root / tampered, plus the embedded-root subject check.

    Honest limit: the NSM device ioctl seam (nsmAttest) is compiled + documented but unverified off-enclave (AWS ships no Go NSM SDK).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:providerstype:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions