A simple command-line tool that runs in AWS Nitro Enclaves to test the TEE (Trusted Execution Environment) attestation verifier service.
This binary retrieves an AWS Nitro Enclaves attestation document (from the NSM device when available, otherwise a mock for local testing), sends it to a verifier over vsock, and validates the returned EIP-712 signature locally.
It is both:
- a minimal tester for a TEE attestation verifier, and
- a runnable example showing how to interact with a verifier service from inside an enclave.
- Build environment for Linux AMD64.
- Running inside AWS Nitro Enclaves for real attestation (NSM). For local/dev, the app falls back to a mock attestation document.
- A verifier service listening on the parent (CID 3) vsock port
8001with endpointPOST /v1/attestations.
USER_PUBLIC_KEY: The user public key to embed in the attestation request (string bytes passed to NSM asPublicKey).SIGNER_PUBLIC_KEY: Hex-encoded uncompressed ECDSA public key of the verifier signer (used to verify the EIP-712 signature). Example:0x04....
See .env.example for a template.
Request (JSON):
{
"data": {
"type": "attestations",
"attributes": {
"attestation": "<base64 attestation document>",
"domain": { "name": "TEE-Verifier-Tester", "version": "1" },
"primary_type": "Register",
"fields_to_sign": ["pcr0", "public_key"]
}
}
}Response (JSON):
{
"data": {
"type": "attestations",
"attributes": { "signature": "<base64 65-byte signature>" }
}
}- Clone the repo:
git clone https://github.com/EspressoSystems/tee-verifier-tester.git
cd ./tee-verifier-testerCopy the example and edit it:
cp .env.example .envEdit .env and set the keys:
# User's Public Key (to be included in the attestation document)
# This is YOUR public key that will be attested
USER_PUBLIC_KEY=0x89c0f5e272BE0DfBc1fe738209b45f06e1040219
# Signer's Public Key (for signature verification)
# This is the public key of the attestation verifier service
# Format: uncompressed ECDSA public key (64 bytes, hex-encoded)
# Example: 0x04[64 hex chars]
SIGNER_PUBLIC_KEY=0x14d85b7f750456a2a50017d5f6b99a9b9a7a2adf4e420101f9a424aa87ce083230fe47953fb408639cd9d0a5aad575ccd7644f2b651754af6153acbf1f27fbc86cNotes:
SIGNER_PUBLIC_KEYshould be the public key of the verifier you obtained earlier.USER_PUBLIC_KEYcan be an address-like string (as shown above); it is passed into the NSM as report data.
Run socat on the parent instance to forward vsock port 8001 to the verifier's TCP endpoint:
sudo socat -d -d VSOCK-LISTEN:8001,fork,reuseaddr TCP:13.214.208.180:8000 &Explanation:
13.214.208.180is the public IP where the Attestation Verifier is running.8000is the verifier's TCP port.
docker build . -t tee-verifier-tester && \
nitro-cli build-enclave --docker-uri tee-verifier-tester:latest --output-file tee-verifier-tester.eifRun the enclave and attach the console in one line:
nitro-cli run-enclave \
--eif-path tee-verifier-tester.eif \
--cpu-count 2 \
--memory 512 \
--enclave-cid 16 \
--debug-mode \
--enclave-name tee-verifier-tester && \
nitro-cli console --enclave-name tee-verifier-testerNotes:
- The program inside the enclave connects via vsock to the parent at CID
3and port8001(which you bridged with socat). - Adjust
cpu-count,memory, orenclave-cidas needed for your environment.