Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add test enclave usage example #68

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 can 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
Loading