Encrypt Enclave Secrets with Seal
The Seal-Nautilus pattern provides secure secret management for enclave applications, where you can encrypt any secrets for an enclave binary.
You can define a Seal policy configured with specified Platform Configuration Registers (PCRs) of the enclave. Then, encrypt data using Seal with a fixed ID. Only the enclave with the given PCRs can decrypt it.
This pattern has been tested using self-managed TEEs. It has not been tested using Marlin Oyster deployments.
Components
The following example that demonstrates the Seal-Nautilus pattern uses the following components:
-
Nautilus server running inside AWS Nitro Enclave (
src/nautilus-server/src/apps/seal-example): This is the only place that the Seal secret can be decrypted according to the policy. It exposes port 3000 to the internet with the/get_attestationand/process_dataendpoints. It also exposes port 3001 to the localhost with 3/adminendpoints that can only be used to initialize and complete the key load steps on the host instance where the enclave runs. -
Seal CLI: In particular,
encryptandfetch-keysare used for this example. -
Move contract
move/seal-policy/seal_policy.move: Defines theseal_approvepolicy that verifies the signature committed to the wallet public key using the enclave ephemeral key.
View the example's full source code.