cdk: Fix nginx-conf.sh configuration for AL2023 2023.7 release
The latest AL2023 2023.7 release made changes to the
/etc/pki/tls/openssl.cnffile that broke the line at https://github.com/aws/aws-nitro-enclaves-acm/blob/main/cdk/src/assets/user-data-scripts/AL2023/nginx-conf.sh#L19Instead of modifying the openssl.cnf file directly, this change creates a new file
/etc/pki/tls/openssl.d/openssl-acm.cnfwhich is included in the mainopenssl.cnffile. The newopenssl-acm.cnffile contains the necessary configuration for the ACM use case.This more generic solution should be robust against future changes to
openssl.cnf, as the ACM-specific configuration is isolated in a separate file.Signed-off-by: Othmane Belhoussine belhou@amazon.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
AWS Certificate Manager for Nitro Enclaves
This is a PKCS#11 provider intended to be executed within the confines of a Nitro Enclave.
Development is aided by Docker containers that can be used to build and test run the PKCS#11 provider as a
p11-kitmodule. These containers are designed to be mostly transparent to the developer, and employed via the omnitool attools/devtool.How to install and setup
The user guide for the ACM for Nitro Enclaves can be found at https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-refapp.html.
Using AWS CDK
For automated deployment using AWS CDK, please refer to the CDK deployment guide.
Managed tokens
Each token can store an end-entity private key and its associated ACM certificate chain. Up to 128 SSL/TLS X.509 ACM certificates can be managed via provisioned tokens by the nitro-enclaves-acm service. Configuration options can be found in the
/etc/nitro_enclaves/acm.yamlpost service installation.Design Overview
ACM for Nitro Enclaves is a PKCS#11 provider (i.e. a dynamic library exposing the PKCS#11 API). The
p11-kitclient and server are used to transport crypto operation calls from the parent instance to the enclave, where they are handled by this provider via the AWS cryptographic library.Here is the general flow of a parent instance crypto operation:
Dependencies
devtoolsets up two containers: one for emulating the enclave environment, and another for emulating the parent instance environment.If using Docker is not an option, have a look at the Dockerfile for a full list of packages needed to build and run the ACM for Nitro Enclaves module. Additionally, the
devtoolsource (it’s just a BASH script) may provide useful details on what environment setup is required prior to building and/or running.Components
ACM for Nitro Enclaves has a few different components, some meant to be run inside the enclave, others inside the parent instance:
p11ne-srv- the AWS for NE RPC server, used to query the state of the pkcs#11 enclavelibvtok_p11.so- the PKCS#11 provider implementation;p11ne-client- the ACM for NE RPC client, providing a low-level interface top11ne-cli- a user-facing CLI tool that can be used to manage thep11ne-db- a user-facing CLI tool that can be used to pack a private key andBuilding
Use
devtoolto build any ACM for NE component, by invokingdevtool build <component>.E.g. building the PKCS#11 provider:
Building the (development version of) ACM for NE enclave image (EIF):
See
devtool helpfor more build options.Testing in the development environment
devtooluses development containers to simulate both the enclave and parent instance environments. The communication channel betweenp11-kit clientandp11-kit serveris emulated via a Unix socket, bind-mounted into both container environments (parent and enclave).Note: The emulated enclave environment differs substantially from the production enclave, and it is only to be used for testing the PKCS#11 API functionality of the ACM for Nitro Enclaves module. Most notably, attestation and token provisioning are both missing from the emulated environment.
First, the enclave container needs to be running:
This will start
p11-kit serverwith the ACM for Nitro Enclaves module loaded (the module is first built if unavailable). The server is run in foreground mode, so the pkcs#11 provider module log will show up atstderr.With the enclave environment up and running, the parent environment can be started:
This will spin up a container with p11-kit configured to access the remote module exposed by the enclave container via a Unix socket.
devtool simulate-parentstarts a BASH shell, so the user can manually test / inspect the functionality of the ACM for Nitro Enclaves module; for instance, via runningopensslmanually, directed to use the PKCS#11 engine and a URI pointing to the pkcs#11 provider module token:The
testsdirectory contains integration tests that can be executed to validate the PKCS#11 module functionality using openssl or OpenSC pkcs11-tool.Build the testhelper binary:
After this, the test suite can be executed via the command:
The above cryptographic test suite is applicable when using real enclaves on EC2 instances where an instance role and a KMS key has already been setup accordingly for provisioning the test pkcs#11 token with the private keys.
License
This project is licensed under the Apache-2.0 License.
Security issue notifications
If you discover a potential security issue in ACM for Nitro Enclaves, we ask that you notify AWS Security via our vulnerability reporting page. Please do not create a public GitHub issue.