Clemmys
Towards Secure Remote Execution in FaaS
Bohdan Trach, Oleksii Oleksenko, Franz Gregor, Pramod Bhatotia, Christof Fetzer
ACM SYSTOR 2019
Clemmys Towards Secure Remote Execution in FaaS Bohdan Trach , - - PowerPoint PPT Presentation
Clemmys Towards Secure Remote Execution in FaaS Bohdan Trach , Oleksii Oleksenko, Franz Gregor, Pramod Bhatotia, Christof Fetzer ACM SYSTOR 2019 FaaS Paradigm of Cloud Computing Function Runtime Guest OS Function Hypervisor Host OS FaaS
Bohdan Trach, Oleksii Oleksenko, Franz Gregor, Pramod Bhatotia, Christof Fetzer
ACM SYSTOR 2019
Guest OS
Function Runtime Host OS Hypervisor Function
Guest OS Function Runtime Host OS Hypervisor
Worker 1 Worker 2
Function A Function B Function C Controller Gateway
Worker 1 Worker 2
Function A Function B Function C Controller Gateway
Worker 1 Worker 2
Function A Function B Function C Controller Gateway
Worker 1 Worker 2
Function A Function B Controller Gateway
itQX/e8=
Function C
Worker 1 Worker 2
Function A Function B Controller Gateway
Secret
Function C
Worker 2 Worker 1
Function A Function B Controller Gateway
A(Secret)
Function C Support for function chaining is an important requirement for serverless computing
Worker 2 Worker 1
Function A Function B Controller Gateway
B(A(Secret))
Function C Support for function chaining is an important requirement for serverless computing
Worker 2 Worker 1
Function A Function B Controller Gateway
C(B(A(Secret)))
Function C Support for function chaining is an important requirement for serverless computing
Worker 2 Worker 1
Function A Function B Controller Gateway
C(B(A(Secret)))
Function C
Worker 2 Worker 1
Function A Function B Controller Gateway
IysMdOmldNYL
Function C
Worker 2 Worker 1
Function A Function B Controller Gateway Function C
Worker 2 Worker 1
Function A Function B Controller Gateway Function C
Worker 2 Worker 1
Function A Function B Controller Gateway Function C Inspect Network Traffic
Worker 2 Worker 1
Function A Function B Controller Gateway Function C Inspect Network Traffic Inspect Process Memory
Related Work:
Guest OS Function Runtime Host OS Hypervisor Multiparty Computations Homomorphic Encryption
Related Work:
Guest OS Function Runtime Host OS Hypervisor Intel SGX
User Application (Untrusted Memory) Operating System
User Application (Untrusted Memory) Enclave Operating System/Hypervisor
○ Encrypted in RAM only
User Application (Untrusted Memory) Enclave Operating System/Hypervisor Encrypted in RAM Unencrypted in CPU cache
○ Encrypted in RAM only ○ Not accessible from outside
User Application (Untrusted Memory) Enclave Operating System/Hypervisor Read, Write Read, Write
○ Encrypted in RAM only ○ Not accessible from outside ○ Developer-specified entry points
User Application (Untrusted Memory) Enclave Operating System/Hypervisor Call Enter Exit Call
○ Secure memory paging ○ Enclave startup with large heap
User Application (Untrusted Memory) Enclave Operating System/Hypervisor 94MB of HW-encrypted memory available
Function startup time as an
Function startup time as an
Problem for SGXv1 enclaves
Function startup time as an
Problem for SGXv1 enclaves
Additional optimizations are worth investigating.
SGX Enclave Native Application
Function A Function B Controller Gateway Function C TLS Based on Apache OpenWhisk
SGX Enclave Native Application
Function A Function B Controller Gateway Function C TLS Key Mgmt Service Based on Apache OpenWhisk
function execution
SGX Enclave Native Application
Function A Function B Controller Gateway Function C TLS Plaintext Metadata + + Encrypted Data Plaintext Metadata + + Encrypted Data Key Mgmt Service Based on Apache OpenWhisk
secure function chaining
function execution
SGX Enclave Native Application
Function A Function B Controller Gateway Function C TLS Plaintext Metadata + + Encrypted Data Plaintext Metadata + + Encrypted Data Key Mgmt Service Based on Apache OpenWhisk
secure function chaining
function execution
SGX Enclave Native Application
Function A Function B Controller Gateway Function C TLS Plaintext Metadata + + Encrypted Data Plaintext Metadata + + Encrypted Data Key Mgmt Service Based on Apache OpenWhisk
secure function chaining
function execution
deployment scheme
SGX Enclave Native Application
Function A Function B Controller Gateway Function C TLS Plaintext Metadata + + Encrypted Data Plaintext Metadata + + Encrypted Data Key Mgmt Service Based on Apache OpenWhisk
secure function chaining
function execution
deployment scheme
SGX Enclave Native Application
Function A Function B Controller Gateway Function C TLS Plaintext Metadata + + Encrypted Data Plaintext Metadata + + Encrypted Data Key Mgmt Service Based on Apache OpenWhisk
secure function chaining
function execution
deployment scheme
Function A Function B Controller Gateway Function C TLS TLS TLS EPC paging → slow!
SGX Enclave Native Application
Function A Function B Controller Gateway Function C TLS ??? ???
SGX Enclave Native Application
Function A Function B Controller Gateway Function C TLS ??? ???
Idea: separate controller metadata (plaintext) from function arguments (encrypted)
SGX Enclave Native Application
Function A Function B Controller Gateway Function C TLS
Idea: separate controller metadata (plaintext) from function arguments (encrypted)
Plaintext Metadata + + Encrypted Data Plaintext Metadata + + Encrypted Data
SGX Enclave Native Application
Scale Detect Features Controller Gateway Report & Log TLS Plaintext Metadata + + Encrypted Data
SGX Enclave Native Application
Scale Detect Features Controller Gateway Report & Log TLS Plaintext Metadata + + Encrypted Data Plaintext Metadata + + Encrypted Data
SGX Enclave Native Application
Scale Detect Features Controller Gateway Report & Log TLS Plaintext Metadata + + Encrypted Data Plaintext Metadata + + Encrypted Data
SGX Enclave Native Application
Scale Detect Features Controller Gateway Report & Log TLS Plaintext Metadata + + Encrypted Data Plaintext Metadata + + Encrypted Data
SGX Enclave Native Application
See paper for technical details
1. SGXv1 Enclave Creation
Enclave VM Range Physical Pages
1. SGXv1 Enclave Creation
Enclave VM Range EPC Size
1. SGXv1 Enclave Creation
Enclave VM Range EPC Size Paged out!
1. SGXv1 Enclave Creation
Enclave VM Range EPC Size Paged out!
1. SGXv2 Enclave Creation
Enclave VM Range Enclave .text and .data sections Metadata for heap allocator SGXv2 allows adding pages at runtime
1. SGXv2 Enclave Creation
Enclave VM Range Memory access inside enclave SGXv2 allows adding pages at runtime
1. SGXv2 Enclave Creation
Enclave VM Range Memory access inside enclave Page added (augmented) dynamically SGXv2 allows adding pages at runtime
1. SGXv2 Enclave Creation 2. EPC Batch Augmentation
Enclave VM Range Memory access inside enclave Page added (augmented) dynamically
1. SGXv2 Enclave Creation 2. EPC Batch Augmentation
Enclave VM Range Memory access inside enclave Block of N pages augmented at once
1. SGXv2 Enclave Creation 2. EPC Batch Augmentation
Enclave VM Range Freshly allocated region of heap memory
3. Memory zeroing on deallocation
Need to be explicitly zeroed with SGXv1
1. SGXv2 Enclave Creation 2. EPC Batch Augmentation
Enclave VM Range Freshly allocated region of heap memory
3. Memory zeroing on deallocation
Guaranteed to be zero-filled with SGXv2
1. SGXv2 Enclave Creation 2. EPC Batch Augmentation
Enclave VM Range
3. Memory zeroing on deallocation
Zero-filled on memory deallocation
Function A Function B Function C Controller Gateway Client Palaemon
SGX Enclave Native Application
Function A Function B Function C Controller Gateway Client Palaemon
○ Environment variables and command-line arguments
SGX Enclave Native Application
Remote Attestation Intel
Function A Function B Function C Controller Gateway Client Palaemon
SGX Enclave Native Application Trust Established
Upload configuration (chains, secrets)
Function A Function B Function C Controller Gateway Client Palaemon
SGX Enclave Native Application Trust Established
Function A Function B Function C Controller Gateway Client Palaemon Upload functions (Docker images)
SGX Enclave Native Application Trust Established
Function A Function B Function C Controller Gateway Client Palaemon
SGX Enclave Native Application Trust Established
Function A Function B Function C Controller Gateway Client Palaemon Remote attestation via Palaemon at launch
SGX Enclave Native Application Trust Established
Function A Function B Function C Controller Gateway Client Palaemon
SGX Enclave Native Application Trust Established
Function A Function B Function C Controller Gateway Client Palaemon TLS API Request
SGX Enclave Native Application Trust Established
Function A Function B Function C Controller Gateway Client Palaemon TLS API Request
SGX Enclave Native Application Trust Established
Function A Function B Function C Controller Gateway Client Palaemon TLS API Request Plaintext Metadata + + Encrypted Data
SGX Enclave Native Application Trust Established
Function A Controller Gateway Client Palaemon TLS API Request Plaintext Metadata + + Encrypted Data Worker Platform Plaintext Metadata + + Encrypted Data
SGX Enclave Native Application Trust Established
Function A Controller Gateway Client Palaemon TLS API Request Plaintext Metadata + + Encrypted Data Worker Platform Plaintext Metadata + + Encrypted Data 1. Platform launches the enclave using the plaintext metadata
SGX Enclave Native Application Trust Established
Function A Controller Gateway Client Palaemon TLS API Request Plaintext Metadata + + Encrypted Data Worker Platform Plaintext Metadata + + Encrypted Data 1. Platform launches the enclave using the plaintext metadata 2. Enclave performs remote attestation and configuration with Palaemon
SGX Enclave Native Application Trust Established
Plaintext Metadata + + Encrypted Data
Function A Controller Gateway Client Palaemon TLS API Request Worker Platform Plaintext Metadata + + Encrypted Data 1. Platform launches the enclave using the plaintext metadata 2. Enclave performs remote attestation and configuration with Palaemon 3. Enclave decrypts and processes the request
SGX Enclave Native Application Trust Established
56
Function A Function B Function C Controller Gateway Function A Function B Function C Controller Gateway
SGX Enclave Native Application
lower ➝ better
lower ➝ better
Number of functions running on the worker node
lower ➝ better
lower ➝ better
Minimal overhead (~1-5%) over native API Gateway
lower ➝ better
Function Controller Gateway Function Controller Gateway
SGX Enclave Native Application
lower ➝ better
lower ➝ better
lower ➝ better
Minimal overhead over native functions (up to 25%)
lower ➝ better
Function Controller Gateway Function Controller Gateway
SGX Enclave Native Application
SGXv1 SGXv2
Speedup normalized by the SGXv1 function run time
higher ➝ better
higher ➝ better
higher ➝ better
higher ➝ better
10 times lower latency on Phoenix benchmarks with SGXv2 10% lower latency from additional optimizations on a few benchmarks
higher ➝ better
Clemmys is:
Clemmys is:
Thank You for your attention!
bohdan.trach@tu-dresden.de
This project was funded by the European Union’s Horizon 2020 program under grant agreement No. 690588 (Selis), and BMBF No. 03ZZ0517A (FastCloud)