Generate a certificate inside the enclave #2162
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why this change is needed
We want to guarantee e2e encryption between the user and the gateway. To have this we need to terminate our https connection inside the enclave and this means also generating a certificate within the enclave.
What changes were made as part of this PR
Description of what is happening behind the scenes in library
We use
autocert
library and callGetCertificate
to obtain the certificate.If check if the cert already exists and proceeds to obtain it only in case it doesn't.
Generating a certificate consists of the following steps:
Certificate and private key are stored on a mounted volume (same as sealed key for database key encryption) and this private key is then used also for renewing the certificate and in case of restarts/upgrades of the gateway.
PR checks pre-merging
Please indicate below by ticking the checkbox that you have read and performed the required
PR checks