Project to explore reproducible enclave builds, in the context of TEEs (Trusted Execution Environments).
So far, in terms of implementation the focus has been on Intel SGX. Currently undergoing work is happening under the following repositories:
- https://github.com/sbellem/auditee: Tool to verify the reproducibility of SGX enclave builds
- https://github.com/initc3/nix-sgx-sdk: Experimental nix derivation for Intel's SGX SDK
- https://reproducible-builds.org/
- On why reproducible builds matter: https://reproducible-builds.org/docs/buy-in/
- rustc 1.44.1 is reproducible in Debian
- Example of reproducible compiler output with Rust: ripgrep 0.10.0 is reproducible in Debian
- Bazel: https://github.com/bazelbuild/bazel and https://www.bazel.build/
- Tor blog: Deterministic Builds Part One: Cyberwar and Global Compromise
- Tor blog: Deterministic Builds Part Two: Technical Details
- Nix + Bazel = fully reproducible, incremental builds
- Implicit Dependencies in Build Systems
- Google asylo: https://github.com/google/asylo
- https://medium.com/nttlabs/bit-for-bit-reproducible-builds-with-dockerfile-7cc2b9faed9f
From https://christine.website/blog/i-was-wrong-about-nix-2020-02-10:
-
Nix Pills: https://nixos.org/nixos/nix-pills/
-
Nix Shorts: https://github.com/justinwoo/nix-shorts
-
NixOS: For Developers: https://myme.no/posts/2020-01-26-nixos-for-development.html
-
An opinionated guide for developers getting things done using the Nix ecosystem.
https://nixos.org/community.html
- freenode: https://webchat.freenode.net/#nixos
- discourse: https://discourse.nixos.org/
- Chapter 18. Verifying Build Reproducibility with diff-hook
- Trezor: Deterministic firmware build -- they use nix, see their build-docker.sh
- Interesting comments on Nix: https://www.reddit.com/r/rust/comments/afscgo/ripgrep_0100_is_reproducible_in_debian/ee1965s/
- https://planet.nixos.org/
- https://weekly.nixos.org/
- Talk by Brian McKenna (contributor to Nix, nixpkgs and HNix): Functional programming and Nix for reproducible, immutable infrastructure
- Rust in nixpkgs docs
- https://github.com/nmattia/naersk
- Excellent "Hello World!": https://christine.website/blog/how-i-start-nix-2020-03-08
- Managing Rust Dependencies with Nix, Part I
- Managing Rust Dependencies with Nix, Part II
- Packaging (Nightly) Rust Application with Nix
https://nixos.wiki/wiki/Nix_vs._Linux_Standard_Base
https://www.tweag.io/blog/2020-05-25-flakes/
- Dolstra, E., de Jonge, M. and Visser, E., Nix: A Safe and Policy-Free System for Software Deployment, In Damon, L. (Ed.), 18th Large Installation System Administration Conference (LISA '04), pages 79–92, Atlanta, Georgia, USA. USENIX, November 2004.
- Prins, P., Suresh, J. and Dolstra, E., Nix fixes dependency hell on all Linux distributions, linux.com, December 22, 2008
- Dolstra, E., The Purely Functional SoftwareDeployment Model, PhD thesis, Faculty of Science, Utrecht, The Netherlands. January 2006.
There are different ways to use both docker and nix. Mainly 2 approaches, as far as I know:
- Nix all-the-way: build docker images with nix.
- Use Nix in a docker container, such that Nix is used to set build dependencies, and to be the basis for the build environment.
Docker images with Nix:
- https://github.com/NixOS/docker
- https://github.com/LnL7/nix-docker
- https://github.com/nix-community/docker-nixpkgs
wiki: https://nixos.wiki/wiki/Docker
nixery
Container registry which transparently builds images using the Nix package manager
- https://github.com/kudelskisecurity/sgxfun (slides: https://www.blackhat.com/docs/us-16/materials/us-16-Aumasson-SGX-Secure-Enclaves-In-Practice-Security-And-Crypto-Review.pdf)
https://www.phoronix.com/scan.php?page=news_item&px=GNU-Assembler-LVI-Options
Three Paper Thursday: What’s Intel SGX Good For? Interesting blog post ...
Regarding PoET:
Unfortunately, this proposal suffers from a critical security economics issue: node maintainers here have a strong incentive to break into their own SGX chips. If an adversary managed to compromise their SGX, they could win the leader election at every round by setting the timeout to 0. The more valuable the network, the stronger the incentive to compromise your own platform.
Robust Round Robin & sybil attack prevention Another approach is discussed: Efficient Blockchain Consensus with Robust Round Robin which relies on Remote Attestation for establishing identities, which are then used to form a set of candidates from which a randomly selected node will get to broadcast the next block ... The paper is at https://arxiv.org/pdf/1804.07391.pdf
Another use case discussed is EnclaveDB (https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8418608)
- https://github.com/intel/sgx-ra-sample
- https://github.com/cloud-security-research/sgx-ra-tls
Robust Round Robin / Sybil Attack Prevention https://arxiv.org/pdf/1804.07391.pdf
See discussion on PoET in Three Paper Thursday: What’s Intel SGX Good For?.
Sawtooth PoET
The Sawtooth PoET consensus engine implements a CFT (Crash Fault Tolerant) variant of PoET which does not use a TEE. A future version of the consensus engine which also implements full BFT (Byzantine Fault Tolerant) features using an SGX enclave is in development.
-
https://sawtooth.hyperledger.org/docs/core/releases/latest/sysadmin_guide/configure_sgx.html
-
https://bitcoinexchangeguide.com/intels-poet-proof-of-elapsed-time-blockchain-consensus-algorithm/
https://eprint.iacr.org/2017/179.pdf
REM achieves security guarantees similar to PoW, but leverages the partially decentralized trustmodel inherent in SGX to achieve a fraction of the wasteof PoW. Its key idea, Proof-of-Useful-Work (PoUW), involves miners providing trustworthy reporting on CPU cycles they devote to inherently useful workloads. REM flexibly allows any entity to create a useful workload. REM ensures the trustworthiness of these workloads by means of a novel scheme of hierarchical attestations that may be of independent interest.
To address the risk of compromised SGX CPUs, we develop a statistics-based formal security framework, also relevant to other trusted-hardware-based approaches such as Intel's Proof of Elapsed Time (PoET). We show through economic analysis that REM achieves less waste than PoET and variant schemes.
- https://medium.com/@maniacbolts/signal-increases-their-reliance-on-sgx-f46378f336d3
- https://arxiv.org/abs/2006.13353
- https://signal.org/blog/private-contact-discovery/
- SGaxe, https://arstechnica.com/information-technology/2020/06/new-exploits-plunder-crypto-keys-and-more-from-intels-ultrasecure-sgx/
- https://arstechnica.com/information-technology/2020/03/hackers-can-steal-secret-data-stored-in-intels-sgx-secure-enclave/
- https://ieeexplore.ieee.org/document/9152763
- https://lviattack.eu/
- https://www.plundervolt.com/ -- https://github.com/KitMurdock/plundervolt
- https://github.com/bitdefender/lvi-lfb-attack-poc
- https://arstechnica.com/information-technology/2019/12/scientists-pluck-crypto-keys-from-intels-sgx-by-tweaking-cpu-voltage
- github: https://github.com/ibr-ds/EActors
- paper: https://www.ibr.cs.tu-bs.de/users/sartakov/papers/sartakov18eactors.pdf
- talk: https://youtu.be/eigtc7oCxWk
- slides: https://archive.fosdem.org/2020/schedule/event/eactors/attachments/slides/4113/export/events/attachments/eactors/slides/4113/eactors.pdf
SCONE: https://scontain.com/
We enable Confidential computing of containers and host programs using Intel SGX.