一句话:提出 SCW 原则,将 Java 机密任务编译为原生 NCC 服务入 enclave,非机密代码留 JVM,实现轻量高效机密计算。
在 SGX 上支持 Java 应用机密计算时,已有 JVM-in-enclave 方案需将整个 JVM 放入 enclave,导致严重性能开销、较大攻击面和较深计算栈。本文形式化 Secure Closed-World(SCW)原则,并提出 Lejacon:将 Java 应用的机密任务单独编译为一组 Native Confidential Computing(NCC)服务,在 TEE 侧 enclave 中运行;非机密代码则仍在 REE 侧 JVM 上运行,两侧交互以保护机密任务并缩小 TCB。作者实现 Lejacon,并在 BouncyCastle 密码库基准上对比 OcclumJ。结果表明,Lejacon 在 enclave 中运行 Java 机密代码性能有竞争力,机密代码最高加速 16.2 倍,TCB 平均缩小 90% 以上。
Intel's SGX is a confidential computing technique. It allows key functionalities of C/C++/native applications to be confidentially executed in hardware enclaves. However, numerous cloud applications are written in Java. For supporting their confidential computing, state-of-the-art approaches deploy Java Virtual Machines (JVMs) in enclaves and perform confidential computing on JVMs. Meanwhile, these JVM-in-enclave solutions still suffer from serious limitations, such as heavy overheads of running JVMs in enclaves, large attack surfaces, and deep computation stacks. To mitigate the above limitations, we for-malize a Secure Closed-World (SCW) principle and then propose Lejacon, a lightweight and efficient approach to Java confidential computing. The key idea is, given a Java application, to (1) separately compile its confidential computing tasks into a bundle of Native Confidential Computing (NCC) services; (2) run the NCC services in enclaves on the Trusted Execution Environment (TEE) side, and meanwhile run the non-confidential code on a JVM on the Rich Execution Environment (REE) side. The two sides interact with each other, protecting confidential computing tasks and as well keeping the Trusted Computing Base (TCB) size small. We implement Lejacon and evaluate it against OcclumJ (a state-of-the-art JVM-in-enclave solution) on a set of benchmarks using the BouncyCastle cryptography library. The evaluation results clearly show the strengths of Lejacon: it achieves compet-itive performance in running Java confidential code in enclaves; compared with OcclumJ, Lejacon achieves speedups by up to 16.2x in running confidential code and also reduces the TCB sizes by 90+% on average.
@inproceedings{MiaoLWYLWNCSJ23,
title = {Lejacon: A Lightweight and Efficient Approach to Java Confidential Computing on SGX},
author = {Xinyuan Miao and Ziyi Lin and Shaojun Wang and Lei Yu and Sanhong Li and Zihan Wang and Pengbo Nie and Yuting Chen and Beijun Shen and He Jiang},
booktitle = {ICSE},
year = {2023},
doi = {10.1109/icse48619.2023.00142}
}