37
Nicholas Sullivan Systems Engineer CloudFlare @grittygrease Running Secure Server Software on Insecure Hardware without a Parachute

Running Secure Server Software on Insecure Hardware Without Parachute

Embed Size (px)

DESCRIPTION

In today’s world, you may not know if the hardware you are running software on is secure or not. How can you ensure that, regardless of the hardware security, the software stays protected? CloudFlare’s systems engineer, Nick Sullivan shares advanced techniques on how to protect your server software. These techniques include anti-reverse engineering methods, secure key management and designing a system for renewal.

Citation preview

Page 1: Running Secure Server Software on Insecure Hardware Without Parachute

Nicholas Sullivan Systems Engineer

CloudFlare@grittygrease

Running Secure Server Software on Insecure Hardware without a Parachute

Page 2: Running Secure Server Software on Insecure Hardware Without Parachute

What this talk is aboutu The web is changing — consolidation at the edge u Fundamental assumptions about server security are wrong u How do we design server software with the worst case in mind?

u Distinguish between long and short term secrets u Devise approaches for protecting each

2

Page 3: Running Secure Server Software on Insecure Hardware Without Parachute

Let’s Talk About Web Infrastructure

Page 4: Running Secure Server Software on Insecure Hardware Without Parachute

4

Page 5: Running Secure Server Software on Insecure Hardware Without Parachute

Global Website Traffic

5

Page 6: Running Secure Server Software on Insecure Hardware Without Parachute

Global Website Traffic with CDN

6

Page 7: Running Secure Server Software on Insecure Hardware Without Parachute

Current Map

7

Page 8: Running Secure Server Software on Insecure Hardware Without Parachute

Future Map

8

Page 9: Running Secure Server Software on Insecure Hardware Without Parachute

Future Map

9

Page 10: Running Secure Server Software on Insecure Hardware Without Parachute

Edge Computing Threat Model

Page 11: Running Secure Server Software on Insecure Hardware Without Parachute

Traditional server threat modelu Assume server is secure u Add layers of protection to keep attackers out

u Network layer protection u Operating System Level: principle of least privilege u Protection against maliciously installed code u More advanced barriers

11

Page 12: Running Secure Server Software on Insecure Hardware Without Parachute

Globally distributed serversu Less jurisdictional control = less physical security u Physical access trumps static defense layers !

u Traditional defenses helpful, but not ideal u Cannot rely on security of keys u Single break-in results in immediate compromise

12

Page 13: Running Secure Server Software on Insecure Hardware Without Parachute

A More Effective Approach

Page 14: Running Secure Server Software on Insecure Hardware Without Parachute

Approach system security the ‘DRM way’u Assume attacker has bypassed all static defenses u Goal is to refresh secrets before they are compromised u Split system into long-term secrets and short-term secrets u Focus on renewability of secrets

14

Page 15: Running Secure Server Software on Insecure Hardware Without Parachute

Secrets must be split into two tiersu Long-term Secrets

u Useful for attacker for long period of time u Do not store at the edge !

u Short-term Secrets u Expire after a short period of time u Cannot be re-used

15

Page 16: Running Secure Server Software on Insecure Hardware Without Parachute

Example: Traditional TLS terminationu TLS handshake with nginx and Apache

u SSL keys on disk u Read from disk, use in memory !

u Cryptographic elements at risk if server is compromised u Private key u Session key

16

Page 17: Running Secure Server Software on Insecure Hardware Without Parachute

TLS revisited for untrusted hardwareu Long term secrets

u Private key

!u Short term secrets

u Session key u Session IDs and Session ticket keys u Credentials to access private keys

17

Page 18: Running Secure Server Software on Insecure Hardware Without Parachute

How to Protect Short-term Secrets

Page 19: Running Secure Server Software on Insecure Hardware Without Parachute

Short-term secrets — threat modelu Must live on machines in unsafe locations

u Memory u Control Flow

u By the time a secret is broken, it should be expired u Don’t keep secrets in a useable state u Impose computational cost to retrieve the original secret u Expire secrets quickly

!

19

Page 20: Running Secure Server Software on Insecure Hardware Without Parachute

Techniques from DRM are applicableu White-box cryptography u Code obfuscation

20

Page 21: Running Secure Server Software on Insecure Hardware Without Parachute

Standard Cryptography Threat Model

21

Alice Bob

Eve

Page 22: Running Secure Server Software on Insecure Hardware Without Parachute

White-box Cryptography Threat Model

22

Alice Bob

Eve

Page 23: Running Secure Server Software on Insecure Hardware Without Parachute

White-box Cryptography Threat Model

23

Aleve Bob

Page 24: Running Secure Server Software on Insecure Hardware Without Parachute

White-box cryptographyu Hide the cryptographic key from everyone u Protect against key extraction in the strongest threat model !

u Takes time to extract key — lots of math u Choose difficulty based on secret lifetime

24

Page 25: Running Secure Server Software on Insecure Hardware Without Parachute

White-box cryptography implementations

25

u Commercial products u Irdeto, Arxan, SafeNet, etc.

u Open source u OpenWhiteBox

Page 26: Running Secure Server Software on Insecure Hardware Without Parachute

Code obfuscation

26

Page 27: Running Secure Server Software on Insecure Hardware Without Parachute

Code obfuscationu Making reverse engineering difficult

u Compile-time control-flow modification u Data transformation in memory u Anti-debugging

27

Page 28: Running Secure Server Software on Insecure Hardware Without Parachute

Before

28

Page 29: Running Secure Server Software on Insecure Hardware Without Parachute

After

29

Page 30: Running Secure Server Software on Insecure Hardware Without Parachute

Code obfuscation implementationsu Commercial products

u Arxan, Irdeto, etc. u Open source

u Obfuscator-LLVM

30

Page 31: Running Secure Server Software on Insecure Hardware Without Parachute

Long-term Secrets

Page 32: Running Secure Server Software on Insecure Hardware Without Parachute

Keyless SSLu SSL without keys? Surely you’re joking. u SSL without keys at the edge. That’s better.

32

Page 33: Running Secure Server Software on Insecure Hardware Without Parachute

How Keyless SSL Worksu Split the TLS state machine geographically

u Perform private key operation at site owner’s facility (in HSM, etc) u Perform rest of handshake at edge u Communicate with signing server over mutually authenticated TLS

33

Page 34: Running Secure Server Software on Insecure Hardware Without Parachute

Keyless SSL Diagram

34

Page 35: Running Secure Server Software on Insecure Hardware Without Parachute

35

Page 36: Running Secure Server Software on Insecure Hardware Without Parachute

Conclusion

Page 37: Running Secure Server Software on Insecure Hardware Without Parachute

Conclusionu Untrusted hardware requires a new approach

u Split secrets into long-term and short-term u Design for rapid renewal — replace secrets faster than they can be

broken u Leverage short-term secrets to access long-term secrets

37