edgelesssys / ego

EGo is an open-source SDK that enables you to develop your own confidential apps in the Go programming language.
https://www.edgeless.systems/products/ego/
Mozilla Public License 2.0
501 stars 51 forks source link
confidential-computing confidential-microservices enclave golang intel-sgx sgx

EGo

EGo logo

GitHub Actions Status GitHub license Go Report Card PkgGoDev Discord Chat

EGo is a framework for building confidential apps in Go. Confidential apps run in always-encrypted and verifiable enclaves on Intel SGX-enabled hardware. EGo simplifies enclave development by providing two user-friendly tools:

Building and running a confidential Go app is as easy as:

ego-go build hello.go
ego sign hello
ego run hello

Install

Install the snap

The easiest way to install EGo is via the snap:

sudo snap install ego-dev --classic

You also need gcc and libcrypto. On Ubuntu install them with:

sudo apt install build-essential libssl-dev

Install the DEB package

If you're on Ubuntu 20.04 or 22.04, you can install the DEB package:

sudo mkdir -p /etc/apt/keyrings
wget -qO- https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo tee /etc/apt/keyrings/intel-sgx-keyring.asc > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/intel-sgx-keyring.asc arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/intel-sgx.list
sudo apt update
EGO_DEB=ego_1.5.4_amd64_ubuntu-$(lsb_release -rs).deb
wget https://github.com/edgelesssys/ego/releases/download/v1.5.4/$EGO_DEB
sudo apt install ./$EGO_DEB build-essential libssl-dev

Build from source

Prerequisite: Edgeless RT is installed and sourced.

mkdir build
cd build
cmake ..
make
make install

Build via Docker

You can reproducibly build the latest release:

cd dockerfiles
DOCKER_BUILDKIT=1 docker build --target export -o. - < Dockerfile

Or build the latest master:

cd dockerfiles
DOCKER_BUILDKIT=1 docker build --target export --build-arg egotag=master --build-arg erttag=master -o. - < Dockerfile

This outputs the DEB package for Ubuntu 22.04. For Ubuntu 20.04, replace Dockerfile with Dockerfile.focal in the above commands.

Optionally build the ego-dev and ego-deploy images:

DOCKER_BUILDKIT=1 docker build --target dev -t ghcr.io/edgelesssys/ego-dev - < Dockerfile
DOCKER_BUILDKIT=1 docker build --target deploy -t ghcr.io/edgelesssys/ego-deploy - < Dockerfile

Getting started

Now you're ready to build applications with EGo! To start, check out the following samples:

Documentation

Beyond EGo

Community & help

Contribute