Description
Encryption of storage devices is a common practice to protect data at rest from unauthorized
access. At runtime, encryption keys are typically held unprotected in the random
access memory (RAM) of the system. This exposes them to side-channel attacks, like
cold boot, targeting RAM. Several approaches, for example, holding keys in central
processing unit (CPU) registers instead of RAM, have been tried. However, they have
been shown to be vulnerable to more advanced attacks like runtime code injection. To
defend against these threats, approaches using trusted execution environments (TEEs)
like Intel Software Guard Extensions (SGX) have been proposed. However, previous
SGX-based storage systems suffer from substantial overhead, limiting performance and
usability.
Motivated by the addition of the performance-oriented userspace block device
(UBLK) module to the Linux kernel, this thesis presents an encrypted and integrityprotected
block device that combines UBLK and Intel SGX. Our design exposes a
regular block device through UBLK while handling block I/O requests inside an SGX
enclave, where encryption, decryption, and integrity verification are performed. The
encryption key is bound to the hardware and kept inside the enclave at all times,
thereby protecting it from the aforementioned attacks. The data at rest is protected
using per-sector authenticated encryption combined with a Merkle hash tree. This
approach not only provides confidentiality and per-sector integrity but also guarantees
consistency and protects against partial replay attacks. We implemented a PoC in Rust
and evaluated it against existing similar approaches. Our benchmarking results show
significant performance improvements over prior SGX-based approaches and indicate
that the design is practical for real-world workloads.
|