The document discusses protecting Redis with Intel SGX. It begins with an overview of Intel SGX and how it can be used to protect Redis running inside an enclave. It then discusses using Graphene-SGX to port Redis into an enclave without code changes. It also describes adding network and filesystem shields to encrypt data in transit and at rest. The presentation concludes by discussing remote attestation and using an Intel SGX card to run Redis on encrypted hardware.
3. RedisConf 2019
Redis Security in Open Source Version
Data in Transit Data at Rest
plaintext [ TCP ] plaintext [ FS ]
plaintext
[ KVs in RAM ]
Data in Use
3
4. RedisConf 2019
Redis Security in Open Source Version
Data in Transit Data at Rest
plaintext [ TCP ] plaintext [ FS ]
plaintext
[ KVs in RAM ]
Data in Use
Enterprise private network
4
5. RedisConf 2019
Public cloud
Redis Security in Open Source Version
Data in Transit Data at Rest
plaintext [ TCP ] plaintext [ FS ]
plaintext
[ KVs in RAM ]
Data in Use
5
6. RedisConf 2019
Redis Security in Open Source Version
Data in Transit Data at Rest
plaintext [ TCP ] plaintext [ FS ]
plaintext
[ KVs in RAM ]
Data in Use
Public cloud
6
7. RedisConf 2019
Redis Security in Open Source Version
Data in Transit Data at Rest
plaintext [ TCP ] plaintext [ FS ]
plaintext
[ KVs in RAM ]
Data in Use
Public cloud
stolen
7
8. RedisConf 2019
Redis Security in Open Source Version
Data in Transit Data at Rest
plaintext [ TCP ] plaintext [ FS ]
plaintext
[ KVs in RAM ]
Data in Use
Public cloud
stolen
8
9. RedisConf 2019
Redis Security in Enterprise Version
Data in Transit Data at Rest
plaintext [ TCP ] plaintext [ FS ]
plaintext
[ KVs in RAM ]
Data in Use
Public cloud
9
10. RedisConf 2019
Redis Security in Enterprise Version
Data in Transit Data at Rest
encrypted [ TLS ] plaintext [ FS ]
plaintext
[ KVs in RAM ]
Data in Use
Public cloud
10
11. RedisConf 2019
Redis Security in Enterprise Version
Data in Transit Data at Rest
encrypted [ TLS ] encrypted [ FDE ]
plaintext
[ KVs in RAM ]
Data in Use
Public cloud
11
12. RedisConf 2019
Redis Security in Enterprise Version
Data in Transit Data at Rest
encrypted [ TLS ] encrypted [ FDE ]
plaintext
[ KVs in RAM ]
Data in Use
Public cloud
stolen
12
13. RedisConf 2019
Redis Security in Enterprise Version
Data in Transit Data at Rest
encrypted [ TLS ] encrypted [ FDE ]
plaintext
[ KVs in RAM ]
Data in Use
Public cloud
13
14. RedisConf 2019
Redis Security in Enterprise Version
Data in Transit Data at Rest
encrypted [ TLS ] encrypted [ FDE ]
plaintext
[ KVs in RAM ]
Data in Use
Public cloud
14
15. RedisConf 2019
Redis Security in Intel® SGX Version
Data in Transit Data at Rest
encrypted [ TLS ]
encrypted
[ KVs in enclave ]
Data in Use
Public cloud
encrypted
[ ProtectedFS]
15
16. RedisConf 2019
Data at Rest
encrypted [ TLS ]
encrypted
[ KVs in enclave ]
encrypted
[ ProtectedFS]
Public cloud
Redis Security in Intel® SGX Version
Data in Use
Redis enclave
Network
shield
encrypted encrypted
FS
shield
16
17. RedisConf 2019
Redis Security in Intel® SGX Version
Data in Transit Data at Rest
encrypted [ TLS ]
encrypted
[ KVs in enclave ]
Data in Use
Public cloud
17
encrypted
[ ProtectedFS]
18. RedisConf 2019
Redis Security in Intel® SGX Version
Data in Transit Data at Rest
encrypted [ TLS ]
Data in Use
Public cloud
encrypted
[ KVs in enclave ]
18
encrypted
[ ProtectedFS]
19. RedisConf 2019
Data at Rest
encrypted [ TLS ]
Public cloud
encrypted
[ KVs in enclave ]
encrypted
[ ProtectedFS]
Redis Security in Intel® SGX Version
Data in Use
Redis enclave Redis enclave Redis enclave
Redis cluster bus
19
22. RedisConf 2019
Current Protection Mechanisms are Insufficient
Redis process Malicious process
Linux kernel
KVM hypervisor
22
Intel® CPU
23. RedisConf 2019
Current Protection Mechanisms are Insufficient
Redis process Malicious process
Linux kernel
KVM hypervisor
23
Intel® CPU
24. RedisConf 2019
Current Protection Mechanisms are Insufficient
Redis process
Linux kernel
KVM hypervisor
Rogue
sysadmin
Malicious process
24
Intel® CPU
25. RedisConf 2019
Intel® SGX Enclaves to the Rescue
Redis enclave
Linux kernel
KVM hypervisor
Rogue
sysadmin
Malicious process
25
Intel® CPU
26. RedisConf 2019
Redis process
Intel® SGX Enclaves to the Rescue
Linux kernel
KVM hypervisor
Rogue
sysadmin
Malicious process
26
Intel® CPU
Redis
enclave
27. RedisConf 2019
Reducing Trust Assumptions
Classical Model Intel® SGX model
Redis process
Linux kernel
KVM hypervisor
HW
CPU DRAM
Attack surface
Redis process
Linux kernel
KVM hypervisor
HW
CPU DRAM
Redis
enclave Attack
surface
27
28. RedisConf 2019
Intel® SGX: Software Perspective
Redis
process
I/O Code
I/O Data
Enclave
Redis
Code
Redis
Data
28
29. RedisConf 2019
Intel® SGX: Hardware Perspective
Snooping/Injection/Replay
Core
Core
Cache
MC
MEE
CPU Package Trust Boundary
Protected
enclave data in
DRAM
Unprotected
data in DRAM
29
Memory dump/cold boot attack
32. RedisConf 2019
Original With SGX SDK With Graphene-SGX
§ No data-in-use
protection
§ Protected Redis
§ Tedious to port
§ Protected Redis
§ No changes to code
Redis process Redis process
Redis (modified)
I/O (modified)
Redis process
Redis (binary)
Graphene LibOS
Moving Redis into Enclave
32
33. RedisConf 2019
Host OS (Linux)
Platform Adaptation Layer
Library OS
Shared libs (glibc)
Redis executable
Graphene-SGX Library OS
Linux System Call API
~ 300 Functions
Host ABI
~40 Functions
~50 Linux
System Calls
User
Kernel
SGX Enclave
33
34. RedisConf 2019
Host OS (Linux)
Platform Adaptation Layer
Library OS
Shared libs (glibc)
Redis executable
Graphene-SGX Library OS
Linux System Call API
~ 300 Functions
Host ABI
~40 Functions
~50 Linux
System Calls
User
Kernel
Enclave
34
35. RedisConf 2019
Host OS (Linux)
Untrusted PAL
Trusted PAL
Library OS
Shared libs (glibc)
Redis executable
Graphene-SGX Library OS
Linux System Call API
~ 300 Functions
Host ABI
~40 Functions
~50 Linux
System Calls
User
Kernel
~40 SGX
OCALLs
Enclave
35
44. RedisConf 2019
Public cloud
Remote Attestation with Intel® SGX
encrypted [ TLS ]
encrypted
[ KVs in enclave ]
How do I know correct
Redis runs inside true
SGX enclave?
44
45. RedisConf 2019
Public cloud
Remote Attestation with Intel® SGX
encrypted [ TLS ]
plaintext
emulate SGX enclave
45
How do I know correct
Redis runs inside true
SGX enclave?
46. RedisConf 2019
Public cloud
Remote Attestation with Intel® SGX
encrypted [ TLS ]
Redis Code
CPU
SGX Attestation Evidence = Measurement + Signature
46
Public key from Intel
How do I know correct
Redis runs inside true
SGX enclave?
53. RedisConf 2019
Intel® SGX: Enclave Memory Size
Core
Core
Cache
MC
MEE
CPU Package Trust Boundary
Protected
enclave data in
DRAM
Unprotected
data in DRAM
53
128MB
54. RedisConf 2019
User-Level Swapping
Redis process
Redis enclave
keys➞values
Redis process
Redis enclave
keys➞values
kv metadata
user-level swapping
(encrypted)
§ Based on Virtual Memory feature
§ ~700 lines of code
§ ~20% performance improvement
54
56. RedisConf 2019
Conclusion
56
Intel® Xeon Platinum server with an Intel® SGX Card with Ubuntu 16.04 and Redis 5.0, connected to a memtier_benchmark client via a 1Gbps Ethernet.
Testing was performed by Intel Labs on 03.4.2019.
57. RedisConf 2019
Conclusion
Data in Transit Data at Rest
encrypted
Redis-SGX
Data in Use
encrypted
§ Intel® SGX: https://software.intel.com/en-us/sgx
§ Graphene-SGX: https://github.com/oscarlab/graphene
§ Redis-SGX: [ TBD ]
57
63. RedisConf 2019
Public key from Intel
SGX attestation evidence
Remote Attestation with Intel® SGX
encrypted [ TLS ]
Redis Code
CPU
encrypted msgs
“client hello”
“server hello” + cert + evidence
client hello key exchange
TLS self-signed certificate
TLS certificate is tied to SGX
attestation certificate
TLS certificate ties SGX attestation
evidence to current TLS session
Verify
measurement and
signature
63
How do I know correct
Redis runs inside true
SGX enclave?
64. RedisConf 2019
Public cloud
Data at Rest
encrypted [ TLS ] encrypted [ FDE ]
Redis Security in Enterprise Version
plaintext
[ KVs in RAM ]
Data in Use
Redis process
TLS wrapper
process
plaintext
encrypted
OS/driver
encryption
encrypted
plaintext
64