MCPcopy Index your code
hub / github.com/edgelesssys/ego

github.com/edgelesssys/ego @v1.9.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.9.0 ↗ · + Follow
385 symbols 1,224 edges 110 files 128 documented · 33%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

EGo

EGo logo

GitHub Actions Status GitHub license Go Report Card PkgGoDev

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:

  • ego-go, an adapted Go compiler that builds enclave-compatible executables from a given Go project - while providing the same CLI as the original Go compiler.
  • ego, a CLI tool that handles all enclave-related tasks such as signing and enclave creation.

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, 22.04, or 24.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.8.1_amd64_ubuntu-$(lsb_release -rs).deb
wget https://github.com/edgelesssys/ego/releases/download/v1.8.1/$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:

  • helloworld is a minimal example of an enclave application.
  • remote_attestation shows how to use the basic remote attestation API of EGo.
  • attested_tls is similar to the above, but uses a higher level API to establish an attested TLS connection.
  • vault demonstrates how to port a Go application exemplified by Hashicorp Vault.
  • estore shows how to securely persist data using EStore.
  • wasmer and wasmtime show how to run WebAssembly inside EGo.
  • embedded_file shows how to embed files into an EGo enclave.
  • reproducible_build builds the helloworld sample reproducibly, resulting in the same UniqueID.
  • cgo demonstrates the experimental cgo support.
  • azure_attestation shows how to use Microsoft Azure Attestation for remote attestation.

Documentation

  • The EGo documentation covers building, signing, running, and debugging confidential apps.
  • The EGo API provides access to remote attestation and sealing to your confidential app at runtime.

Beyond EGo

  • Use MarbleRun to create distributed EGo applications and run them on Kubernetes.
  • Use EStore to securely persist your application's data.
  • Not only using Go? Check out Contrast to run your confidential containers on Kubernetes.

Community & help

  • Got a question? Please file an issue.
  • If you see an error message or run into an issue, please make sure to create a bug report.
  • Get the latest news and announcements on Twitter, LinkedIn or sign up for our monthly newsletter.
  • Visit our blog for technical deep-dives and tutorials.

Contribute

Extension points exported contracts — how you extend this code

Runner (Interface)
Runner runs Cmd objects. [6 implementers]
ego/internal/launch/launch.go
Mounter (Interface)
Mounter defines an interface to use to mount the filesystem (usually syscall, mainly differs for unit tests) [2 implementers]
ego/premain/core/core.go

Core symbols most depended-on inside this repo

Errorf
called by 43
ego/test/t.go
Validate
called by 21
ego/config/config.go
NewCli
called by 20
ego/cli/cli.go
Run
called by 18
ego/internal/launch/launch.go
install
called by 10
ego/cli/install.go
String
called by 10
attestation/tcbstatus/status_string.go
Write
called by 9
ego/internal/launch/buffer.go
newCli
called by 8
ego/ego/cmd/util.go

Shape

Function 250
Method 83
Struct 31
Class 17
Interface 2
TypeAlias 2

Languages

Go87%
C++8%
C5%

Modules by API surface

src/gcc_libinit.c18 symbols
ego/cli/install_test.go17 symbols
ecrypto/ecrypto.go15 symbols
ecrypto/ecrypto_test.go14 symbols
ego/internal/launch/launch.go13 symbols
src/libcgo.h11 symbols
ego/cmd/bundle/main_test.go10 symbols
internal/attestation/maa.go9 symbols
enclave/seal.go9 symbols
enclave/enclave.go9 symbols
ego/cli/install.go9 symbols
ego/cli/elf.go9 symbols

For agents

$ claude mcp add ego \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page