AWS Setup for Enclave
Signing Certificate
Section titled “Signing Certificate”The signing certificate is used to sign the EIF file. Its SHA-384 hash becomes PCR8 — the KMS key policy condition that gates decryption.
-
Generate a signing keypair (do this once, store the key securely):
Terminal window openssl ecparam -name secp384r1 -genkey -noout -out signing_key.pemopenssl req -new -x509 -key signing_key.pem -out signing_cert.pem \-days 3650 -subj "/CN=containment-chamber" -
Extract the PCR8 hash (after building the EIF):
Terminal window nitro-cli build-enclave \--docker-uri containment-chamber:latest-enclave \--signing-certificate signing_cert.pem \--private-key signing_key.pem \--output-file enclave.eifnitro-cli describe-eif --eif-path enclave.eif | jq -r '.Measurements.PCR8'# → abc123def456... (your PCR8 hash) -
Extract the PCR0 hash (changes on every rebuild):
Terminal window nitro-cli describe-eif --eif-path enclave.eif | jq -r '.Measurements.PCR0'# → 789xyz... (your PCR0 hash)
Terraform Configuration
Section titled “Terraform Configuration”Use the enclave Terraform example to create the infrastructure with attestation-gated KMS key policies:
cd terraform/examples/enclave
terraform initterraform apply \ -var 'primary_profile=account-a' \ -var 'secondary_b_profile=account-b' \ -var 'secondary_c_profile=account-c' \ -var 'enclave_signing_cert_hash=<PCR8_HASH>' \ -var 'enclave_pcr0_hashes=["<PCR0_HASH>"]'KMS Key Policy Structure
Section titled “KMS Key Policy Structure”The Terraform example creates KMS key policies with:
kms:Decrypt— requires PCR8 (always) + PCR0 (when provided) + PCR3 (optional)kms:Encrypt— no attestation condition (safe: first-boot only, over TLS)
# PCR8 — signing certificate hash (required)# PCR0 — image hash (required for production)# PCR3 — parent IAM role hash (optional, extra lockdown)IAM Configuration
Section titled “IAM Configuration”The signer IAM role needs:
- DynamoDB access (keystore + antislashing tables)
- KMS access for table encryption keys (via IAM policy)
- KMS access for Shamir keys (via KMS key policy — no IAM policy needed)
For EKS deployments, configure IRSA or EKS Pod Identity:
# IRSAkubectl annotate serviceaccount containment-chamber \ eks.amazonaws.com/role-arn=arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME
# EKS Pod Identityaws eks create-pod-identity-association \ --cluster-name my-cluster \ --namespace default \ --service-account containment-chamber \ --role-arn arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME