WebAssembly is an increasingly popular lightweight binary instruction format, which can be efficiently embedded and sandboxed. Languages like C, C++, Rust, Go, and many others can be compiled into WebAssembly. This paper describes Twine, a WebAssembly trusted runtime designed to execute unmodified, language-independent applications. We leverage Intel SGX to build the runtime environment without dealing with language-specific, complex APIs. While SGX hardware provides secure execution within the processor, Twine provides a secure, sandboxed software runtime nested within an SGX enclave, featuring a WebAssembly system interface (WASI) for compatibility with unmodified WebAssembly applications. We evaluate Twine with a large set of general-purpose benchmarks and real-world applications. In particular, we used Twine to implement a secure, trusted version of SQLite, a well-known full-fledged embeddable database. We believe that such a trusted database would be a reasonable component to build many larger application services. Our evaluation shows that SQLite can be fully executed inside an SGX enclave via WebAssembly and existing system interface, with similar average performance overheads. We estimate that the performance penalties measured are largely compensated by the additional security guarantees and its full compatibility with standard WebAssembly. An in-depth analysis of our results indicates that performance can be greatly improved by modifying some of the underlying libraries. We describe and implement one such modification in the paper, showing up to $4.1\times$ speedup. Twine is open-source, available at GitHub along with instructions to reproduce our experiments.
翻译:网络大会是一个日益受欢迎的轻量级双向教学格式,可以高效嵌入和沙箱。 C、 C++、 Rust、 Go 等语言可以被汇编成WebAssembly 。 本文描述了Swine, 网络大会信任的运行时间, 用于执行未经修改的、 语言独立的应用程序。 我们利用 Intel SGX 来建立运行时间环境, 而不处理语言特定、 复杂的 API 。 虽然SGX 硬件可以在处理器内提供安全执行, Twine 提供在SGX飞地内安全、 沙箱化的软件运行时间, 包括一个网络大会系统界面(WASI ), 用于与未经修改的WebAsseconomic 应用程序兼容。 我们用大量通用基准和现实世界应用程序的运行时间来评价SQLite, 特别是我们利用SQLite实施一个安全、可信任的完整嵌入的数据库。 我们认为, 这样一个可靠的数据库将是一个合理的组成部分, 用来建立更多的应用程序服务。 我们的评估显示, SQLite可以在一个SGX 飞地的飞飞飞飞飞飞飞飞飞飞飞飞的飞飞飞飞飞飞地内执行, 通过网络进行一个测试, 并且通过一个测试, 我们测量能的高级的测试, 以测量测量能能能的系统进行一个测试。