TLS Deep Dive
Total Page:16
File Type:pdf, Size:1020Kb
12/9/17 TLS Deep Dive Website Security & More Joe Pranevich December 5, 2017 Today’s Session – Overview of TLS – Connection Establishment – Testing Tools – Recent Security Issues 1 12/9/17 What is SSL/TLS? – Core internet protocols (IP, TCP, HTTP) were designed without default security – SSL was invented in 1995 by Netscape to support encryption of web traffic for ecommerce and other uses. – SSL/TLS sits above TCP. It can be used to encrypt many protocols, but mostly used for HTTP. – Over two decades, SSL has been improved (with vulnerabilities discovered in older versions). The name was changed to TLS in 1999. SSL & TLS Timeline Protocol Released Notes SSLv2 1995 Vulnerable, depreciated in 2011 SSLv3 1996 Vulnerable, depreciated in 2015 TLS 1.0 1999 At risk, no longer permitted by PCI TLS 1.1 2006 TLS 1.2 2008 TLS 1.3 TBD Internet Draft 2 12/9/17 But Wait, There’s More! – TLS supports dozens of different encryption methods, compression methods, hashing functions, and other details. – Clients and servers select from a menu of these options to negotiate the best security (more on that later) – Most of these options have their own security histories, some have been deprecated, etc. Key Concepts – Shared Key Cryptography (Symmertric) – Public/Private Key Cryptography (Asymmetric) – Hashing 3 12/9/17 Connection Establishment – TLS Handshake – Cipher negotiation – Certificate Validation – Device Compatibility TLS Handshake – Part One – Client sends a “hello” message saying that they want TLS. – It includes TLS version, ciphers it supports, and other details – Server sends a “hello” message back. – It selects the most secure matching TLS version and ciphers – Connection will fail if client and server cannot agree on protocols and ciphers 4 12/9/17 Client Devices Have Different Capabilities As Do Servers & Load Balancers 5 12/9/17 We Care About The Intersection Backwards Compatibility Warning! – Web browsers and operating systems get updated frequently; you can usually rely on web users having a recent TLS stack when they connect to you. – Mobile devices are updated less frequently. – Making your system “secure” can easily block access to your customers! 6 12/9/17 Android Usage - Sep 2017 Nearly 10% of Android users are running Jelly Bean (4.2.x) or below. No support for TLS 1.1 or 1.2, weak cipher suites. No ALPN support Windows XP It’s not just mobile devices. As of 2017, 7% of PCs still run Windows XP. No TLS 1.1 or 1.2. All supported ciphers are considered insecure. 7 12/9/17 Cipher Suites - The Important Parts – Key Exchange Algorithm - How the client/server will authenticate – RSA, DHE, ECDHE – Block Cipher - Encryption for the data flow – RC4, 3DES, AES – Message Authentication Algorithm - Hashing function used to validate data – MD5, SHA TLS Handshake – Part Two – We know both sides can talk, what next? – If SNI in use, client sends requested hostname. – Server sends its certificate which will be used and validated by the client – Only when the server verifies it can trust the client, can the connection proceed. 8 12/9/17 Certificate Validations – The certificate is the “proof” that we are who we say we are. – Without validating certs, we could have MITM attacks. – Certificates purchased from a trusted vendor (more on that soon!) Trust Chains – Devices have to “trust” the company that we get our cert from. – They do this by pre-storing “root” certificates for major trusted vendors – Different devices trust different certificate vendors. You have to be cautious with new vendors (like LetsEncrypt) on old devices. 9 12/9/17 iOS 9’s Trust Anchors (Partial) Never Break The Chain 10 12/9/17 Intermediate Certificates Even More on Certificate Validations – Certificates are given out to a specific hostname or “wildcard” – Older clients cannot specify what “hostname” is being requested (using SNI), so one IP can only be used for one hostname/set of “alternative names” – Wildcard handling can be inconsistent across devices 11 12/9/17 Oh Boy, Even More… – Certificates include an embedded hash – SHA-1-based certificates are recently considered insecure – Some devices are now rejecting SHA-1 certs. SHA-1 is even being phased out for intermediate certs. What About Extended Validation? – We can purchase “Extended Validation” certificates (for a higher fee). This does more to prove we are who we say we are. – Browsers display EV websites differently, to let consumers know about the increased trust. – TLS-wise, there is no difference. 12 12/9/17 Testing Tools – SSL Labs – NMAP – OpenSSL SSL Labs 13 12/9/17 NMAP jpranevich$ nmap -sV --script ssl-enum-ciphers -p 443 www.cnn.com Starting Nmap 7.60 ( https://nmap.org ) at 2017-12-05 01:08 EST Nmap scan report for www.cnn.com (151.101.117.67) Host is up (0.013s latency). Other addresses for www.cnn.com (not scanned): 2a04:4e42:1c::323 PORT STATE SERVICE VERSION 443/tcp open ssl/http-proxy Varnish |_http-server-header: Varnish | ssl-enum-ciphers: | TLSv1.0: | ciphers: | TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A | TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A | TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A | TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A | TLS_RSA_WITH_3DES_EDE_CBC_SHA (rsa 2048) - C | compressors: [...] OpenSSL jpranevich$ openssl s_client -connect www.cnn.com:443 CONNECTED(00000003) depth=2 C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA verify return:1 depth=1 C = BE, O = GlobalSign nv-sa, CN = GlobalSign CloudSSL CA - SHA256 - G3 verify return:1 depth=0 C = US, ST = California, L = San Francisco, O = "Fastly, Inc.", CN = turner-tls.map.fastly.net verify return:1 --- Certificate chain 0 s:/C=US/ST=California/L=San Francisco/O=Fastly, Inc./CN=turner-tls.map.fastly.net i:/C=BE/O=GlobalSign nv-sa/CN=GlobalSign CloudSSL CA - SHA256 - G3 1 s:/C=BE/O=GlobalSign nv-sa/CN=GlobalSign CloudSSL CA - SHA256 - G3 i:/C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA --- Server certificate -----BEGIN CERTIFICATE----- MIIMwzCCC6ugAwIBAgIMBBfbL+G5qtVTH301MA0GCSqGSIb3DQEBCwUAMFcxCzAJ BgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMS0wKwYDVQQDEyRH [...] 14 12/9/17 Recent Security Issues – SHA-1 – POODLE Attack (SSLv3 and TLS 1.0) – DROWN Attack – Google vs. Symantec – Expire Keys Faster SHA-1 – Hashing algorithm designed in 1993. Found insecure in 2005. – Vendors announced cease support. Google Chrome ceased in January 2017 with other vendors following suit. – Old certificates had to be replaced. Even SHA-1 intermediates are no longer being used. (This causes some device incompatibilities!) 15 12/9/17 SSLv3 - POODLE Attack – Attack found against SSLv3 connections in September 2014. – Affects SSLv3 and buggy implementations of TLS 1.0 – SSLv3 is no longer supported by most clients. DROWN Attack – Attack found against current security protocols, if you use SSLv2 anywhere in your network – Attacker piggybacks an attack on an insecure SSLv2 endpoint (with the same certificate) to break encryption on even TLS 1.2 – Disable SSLv2! Flaws have been known since 2011! Get with it! 16 12/9/17 Google vs Symantec – Between 2013 and 2017, Symantec (or their subsidiaries) had multiple instances of certificates being issued incorrectly or to the wrong organization. – More than 30,000 incorrectly issued certificates were identified – In March 2017, Google announced that it would cease trusting Symantec certificates over time – After extensive negotiations with Symantec, Google finalized the “punishment” in September. Google’s Actions – Google and other vendors negotiated with Symantec on their solution – All existing Symantec certs will be distrusted over time. – In December, Symantec will exit the certificate business, instead transitioning responsibilities to a third party, DigiCert – Only DigiCert certificates will be trusted after the sundown period 17 12/9/17 Sunset One: April 2018 – Google will cease trusting all certificates issued before June 1, 2016. – All these certificates must be re-issued between January and March to prevent impact Sunset Two: October 2018 – In October, Google will cease accepting all legacy certificates issued by Symantec – Even a certificate issued today will be distrusted – Any certificates that expired between the announcement and December 2017 must have been reissued twice. 18 12/9/17 So Much More to Talk About – Forward Secrecy – OCSP & OCSP Stapling – DNS CAA Records – Session Tickets – ALPN – And so much more... Questions? THANK YOU 19 .