Skip to content

Commit

Permalink
docs: add test enclave usage examples, move reference repos to their …
Browse files Browse the repository at this point in the history
…own subsection
  • Loading branch information
ozwaldorf committed Nov 14, 2024
1 parent 88c0700 commit 4416c2a
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
# nixsgx

This repository contains a Nix flake with up2date packages for the Intel SGX SDK and gramine.
This repository contains a Nix flake with up-to-date packages for the Intel SGX SDK and gramine.

Hopefully most of the packages will be upstreamed to nixpkgs at some point.

All package builds should be reproducible and therefore can be used to build reproducible enclave images.

## Usage

See: https://github.com/matter-labs/teepot
and https://github.com/matter-labs/era-fee-withdrawer/tree/gramine-sgx
### Test enclave

A testing enclave container is provided and can be ran like so:

```sh
# Build the dcap (or azure) container variant
nix build .#nixsgx-test-sgx-dcap

# Load image into docker
docker load < result

# Run the enclave, binding the sgx devices
docker run -i --init --rm \
--device /dev/sgx_enclave \
--device /dev/sgx_provision \
nixsgx-test-sgx-dcap:latest
```

> Note: An external aesmd instance be provided by mounting the socket to the container: `-v /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket`
### Reference projects

The following projects provide reproducible enclaves using nixsgx:

- https://github.com/matter-labs/teepot
- https://github.com/matter-labs/era-fee-withdrawer/tree/gramine-sgx

0 comments on commit 4416c2a

Please sign in to comment.