DARE UK Sprint Project: Trusted Research Environment and Enclave for Hosting Open Original Science Exploration - Secure Enclave
A Secure Enclave is a containment mechanism to provide isolated compute resources with restricted communication. This implementation uses the AWS Nitro Enclaves technology available for Amazon EC2 instances. The integrity of the contents is verified using cryptographic methods and the execution of code inside the enclave requires access to a decryption key managed using AWS KMS.
The TREEHOOSE Secure Enclave is designed to be integrated with EC2 Linux instances running inside a TREEHOOSE Trusted Research Environment (TRE). TRE researchers can perform research activities using protected 3rd party application code which they cannot see, but they can execute using their own data and retrieve the results.
Below diagram explains the high level design and key components for the secure enclave capability. It highlights the key integration points between a third party providing the application code and the TRE used to execute the third party's application against a research dataset.
The user guide to create and operate the secure enclave inside a TREEHOOSE TRE environment is available in the RUNBOOK with step by step instructions.
- Client Application - EC2 Instance
- Covers the client application Python code
- Server Application - Enclave
- Covers the server application Python code
- Encryption
- Covers the encryptor application Python code
- Covers the automated application encryptor CloudFormation template
- Covers usage of AWS IAM and AWS KMS to define controlled policies
- Nitro Enclave Image Builder
Common issues encountered with using secure enclaves are captured in a troubleshooting guide.
TREEHOOSE-secure-enclave has adopted a Code of Conduct that we expect project participants to adhere to.
Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to integrate your changes in this repository.
The working of secure enclave is dependent on boiler plate code
written in Python which is reusable. Some modules like pickle and subprocess
are being used to securely enable communication between client and server (running
within the enclave).
The findings from Flake8 and Bandit are accepted using the standard
noqa
and nosec
annotations.
Healthcheck not included in docker images as the application does not need one in current state.
- Enable server access logging on third party and enclave utility buckets
- Keep enclave utility dependencies updated using this as reference
- Consider using a non-root user in DockerFile
- Consider using specific tags for images instead of latest
This project is licensed under the Apache-2.0 License.