Library to bootstrap WSGI/ASGI application for Gramine
Project description
Cosmian Enclave Lib SGX
Overview
Cosmian Enclave lib SGX bootstraps the execution of an encrypted ASGI/WSGI Python web application for Gramine.
The library is responsible for:
- Configuring the SSL certificates with either:
- RA-TLS, a self-signed certificate including the Intel SGX quote in an X.509 v3 extension
- Custom, the private key and full keychain is provided by the application owner
- No SSL, the secure channel may be managed elsewhere by an SSL proxy
- Decrypting Python modules encrypted with XSala20-Poly1305 AE
- Running the ASGI/WSGI Python web application with hypercorn
Technical details
The flow to run an encrypted Python web application is the following:
- A first self-signed HTTPS server using RA-TLS is launched waiting to receive a JSON payload with:
- UUID, a unique application identifier provided to
enclave-bootstrap
as an argument - the decryption key of the code
- Optionally the private key corresponding to the certificate provided to
enclave-bootstrap
(for Custom certificate)
- UUID, a unique application identifier provided to
- If the UUID and decryption key are the expected one, the configuration server is stopped, the code is decrypted and finally run as a new server
Installation
$ pip install cenclave-lib-sgx
Usage
$ cenclave-bootstrap --help
usage: cenclave-bootstrap [-h] [--host HOST] [--port PORT] [--subject SUBJECT] [--san SAN] --app-dir
APP_DIR --id ID [--plaincode] [--timeout TIMEOUT] [--version] [--debug]
(--ratls EXPIRATION_DATE | --no-ssl | --certificate CERTIFICATE_PATH)
application
Bootstrap ASGI/WSGI Python web application for Gramine
positional arguments:
application ASGI application path (as module:app)
options:
-h, --help show this help message and exit
--host HOST hostname of the server
--port PORT port of the server
--subject SUBJECT Subject as RFC 4514 string for the RA-TLS certificate
--san SAN Subject Alternative Name in the RA-TLS certificate
--app-dir APP_DIR path of the python web application
--id ID identifier of the application as UUID in RFC 4122
--plaincode unencrypted python web application
--timeout TIMEOUT seconds before closing the configuration server
--version show program's version number and exit
--debug debug mode with more logging
--ratls EXPIRATION_DATE
generate a self-signed certificate for RA-TLS with a specific expiration date
(Unix time)
--no-ssl use HTTP without SSL
--certificate CERTIFICATE_PATH
custom certificate used for the SSL connection, private key must be sent through
the configuration server
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cenclave_lib_sgx-1.0.0.tar.gz
(15.4 kB
view details)
Built Distribution
File details
Details for the file cenclave_lib_sgx-1.0.0.tar.gz
.
File metadata
- Download URL: cenclave_lib_sgx-1.0.0.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b09d39024c084e37b83ae7904ca5eb3f4e5929a4de3e350491d8e291c5bdf1a3 |
|
MD5 | c6b0562b5ed7908d1e941e3eedd7f308 |
|
BLAKE2b-256 | 9f4dfe40dca9ccf314ba9b8038e3c09ac861bd5dfb8627fca569cfffecb2d642 |
File details
Details for the file cenclave_lib_sgx-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: cenclave_lib_sgx-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44dee57c57d5c3db2896ef62026a1f0fb951c6ecf217bc99f5807e632c7121ae |
|
MD5 | e85ad6dcd6ae190bd3fb98bf4832eb19 |
|
BLAKE2b-256 | a85defd3eac700d2bbed7206d765e24f62ac3877400b482f0ccd534030338944 |