Skip to main content

Library for Cosmian MSE to bootstrap Flask application

Project description

MicroService Encryption Lib SGX

Overview

MSE 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 AEAD
  • Running the ASGI/WSGI Python web application with hypercorn

Technical details

The flow to run an encrypted Python web application is the following:

  1. 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 mse-bootstrap as an argument
    • the decryption key of the code
    • Optionally the private key corresponding to the certificate provided to mse-bootstrap (for Custom certificate)
  2. 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 mse-lib-sgx

Usage

$ mse-bootstrap --help
usage: mse-bootstrap [-h] --host HOST --port PORT --app-dir APP_DIR --uuid
                     UUID [--version] [--debug]
                     (--self-signed 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)

optional arguments:
  -h, --help            show this help message and exit
  --host HOST           hostname of the configuration server, also the
                        hostname of the app server if `--self-signed`
  --port PORT           port of the server
  --app-dir APP_DIR     path of the python web application
  --uuid UUID           unique application UUID
  --version             show program's version number and exit
  --debug               debug mode with more logging
  --self-signed EXPIRATION_DATE
                        generate a self-signed certificate for the web app
                        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

mse_lib_sgx-2.0a5.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

mse_lib_sgx-2.0a5-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file mse_lib_sgx-2.0a5.tar.gz.

File metadata

  • Download URL: mse_lib_sgx-2.0a5.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for mse_lib_sgx-2.0a5.tar.gz
Algorithm Hash digest
SHA256 0362a5b4ff5dbb65401a54985c335955297b82aa7786163390ec78a09dd885ce
MD5 c6b9f6b7b41e9b1c6fd461a7b148ffc4
BLAKE2b-256 707ced748c15cd6eb8b18dc791bc5331069273e82e795b23b1b15e2c6c9b1979

See more details on using hashes here.

File details

Details for the file mse_lib_sgx-2.0a5-py3-none-any.whl.

File metadata

  • Download URL: mse_lib_sgx-2.0a5-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for mse_lib_sgx-2.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 40dce419dff5eb5ecab55fd4ffa04dc8bfd4621fc364cace2bedc2928a1417da
MD5 411193945f104c7d8083cdf10990bf33
BLAKE2b-256 ef911bd8d3684889bc79a8c59281548d58cd41de6fdbe761a065594a44d23d4c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page