Fast Client-Centric Trusted Key-Value Store Using Intel ...

20
Precursor: A Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Ines Messadi , Rüdiger Kapitza, -- [email protected] Technische Universität Braunschweig, Germany

Transcript of Fast Client-Centric Trusted Key-Value Store Using Intel ...

Page 1: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Precursor: A Fast Client-Centric TrustedKey-Value Store Using Intel SGX and RDMAInes Messadi, Rüdiger Kapitza, [email protected] Universität Braunschweig, Germany

Page 2: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

In-Memory Key-Value Stores

Key-value stores are core of large-scale services

Optimized systems can process millions ofrequests/second Client  requests

Actor

Application code

Key-value store

Read

Cache misses

Primary database

Industry: Redis, Memcached,..→ Lack of basic security guarantees, e.g plaintext key-value itemsResearch: Concerto [SIGMOD’17]→ Secure but intensive computations and no support of fastnetworking technologies

2019-11-22 Ines Messadi Page 2Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 3: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Security in the Cloud

Outsourced to the cloudLimited trusted in the cloud providerUser data is exposed to malicious attacksConcerns about privacy & integrity

GET/SET

Untrusted CloudInfrastructure

Rogue administrator, attacker..

ItemAB.....

Value12331249

.....0

⇒ Improvements with trusted execution environmentssuch as Intel Software Guard Extensions (Intel SGX)

2019-11-22 Ines Messadi Page 3Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 4: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Intel SGX Model

Extension of the x86 instruction setApplications have secure compartments→EnclaveCode & data reside in Enclave Page Cache (EPC)Confidentiality and integrity protectedRestriction of systems calls and I/O operations CPU

Operating System

Application

DRAM

Hardware

Enclave

EPC

2019-11-22 Ines Messadi Page 4Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 5: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Approaches for Securing Applications

SGX SDK: Porting the application→ Tedious to port

Shielded execution: Run unmodified applicationswith Graphene (ATC’17), SCONE (OSDI’16)..

→ Secure but large trusted computing base (TCB)

⇒ SGX is best suited for programs with small TCB

Address Space

Enclave

LibOS

Application Binary

Can we use shielded execution runtime for key-value stores?

2019-11-22 Ines Messadi Page 5Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 6: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Approaches for Securing Applications

SGX SDK: Porting the application→ Tedious to port

Shielded execution: Run unmodified applicationswith Graphene (ATC’17), SCONE (OSDI’16)..

→ Secure but large trusted computing base (TCB)

⇒ SGX is best suited for programs with small TCB

Address Space

Enclave

LibOS

Application Binary

Can we use shielded execution runtime for key-value stores?

2019-11-22 Ines Messadi Page 5Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 7: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Intel SGX Architectural Limitations1. Limited EPC memory

Limited to 128 Mibs, only ∼93 Mibs are usableSecure paging mechanism→ Overhead up to ×1000 [SCONE, OSDI]

→ Cannot protect the full state using the EPC memory!

2. System call restriction & enclave transitionsEnclave exiting, security checks and TLB flushing

→ Performance loss

3. New: DMA directly into the enclave are not allowedCopying data in/out of enclaves

→ Large copy overhead

How to secure applications that utilizeRemote Direct Memory Access (RDMA)?

2019-11-22 Ines Messadi Page 6Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 8: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Intel SGX Architectural Limitations1. Limited EPC memory

Limited to 128 Mibs, only ∼93 Mibs are usableSecure paging mechanism→ Overhead up to ×1000 [SCONE, OSDI]

→ Cannot protect the full state using the EPC memory!

2. System call restriction & enclave transitionsEnclave exiting, security checks and TLB flushing

→ Performance loss

3. New: DMA directly into the enclave are not allowedCopying data in/out of enclaves

→ Large copy overhead

How to secure applications that utilizeRemote Direct Memory Access (RDMA)?

2019-11-22 Ines Messadi Page 6Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 9: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Data Center Technology: RDMA

Often employed in data centers

Zero-copy & kernel bypassing communication

Applications register memory with RDMA NIC

Queue-based and asynchronous operations

BUF

NICCPU

BUF

NIC CPU

MemoryMemory

2019-11-22 Ines Messadi Page 7Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 10: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Our Contribution

Precursor: A Fast and Secure Key-Value Store

→ Intel SGX to Protect security-sensitive data→ RDMA to achieve high-performance with low-latency

