Skip to content

Latest commit

 

History

History
88 lines (62 loc) · 3.41 KB

File metadata and controls

88 lines (62 loc) · 3.41 KB

AWS Nitro Enclave with TLS Termination

This pattern represents an example implementation of TLS termination within an AWS Nitro Enclave, i.e., serving an HTTPS web server from within an enclave.

Architecture

Deploying the solution with AWS CDK

Deploying the solution with the AWS CDK The AWS CDK is an open-source framework for defining and provisioning cloud application resources. It uses common programming languages such as JavaScript, C#, and Python. The AWS CDK command line interface (CLI) allows you to interact with CDK applications. It provides features like synthesizing AWS CloudFormation templates, confirming the security changes, and deploying applications.

This section shows how to prepare the environment for running CDK and the sample code. For this walkthrough, you must have the following prerequisites:

When working with Python, it’s good practice to use venv to create project-specific virtual environments. The use of venv also reflects AWS CDK standard behavior. You can find out more in the workshop Activating the virtualenv.

  1. Install the CDK and test the CDK CLI:

    npm install -g aws-cdk && cdk --version
  2. Download the code from the GitHub repo and switch in the new directory:

    git clone https://github.com/aws-samples/aws-nitro-enclave-blockchain-wallet.git && cd aws-nitro-enclave-blockchain-wallet
  3. Install the dependencies using the Python package manager:

    pip install -r requirements.txt
  4. Specify the AWS region and account for your deployment:

    export CDK_DEPLOY_REGION=us-east-1
    export CDK_DEPLOY_ACCOUNT=$(aws sts get-caller-identity | jq -r '.Account')
    export CDK_APPLICATION_TYPE=https_web_server
    export CDK_PREFIX=dev

    You can set the CDK_PREFIX variable as per your preference.

  5. Create the self-signed certificate:

    ./scripts/create_certificate.sh
  6. Deploy the example code with the CDK CLI:

    cdk deploy ${CDK_PREFIX}NitroHttpsWebServer
  7. Once the CDK deployment is successfully completed, copy the NLB DNS name from the Outputs section, and open it in a web browser. You will see a warning due to the self-signed certificate, which is expected. Accept and continue.

  1. You should be able to see the web page being served from inside the Nitro enclave.

Cleaning up

Once you have completed the deployment and tested the application, clean up the environment to avoid incurring extra cost. This command removes all resources in this stack provisioned by the CDK:

cdk destroy

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.