Skip to main content
QUICK REVIEW

[Paper Review] Keystone: An Open Framework for Architecting TEEs

Dayeol Lee, David Kohlbrenner|arXiv (Cornell University)|Jul 23, 2019
Security and Verification in ComputingComputer Science104 references27 citations
TL;DR

Keystone is an open-source framework that enables the creation of customizable Trusted Execution Environments (TEEs) by exposing programmable hardware primitives—specifically RISC-V's physical memory protection (PMP) in machine mode—to build a modular, extensible TEE stack. It separates a minimal, hardware-enforced security monitor (SM) from a customizable runtime (RT), allowing fine-grained control over TCB size, threat models, and application-specific features, with demonstrated support for diverse workloads on unmodified RISC-V hardware.

ABSTRACT

Trusted execution environments (TEEs) are being used in all the devices from embedded sensors to cloud servers and encompass a range of cost, power constraints, and security threat model choices. On the other hand, each of the current vendor-specific TEEs makes a fixed set of trade-offs with little room for customization. We present Keystone -- the first open-source framework for building customized TEEs. Keystone uses simple abstractions provided by the hardware such as memory isolation and a programmable layer underneath untrusted components (e.g., OS). We build reusable TEE core primitives from these abstractions while allowing platform-specific modifications and application features. We showcase how Keystone-based TEEs run on unmodified RISC-V hardware and demonstrate the strengths of our design in terms of security, TCB size, execution of a range of benchmarks, applications, kernels, and deployment models.

Motivation & Objective

  • Address the lack of customization in existing hardware-locked TEEs like Intel SGX, ARM TrustZone, and AMD SEV.
  • Overcome the limitations of fixed TEE designs that constrain threat models, performance, and feature support.
  • Enable hardware vendors, cloud providers, and application developers to tailor TEEs to specific workloads and security requirements.
  • Provide a programmable, trusted layer beneath the untrusted OS to support flexible, composable TEE configurations.
  • Reduce the Trusted Computing Base (TCB) by isolating security enforcement (SM) from functional logic (RT), improving verifiability and maintainability.

Proposed method

  • Leverage RISC-V’s machine-mode PMP to enforce physical memory isolation, creating a hardware-protected boundary between untrusted OS and trusted enclave components.
  • Design a minimal, hardware-enforced Security Monitor (SM) that runs in machine mode and enforces isolation, secure boot, and attestation without performing resource management.
  • Implement a customizable Runtime (RT) in supervisor mode that manages enclave virtual memory, system calls, and communication with the host via shared memory.
  • Decouple the SM from the RT to allow independent plugin-based extension of functionality (e.g., libc, threading, dynamic loading) at compile time.
  • Use compile-time plugins to tailor the TCB and threat model per deployment, enabling fine-grained control over trust and performance trade-offs.
  • Demonstrate compatibility with unmodified RISC-V hardware and support for standard benchmarks, kernels, and applications via multiple RT configurations.

Experimental results

Research questions

  • RQ1Can a TEE framework be built that allows customization of security properties, TCB size, and functionality without modifying the underlying hardware?
  • RQ2How can a minimal, hardware-enforced security monitor be separated from functional runtime logic to improve modularity and trustworthiness?
  • RQ3To what extent can existing TEE limitations—such as static enclaves, lack of I/O support, and side-channel vulnerabilities—be mitigated through a programmable, composable TEE stack?
  • RQ4Can a TEE framework be ported to open ISAs like RISC-V while maintaining strong security guarantees and performance?
  • RQ5How does the separation of SM and RT enable better support for diverse deployment models, including cloud, IoT, and edge computing?

Key findings

  • Keystone enables the construction of TEEs with significantly reduced Trusted Computing Base (TCB) by isolating security enforcement (SM) from functional logic (RT), which is only included when needed.
  • The framework successfully runs on unmodified RISC-V hardware, demonstrating compatibility and extensibility across diverse deployment platforms.
  • Keystone supports a broad range of workloads, including standard benchmarks, kernels, and applications such as secure databases, blockchain protocols, and machine learning, via configurable runtime components.
  • The separation of SM and RT allows for compile-time customization of features like system call interfaces, libc support, and dynamic memory management, enabling tailored TEEs per use case.
  • By relying on PMP for memory isolation and avoiding hypervisor-style virtualization, Keystone avoids inflating the TCB and reduces the attack surface compared to trusted hypervisor approaches.
  • The design is inherently resilient to a large class of side-channel attacks (e.g., cache and speculative execution) and can integrate existing defenses (e.g., cache side-channel hardening) for further protection.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.