Edgeless RT is an SDK for Trusted Execution Environments (TEE) built on top of Open Enclave. It aims to provide support for modern programming languages and to facilitate the porting of existing applications. Currently, hardware-wise, Edgeless RT focuses on Intel SGX. Support for other TEEs will follow as it becomes available in Open Enclave.
Key features of Edgeless RT are:
- Support for Go
- Extended C/C++ support
- More libc and POSIX functions
- More C++17 STL
- pthread and std::thread
- libstdc++ for better compatibility with existing code
- Experimental support for Rust
- Soon: seamless integration with Edgeless Mesh to create distributed confidential applications
- Soon: support for Python
If you are on Ubuntu 18.04 and do not want to build the SDK yourself, you can install the binary release:
wget -qO- https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add
sudo add-apt-repository 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu bionic main'
wget https://github.com/edgelesssys/edgelessrt/releases/download/v0.1.1/edgelessrt_0.1.1_amd64.deb
sudo apt install ./edgelessrt_0.1.1_amd64.debThen proceed with Use.
Edgeless RT primarily targets Ubuntu 18.04. Other Linuxes may work as well. Windows is not yet supported.
-
Determine the SGX support of your system
cc -ooesgx tools/oesgx/oesgx.c && ./oesgxYou will get one of the following three types of output:
oesgx output SGX support level CPU supports SGX_FLC:Flexible Launch Control
CPU supports Software Guard Extensions:SGX1SGX1+FLC CPU supports Software Guard Extensions:SGX1 SGX1 CPU does not support SGX Simulation -
Set up the environment
Ansible is required to install the project requirements. Install it by running:
sudo scripts/ansible/install-ansible.sh
Run one of the following commands depending on the SGX support level:
-
SGX1+FLC in an Azure Confidential Compute (ACC) VM:
ansible-playbook scripts/ansible/oe-contributors-acc-setup.yml
-
SGX1+FLC:
ansible-playbook scripts/ansible/oe-contributors-setup.yml
-
SGX1:
ansible-playbook scripts/ansible/oe-contributors-setup-sgx1.yml
-
Simulation:
ansible-playbook scripts/ansible/oe-contributors-setup-sim.yml
NOTE: The Ansible playbook commands require
sudorights. You may need to specify--ask-become-passand enter your sudo password. -
-
Build the SDK
mkdir build cd build cmake -GNinja .. ninjaTo set a custom installation path (default:
/opt/edgelessrt), add, e.g.,-DCMAKE_INSTALL_PREFIX=~/edgelessrt-install.
After building, run the following command in the build directory to confirm everything works as expected:
ctestIn simulation mode run this command instead:
OE_SIMULATION=1 ctestFrom the build directory run:
ninja installOr if you do not have write permissions for the installation path:
sudo ninja installTo use the SDK you need to source the openenclaverc file to setup environment variables:
. /opt/edgelessrt/share/openenclave/openenclavercNow you are ready to build applications with Edgeless RT! To start, check out the samples in the samples_edgeless folder.
Also see the C API documentation and/or the Go API documentation.
You can use Open Enclave's oegdb to debug enclave code built with Edgeless RT. oegdb is automatically installed with Edgeless RT. It also supports Go enclaves.
oegdb works great with Visual Studio Code (vscode). For example, use the following configuration to debug the in-enclave Go code from our HashiCorp Vault sample in vscode:
{
"version": "0.2.0",
"configurations": [
{
"name": "(oegdb) Launch",
"miDebuggerPath": "/opt/edgelessrt/bin/oegdb",
"type": "cppdbg",
"request": "launch",
"program": "/opt/edgelessrt/bin/erthost",
"args": ["enclave.signed","server","-dev"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/samples_edgeless/vault/build/",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"text": "handle SIGILL nostop"
}
]
}
]
}