Twine:适用于WebAssembly的嵌入式可信运行时
Twine: An Embedded Trusted Runtime for WebAssembly
摘要:
WebAssembly是一种越来越流行的轻量级二进制指令格式,可以有效地嵌入和沙箱。像C、C++、Rust、Go和许多其他语言都可以编译成WebAssembly。本文介绍了Twine,一个WebAssembly可信运行时,旨在执行未经修改的,语言无关的应用程序。我们利用英特尔SGX构建运行时环境,无需处理特定于语言的复杂API。虽然SGX硬件在处理器内提供安全执行,但Twine提供嵌套在SGX安全区内的安全沙箱软件运行时,具有WebAssembly系统接口(WASI),可与未经修改的WebAssembly应用程序兼容。我们使用大量的通用基准测试和实际应用程序来评估Twine。特别是,我们使用Twine实现了一个安全、可信的SQLite版本,SQLite是一个众所周知的成熟的嵌入式数据库。我们相信,这样一个可信的数据库将是构建许多大型应用程序服务的合理组件。我们的评估表明,SQLite可以通过WebAssembly和现有系统接口在SGX飞地内完全执行,具有类似的平均性能开销。我们估计,所测量的性能损失在很大程度上被额外的安全保证及其与标准WebAssembly的完全兼容性所补偿。对我们的结果进行深入分析表明,通过修改一些底层库可以大大提高性能。我们描述并实现了这样的修改的文件,显示了$4.1\times$加速。Twine是开源的,可在GitHub上获得,并附有重现我们实验的说明。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。