Enclaves, such as those enabled by Intel SGX, offer a hardware primitive for shielding user-level applications from the OS. While enclaves are a useful starting point, code running in the enclave requires additional checks whenever control or data is transferred to/from the untrusted OS. The enclave-OS interface on SGX, however, can be extremely large if we wish to run existing unmodified binaries inside enclaves. This paper presents Ratel, a dynamic binary translation engine running inside SGX enclaves on Linux. Ratel offers complete interposition, the ability to interpose on all executed instructions in the enclave and monitor all interactions with the OS. Instruction-level interposition offers a general foundation for implementing a large variety of inline security monitors in the future. We take a principled approach in explaining why complete interposition on SGX is challenging. We draw attention to 5 design decisions in SGX that create fundamental trade-offs between performance and ensuring complete interposition, and we explain how to resolve them in the favor of complete interposition. To illustrate the utility of the Ratel framework, we present the first attempt to offer binary compatibility with existing software on SGX. We report that Ratel offers binary compatibility with over 200 programs we tested, including micro-benchmarks and real applications such as Linux shell utilities. Runtimes for two programming languages, namely Python and R, tested with standard benchmarks work out-of-the-box on Ratel without any specialized handling.
翻译:在飞地运行的代码是一个有用的起点,在飞地运行的代码需要额外的检查,只要控制或数据被转移到或从不信任的OS。但是,如果我们希望在飞地内运行现有的未经修改的二进制文件,则在SGX上的飞地-OS界面可能非常大。本文展示的是Ratel,一个动态的二进制翻译引擎,在SGX飞地内运行,在Linux上运行。Rapel提供完整的插座,能够插入飞地中的所有执行指令,并监测与OS的所有互动。在飞地运行的代码为今后实施大量各种内部安全监视器提供了一般基础。我们采取原则性办法解释为什么在SGX上完全的插座具有挑战性。我们提请注意SGX中的5项设计决定,在性能和确保完全的互换之间产生根本的利弊,我们解释如何在完全的内置中解决这些问题。为了说明在飞地操作框架中的所有执行指令的实用性,并监测与与OS的所有互动关系。我们第一次尝试了专门性框架,也就是200个标准软件的兼容性,作为我们测试的硬拷贝标准格式,我们测试了任何硬拷贝。