The Trip to TLS Land Using the WSA Tobias Mayer, Consulting Systems Engineer BRKSEC-3006 Me…
Total Page:16
File Type:pdf, Size:1020Kb
The Trip to TLS Land using the WSA Tobias Mayer, Consulting Systems Engineer BRKSEC-3006 Me… CCIE Security #14390, CISSP & Motorboat driving license… Working in Content Security & IPv6 Security tmayer{at}cisco.com Writing stuff at “blogs.cisco.com” Agenda • Introduction • Understanding TLS • Configuring Decryption on the WSA • Troubleshooting TLS • Thoughts about the Future • Conclusion For Your Reference • There are (many...) slides in your print-outs that will not be presented. • They are there “For your Reference” For Your Reference Microsoft and Google pushing encryption • Microsoft pushing TLS with PFS • Google, FB, Twitter encrypting all traffic • HTTPS usage influencing page ranking on google • Deprecate SHA1, only SHA2+ • Browser Vendors aggressively pushing https • Problems with older TLS versions leading to upgrade of servers to newer protocols and ciphers • Poodle, Freak, Beast, …. Google Search Engine • Google ranking influenced by using HTTPS • http://blog.searchmetrics.com/us/2015 /03/03/https-vs-http-website-ssl-tls- encryption-ranking-seo-secure- connection/ Understanding TLS TLS Versions • SSLv3, 1996 • TLS 1.0, 1999, RFC2246 • TLS 1.1, 2006, RFC4346 • Improved security • TLS 1.2, 2008, RFC5246 • Removed IDEA and DES ciphers • Stronger hashes • Supports authenticated encryption ciphers (AES-GCM) • TLS 1.3, currently Internet Draft Attacks… • POODLE • SSLv3 Problems with Padding, turn of SSLv3 • BEAST • Know issues in CBC mode, use TLS 1.1/1.2 with non-CBC mode ciphers (GCM) • CRIME/BREACH • Compression Data Leak, disable compression in TLS (CRIME), HTTP Compression still there • Lucky13 • Problem with Padding still exists with CBC Ciphers, use TLS 1.2 with AEAD (GCM) • Freak • Downgrade to RSA_EXPORT, disable EXPORT CIPHERS, use TLS 1.2 • Logjam • Force client to downgrade to DHE_EXPORT Grade ciphers, disable DHE_EXPORT Ciphers, use TLS 1.2 TLS Versions • SSLv3, 1996, broken by Poodle • TLS 1.0, 1999, RFC2246, weakend by BEAST and Lucky13 • TLS 1.1, 2006, RFC4346, weakend by Lucky13 • Improved security • TLS 1.2, 2008, RFC5246 • Removed IDEA and DES ciphers • Stronger hashes • Supports authenticated encryption ciphers (AEAD, i.e. AES-GCM) • TLS 1.3, currently Internet Draft How is the encryption of the target website? TLS Handshake Version Number Client Hello Version: Highest Version that the client Support Server Hello Version: This is the Version that we will use for the TLS Connection. Server SHOULD select the highest Version possible. Usually indicating lowest version supported Highest Version the client supports Ciphers explained Name Prot Kx Au Enc Bits Mac TLS_RSA_WITH_RC4_128_MD5 TLS RSA RSA RC4_128 128 MD5 TLS_DH_RSA_WITH_DES_CBC_SHA TLS DH RSA DES_CBC 56 SHA TLS_DHE_RSA_WITH_AES_128_CBC_SHA TLS DHE RSA AES_128_CBC 128 SHA TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA TLS ECDH ECDSA AES_256_CBC 256 SHA TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 TLS ECDHE RSA AES_256_GCM 256 SHA384 PFS – Perfect Forward Secrecy • Using RSA key for authentication and key generation is putting our traffic vulnerable to offline attacks • Someone might record out traffic and years later, compromise our Server, get the private key and decrypt all traffic. • Diffie-Hellman (DH) is a method to prevent this, but: • With static DH, the DH parameters are actually again the private key… • DHE is using unique keys for every session, this is called Perfect Forward Secrecy PFS - Example • DHE Ciphers use PFS • But are heavy to compute… • ECDHE Ciphers use Ecliptic Curves and provide PFS • Much better performance • Especially in Software AEAD – Authenticated Encryption https://en.wikipedia.org/wiki/Authenticated_encryption • Authenticated Encryption with associated data • CBC (confidentiality) + HMAC(integrity) vs. AE(confidentiality & integrity) • GCM is the most popular Algorithm https://en.wikipedia.org/wiki/Galois/Counter_Mode • No License and fast computing • Implemented in OPENSSL • Get more info about encryption in BRKSEC-3005! Breaking HTTPS 1. Generate public/private key and root certificate 2. install that root certificate on client devices Web Browser TLS proxy HTTPS Server 4. TLS Hello 3. Visit 5. TLS Hello website 6. Server Certificate 7. Validate certificate 8. Generate (spoofed) certificate, signed by our private key from (1) 9. (Spoofed) Server Certificate Did we forget someone? • The client needs to be able to support TLS versions & ciphers also • Overview can be found here: • https://en.wikipedia.org/wiki/Transport_Layer_Security Tobias Mayer, CSE Configuring Decryption on the WSA Explicit Proxy • Client requests a website • Browser connects first to WSA TCP_MISS_SSL/200 39 CONNECT tunnel://www.google.de:443 • WSA does DNS lookup - A record returned and/or AAAA record returned • Depending on WSA setting, WSA builts outgoing connection either on IPv4 or IPv6 Internet Web Web Security Appliance server IPv6 IPv4 Internet ASA NGFW Transparent Proxy via WCCP • Client requests a website using IPv4 or IPv6 • DNS Resolution is done by the Client • Browser tries to connect to Website TCP_MISS_SSL/200 0 TCP_CONNECT • Network85.17.181.244:443 Device redirects traffic to WSA using WCCP • WSA proxies the request Web Security Appliance Internet Web IPv6 server IPv4 Internet ASA NGFW Certificate installation and usage - recap • The WSA needs a CA Certificate to be installed for TLS decryption • Not a WEB SERVER CERTIFICATE!!! TAC will say thank you for this! • After receiving the HTTPS Request, the WSA will grab the server certificate from the destination • It will create a new certificate with (nearly) all the fields and sign this with her own certificate • CRL is not replicated because it would not match the “new” certificate • Client needs to trust the certificate from the WSA • Use a trusted Enterprise subordinate CA certificate or roll out your self-signed cert to the clients via GPO • Certificates on the WSA use PEM format Certificate installation and usage BASIC CONTRAINTS : Critical • https://tools.ietf.org/html/rfc5280#section-4.2 “Each extension in a certificate is designated as either critical or non-critical. A certificate-using system MUST reject the certificate if it encounters a critical extension it does not recognize or a critical extension that contains information that it cannot process. A non-critical extension MAY be ignored if it is not recognized, but MUST be processed if it is recognized.” • Basic Constraints defines if the Certificate is a CA, recommended to set to CRITICAL Certificate installation and usage • Browser Companies & CA phasing out SHA-1: https://blog.mozilla.org/security/2014/09/23/phasing-out-certificates-with-sha-1- based-signature-algorithms/ • https://googleonlinesecurity.blogspot.rs/2014/09/gradually-sunsetting-sha-1.html • Moving to SHA-2 • Set of algorithms: SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256 • WSA 9.x+ • Generating a self-signed certificate will use SHA-256 by default and 2048 bit RSA key • CSR can be sent to a CA but CA needs also to use SHA-256 • Importing externally generated certificate and key is possible • DSA_SHA256 signed certificates are not supported General SSL Settings • Settings for the HTTPS Proxy Service • Protocol to use • Cipher String to use • Disable compression General SSL Settings (2) - Cipher strings openssl ciphers ‘ALL’ Use all ciphers openssl ciphers ‘HIGH:MEDIUM’ Use only ciphers classified as HIGH and MEDIUM openssl ciphers ‘HIGH:MEDIUM:-RC4’ Use only HIGH &MEDIUM and no RC4 …. ‘HIGH:MEDIUM:-RC4:-eNULL:-aNULL’ HIGH & MEDIUM, no RC4,, no NULL authentication & NULL encryption ‘HIGH:MEDIUM:-RC4:@strength’ @strength : sort based on strength Recommended (by Toby…) Cipher String – v9.0.1 • Default string, moving ephemeral DH to the front, disabling EXPORT Ciphers, Ciphers with less than 128 bit symmetric key and RC4 • Before disabling TLS 1.0 , a personal risk assessment is recommended! General SSL Settings (3) • Fallback • Client sends “Client Hello” and suggests a version to use • If Server responds with a “fatal error”, client will fallback to another version • Example: TLS 1.2 “yes” but there is no common cipher offered… • Not a “fatal error” : Client asks for TLS 1.2 but Server offers 1.0 General SSL Settings (2) • Fallback • WSA has a feature that enables or disables “Fallback” • WSA will fallback to the “lowest” Version supported • Enabled / Disabled via CLI under “sslsettings” • Recommendation: Enable, definitely enable…. Decryption Policy • Policy can be based on • Identification Profile (Identity) • URL Category • Web Reputation • Additional Options Decryption Policy (2) • Categories • “Pass Through” will still check for certificate errors! • Invalid certificate or expired certificate on the server will fail the “Pass through” Decryption Policy (3) • Custom URLs (best used for making an exception for decryption) • “Pass Through” will bypass all certificate check -> true Pass Through • “Decrypt” -> certificates will be checked and the user will get a prompt (“untrusted CA”) • Custom categories take precedence over predefined categories! Decryption Policy (4) • Decrypt for Application Detection • Will try to decrypt all categories that are put on “monitor” , incl. “no categories” • AVC Engine checks the request header and decides if it needs decryption • Will supersede the “Pass Through” Option in “Decryption for WBRS” • AVC Engine will check if decryption is necessary • Might dramatically increase the traffic that is being decrypted Decryption Policy (5) • Decrypt for End User Notification • Important for transparent requests, not so