Files
Li, Xun b0af6e75ac Linux 2.18 Open Source Gold Release
Along with the latest processor microcode address CVE-2022-21233.
  Modified the Switchless library to have mitigations for the associated issue.
Added support for the Linux kernel APIs for the Enclave Dynamic Memory
  Management (EDMM) features that are available with the Linux kernel v6.0 or
  later. Refer to the SGX SDK developer reference for details on new trusted
  APIs and enclave configuration for the EDMM features.
Enabled C++17 within SGX SDK.
Supported AMX (Advanced Matrix Extensions) in Enclave.
Replace hardcoded Enclave signing keys in all sample projects with dynamically
generated keys.
Added a new API to allow user to configure enclave internal cache size in the
  Protected File System library.
Upgraded to OpenSSL 1.1.1q and upgraded Intel(R) SGX Quote Verification Enclave
  to integrate SgxSSL/OpenSSL version 1.1.1q.
Supported new OS: Ubuntu* 22.04 LTS 64-bit Server version, CentOS* 8.3 64bits,
  Red Hat* Enterprise Linux* Server 8.6 (for x86_64), SUSE* Linux* Enterprise
  Server 15.4 64bits, Debian* 10 and Anolis* OS 8.6.
Upgraded Intel SGX QE3 to make it backward compatible.
Improved ECDSA quote generation and verification performance by caching PCK
  certificates and collaterals in memory and disk drive.
Added Java support for quote verification library.
Added new APIs to unify Intel SGX and TDX quote verification in Quote
  Verification Library.
Added Advisory ID in ECDSA quote verification supplemental data.
Added Intel TDX support in RA-TLS (Remote Attestation based TLS) library.
Improved TDX quote generation throughput in vsock mode.
Added Rust support for TDX quote generation.
Fixed bugs.

Signed-off-by: Li, Xun <xun.li@intel.com>
2022-11-24 13:48:25 +08:00

4.5 KiB

Build and run with Docker

Files in this directory demonstrate how to build and install the SGX SDK and PSW, and run SGX applications in Docker containers.

Quick Start

Prerequisites

  1. Install Docker and Compose and configure them properly following their respective installation guide.
  2. Install SGX Flexible Launch Control driver. Note: See below to run with the Legacy Launch Control driver.
  3. In the root directory of this repo, prepare source code and download prebuilt binaries:
$ make preparation

Run with Docker Compose

This will start AESM and an SGX sample on one terminal using docker-compose.

$ ./build_compose_run.sh

Run with Docker directly

Alternatively, you can run AESM and SGX sample containers in two separate terminals.

In one terminal,

$ ./build_and_run_aesm_docker.sh

In another terminal,

$ ./build_and_run_sample_docker.sh

Dockerfile

The Dockerfile specifies 5 image build targets:

  1. builder: Builds PSW and SDK bin and debian installers from source.
  2. aesm: Takes the PSW bin installer from builder to install and run the AESM daemon.
  3. sample: Installs the SDK installer and the PSW bin installer from builder. Then builds and runs the SampleEnclave app
  4. aesm_deb: Takes the PSW debian installer from builder to install and run the AESM daemon.
  5. sample_deb: Takes the SDK installer and the PSW debian installer from builder to install. Then builds and runs the SampleEnclave app.

Legacy Launch Control driver and kernel for SGX

All SGX applications need access to the SGX device nodes exposed by the kernel space driver. Depending on the driver or kernel you are using, the SGX device nodes may have different names and locations. Therefore, you need to ensure those nodes are mapped and mounted inside the containers properly.

SGX kernel patches are upstream now and included in main line kernel release 5.11 or later. The Flexible Launch Control driver is developed to imitate the kernel patches as closely as possible. It can be used for distros with kernels older than 5.11.

The sample scripts and Compose files are compatible with the Flexible Launch Control driver or a custom built kernel with SGX support. To use the Legacy Launch Control driver, make following modifications:

  1. Replace "/dev/sgx/enclave" device with "/dev/isgx" and remove "/dev/sgx/provision" device for AESM in docker-compose.yml and build_and_run_aesm_docker.sh
  2. Replace "/dev/sgx/enclave" with "/dev/isgx" for the sample container in docker-compose.yml and build_and_run_sample_docker.sh

Note: When you switch between drivers, make sure you uninstall the previous driver and reboot the system before installing the other one.

Note: Earlier versions of the Flexible Launch Control driver and kernel patches may expose the SGX device as a single node at "/dev/sgx".

Experimental: Build and run TDX QGS in docker container

Prerequisites

Besides the Prerequisites, you need to have docker version >= 20.04 to support host-gateway used in build_and_run_qgs_docker.sh. And Legacy Launch Control driver is not supported.

Run with Docker directly

This will start QGS on one terminal directly.

$ ./build_and_run_qgs_docker.sh

It will listen on docker volume /var/lib/docker/volumes/qgs-socket. In order to connect to QGS in this configuration, you need to run QEMU with quote-generation-service=unix:/var/lib/docker/volumes/qgs-socket/_data/qgs.socket option and use TDVMCall mode(which is the default mode if you installed with rpm/deb package) to get quote within TD guest.