Security PropertiesConfidentiality: unauthorized entities cannot read the dataIntegrity: unauthorized changes to the data can be detected

2019-11-22 Ines Messadi Page 8Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 11: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Related Work: SGX-Based Key-Value Stores

SPEICHER [FAST ’19]Tailored RocksDB implementationDirect I/O library based on SPDK

ShieldStore [Eurosys’19]Store main data structure in untrusted memoryRelies on Merkle Tree for integrity verification

Copy

Server1

Decrypt

Encrypt3

Copy

Key Value

Transport Encrypted

2

4

→ Potential problems1. Additional data copy and encryption inside the enclave2. Extensive server-side computation→ CPU bottlenecks

Our approach: Client-side encryption to alleviate CPU bottlenecks

2019-11-22 Ines Messadi Page 9Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 12: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Contribution

HERD[SIGCOMM '14]

RDMA

Pilaf[ATC'13]

FARM[NSDI'14]

TEE/SGX

Concerto[SIGMOD'17]

SPEICHER[FAST'19]

ShieldStore[Eurosys'19]

Precursor

What do we gain from combining both technologies?How to combine them efficiently?

2019-11-22 Ines Messadi Page 10Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 13: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Threat Model

What an adversary can do?Tamper with the OS and hardwareTamper with key-value dataTamper with key-value server code

An adversary cannotModify the state within the enclave

Clients environments are secure

2019-11-22 Ines Messadi Page 11Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 14: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Overall Architecture

Client 1

Encrypted VAL

Untrusted Memory

Poll

Indexed-hashmap (Security

Meta-data)

Enclave MemoryTransport Encryption

In-Memory Encryption

1xSplitting

Offloading cryptographic operations to the client-side→ Additional scalabilitySplitting approach

No copy of the full payload in the enclaveFlow control scheme

Server shares a memory window and regularly updates client

2019-11-22 Ines Messadi Page 12Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 15: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

SET Request

A unique per-operation client encryption keyData is placed in the untrusted memoryClients pre-compute cryptographic operations

......

Untrusted Memory Enclave MemoryClient

SET: Es(VALUE)

ID S MACKEY

SKeyP

SKeyPID

3 Transport decryption and MAC verification

2

CMAC

1

ES(VALUE) MAC

ES(VALUE) MAC

MACs(ES(VALUE))

2019-11-22 Ines Messadi Page 13Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 16: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

GET RequestUntrusted Memory Enclave Memory

SKeyP ID

Worker Thread Mac verification

1

3

4

Client

Mac & Transport Verification6

8

7 Compute MACs(Es(VALUE))

Decrypt using S

Es(VALUE)MACSID

ID MACKEY

GET Request

Reply

2

5

MACs(Es(VALUE))

ES(VALUE) MAC

2019-11-22 Ines Messadi Page 14Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 17: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Evaluation Setup

Workload: Yahoo! Cloud Serving Benchmark (YCSB) [SoCC 2010]

Update-heavy workload

Two machines with Intel Xeon E3-1230 v5

Mellanox RoCE RDMA controller 10 Gbit/s

Comparison with Shieldstore [Eurosys’19]

2019-11-22 Ines Messadi Page 15Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 18: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Preliminary Results: Throughput

32 64 128 256 5120

50

100

150

200

250

300

350

400

Value Size

RPS(K

OPS)

ShieldStore Proposed key-value store

→ Reasonable performance and outperforms ShieldStorefor large data sizes

2019-11-22 Ines Messadi Page 16Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 19: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Future Work

Multi-core scalabilityEfficient support of Multithreading with fewer synchronization

Caches of the most popular accessed entriesUse of one-sided fetches

Design of a distributed solution with multiple key-value stores

2019-11-22 Ines Messadi Page 17Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks

Page 20: Fast Client-Centric Trusted Key-Value Store Using Intel ...

Motivation Intel SGX RDMA Design Evaluation Conclusion

Conclusion

A key-value store with strong confidentiality & integrity guarantees

ContributionsCombination of RDMA and Intel SGXClient-side computation

→ Leveraging RDMA improves the performance→ Optimizing for CPU utilization is key

2019-11-22 Ines Messadi Page 18Fast Client-Centric Trusted Key-Value Store Using Intel SGX and RDMA Institute of Operating Systems

and Computer Networks