$30 off During Our Annual Pro Sale. View Details »

SSL, CAs and keeping your stuff safe

SSL, CAs and keeping your stuff safe

A capitalistic and system conformant talk about encryption.

Armin Ronacher

May 10, 2014
Tweet

More Decks by Armin Ronacher

Other Decks in Programming

Transcript

  1. SSL, CAs and keeping your stuff safe
    BQSFTFOUBUJPOCZBSNJOSPOBDIFSGPSQZHSVOO
    http://lucumr.pocoo.org/ — @mitsuhiko

    View Slide

  2. SSL, CAs and keeping your stuff safe
    BQSFTFOUBUJPOCZBSNJOSPOBDIFSGPSQZHSVOO
    http://lucumr.pocoo.org/ — @mitsuhiko
    a capitalistic and system conformant talk about encryption

    View Slide

  3. Armin Ronacher
    Independent Contractor for Splash Damage / Fireteam
    Doing Online Infrastructure for Computer Games

    View Slide

  4. … The Problem with Programmers
    ~ Epilogue ~

    View Slide

  5. Programmers think everything
    is a technical problem

    View Slide

  6. Fraud
    ~ Chapter 1 ~

    View Slide

  7. XXXX-XXXX-XXXX-1234
    What is the worst that can happen?

    View Slide

  8. What makes Credit Card Numbers “secure”?

    View Slide

  9. theft
    ere will always be criminals

    View Slide

  10. prevented
    But what damage can they do?

    View Slide

  11. Bitcoin A Credit Card
    Strong Encryption Potentially No Encryption
    256 bit private key 16 digit number + checksum
    decentralized centralized
    √ x

    View Slide

  12. But I'd rather lose my credit card …

    View Slide

  13. Never

    View Slide

  14. LOL

    View Slide

  15. We Accept Stolen Creditcards

    View Slide

  16. e Protocol
    e Process
    is insecure
    is secure

    View Slide

  17. If the aud percentage is smaller than
    the transaction fees we're all good.

    View Slide

  18. It's too easy to forget the
    bigger picture

    View Slide

  19. of Lock Symbols and Encryption
    ~ Chapter 2 ~

    View Slide

  20. the lock symbol is a lie

    View Slide

  21. the lock stands for secure

    View Slide

  22. but so is encryption
    8
    7

    View Slide

  23. such security

    View Slide

  24. such buzzwords
    CRIME
    BEAST
    Heartbleed
    BREACH
    PFS

    View Slide

  25. users need to understand how to
    keep good om bad lock symbols /
    good om bad encryption.
    =
    -

    View Slide

  26. but even developers are not sure yet …

    View Slide

  27. remember why you encrypt
    (NSA

    View Slide

  28. Why do we Encrypt Traffic?
    ~ Chapter 3 ~

    View Slide

  29. View Slide

  30. public WiFi the unencrypted browser session
    kilLed

    View Slide

  31. ?
    Who is the Attacker?

    View Slide

  32. om secret agents to idiots

    View Slide

  33. om targeted to untargeted

    View Slide

  34. om low to high probability

    View Slide

  35. What You Need for Encryption
    ~ Chapter 4 ~

    View Slide

  36. passive vs active eavesdropping
    encryption authentication

    View Slide

  37. $ ssh pocoo.org
    The authenticity of host 'pocoo.org (148.251.50.164)' can't be established.
    RSA key fingerprint is 14:23:83:02:45:f9:9c:d0:eb:39:c7:14:42:f5:9f:9c.
    Are you sure you want to continue connecting (yes/no)?

    View Slide

  38. your user does not check ngerprints
    (your

    View Slide

  39. e
    Certificate Authorities
    thus:

    View Slide

  40. CAs are worthless for securing APIs
    let it be known that

    View Slide

  41. Protecting APIs and Services
    ~ Chapter 5 ~
    (non

    View Slide

  42. The Only Rule to Follow

    View Slide

  43. run your own CA
    issue certi cates for 24 hours
    trust your own CA only
    screw re ocations

    View Slide

  44. You trust your own CA by
    distributing the certi cate to
    everybody.

    View Slide

  45. If your root gets compromised,
    distribute new root certi cates.

    View Slide

  46. If an individual key gets compromised,
    in less than 24 hours everything is ne.

    View Slide

  47. from requests import get
    resp = get('https://api.yourserver.com/',
    verify='your/certificate.bundle')

    View Slide

  48. “But my awesome AntiVirus says
    your certi cate is not trusted.”
    — Windows User

    View Slide

  49. Certificate Authorities Again
    ~ Chapter 6 ~

    View Slide

  50. Hardly news: CAs are Broken

    View Slide

  51. But why are the broken?

    View Slide

  52. I Trust “TÜRKTRUST Elektronik Serti ka Hizmet
    Sağlayıcısı” to ouch for the identity of any domain on
    the planet.
    Trusting a CA:

    View Slide

  53. trusting half the world: one shitty employee in one shitty
    CA is enough to break your security.

    View Slide

  54. I Trust “Comodo” to ouch for the identity of “Foo
    Owner” foo.com.
    I only trust “Foo Owner” to ouch for the identity of
    api.foo.com
    What we actually want:

    View Slide

  55. if you have seen google.com being from Verisign and all
    the sudden google.com becomes a StartSSL certificate you
    know something might be wrong.

    View Slide

  56. Soon: Certificate Pinning?

    View Slide

  57. Frack OpenSSL and Question “Best Practices”
    ~ Chapter 7 ~

    View Slide

  58. Self-Signed Certificates are not bad. Just in browsers.

    View Slide

  59. Never. Ever. Look at OpenSSL's Source.

    View Slide

  60. OpenSSL's "patches" are even worse:
    Apple's OpenSSL always trusts system store :-/

    View Slide

  61. Requests by default trusts it's own bundle :-/
    (And does not even properly document how to use custom ones)

    View Slide

  62. With Heartbleed SSL was less secure than no SSL :-/

    View Slide

  63. Growing SSL
    ~ Chapter 8 ~

    View Slide

  64. Credit Cards were made for thousands of people
    Certificate Authorities were made for hundreds of sites

    View Slide

  65. OpenSSL was probably improperly audited

    View Slide

  66. See “OpenSSL Valhalla Rampage” :-(
    “i give up. reuse problem is unixable.
    dlg says puppet crashes”
    — tedu

    View Slide

  67. Plan for Failure
    ~ Chapter 9 ~

    View Slide

  68. what

    View Slide

  69. what happens to your user if he gets hacked?
    (food for thought: keyloggers are still a thing)

    View Slide

  70. what happens to your data

    View Slide

  71. what happens to your company

    View Slide

  72. encryption is hardened security
    it must not be your only defense

    View Slide

  73. ?
    Feel Free To Ask Questions
    Talk slides will be online on lucumr.pocoo.org/talks
    You can find me on Twitter: @mitsuhiko
    And gittip: gittip.com/mitsuhiko
    Or hire me: [email protected]

    View Slide