June 2, 2015: Weak Diffie-Hellman LogJam Fix for Ubuntu 12.04 LTS

Run the below commands to patch Apache for the LogJam vulnerability. The latest updates bring ECDH to Ubuntu 12.04 LTS running Apache 2.2.x. Also, the 2048-bit group for Elliptical Curve Diffie-Hellman Encryption (ECDHE) is now supported.

$ sudo aptitude update
$ sudo aptitude upgrade

The Back Story: 1024-bit Diffie Hellman (DH) Primes

On May 20, 2015, the University of Michigan published a whitepaper stating cipher suites supporting 1024-bit DH primes may be susceptible to passive eavesdropping from an attacker with nation-state resources.1

Heads-up: There are several references in this post to “WeakDH.org.” That site is maintained by the University Of Michigan College of Engineering.

Test your SSL install for weaknesses via Qualys’ SSL tester: https://www.ssllabs.com/ssltest. Aim for a minimum score of “A”. To patch up your SSL install, edit your ssl.conf file using nano:

$ nano /etc/apache2/mods-available/ssl.conf

Scroll down and edit to match the below:

#Cypher Suite from https://weakdh.org/sysadmin.html#apache

SSLProtocol         ALL -SSLv2 -SSLv3

SSLHonorCipherOrder On

SSLCompression Off

Here’s a quick explanation of what we’re doing and why:

  1. Permit all installed SSL protocols, then disable SSLv2 (FUBAR exploit) and SSLv3 (POODLE exploit)
  2. Honor the proceeding ciphers in the order they are given (i.e., their fallback sequencing)
  3. Declare the chain of ciphers to use and exclude. We used the Apache suite from weakdh.org/sysadmin.html#apache
  4. “!” means do not use as a fallback. See Remy van Elst’s or Hynek’s blog for explanations.
  5. NOTE: TLS compression is off by default in all Apache 2.2.x versions (and later) running on Ubuntu (to block the CRIME exploit). Upshot: SSLCompression Off is not needed if you’re using Ubuntu
  6. Optional but useful sundries:
    • Confirm your version of Apache with
      $ apache2 -v
    • Confirm your version of OpenSSL with
      $ openssl version -a
      Be aware that versions of OpenSSL built before April 7, 2014 are vulnerable to the Heartbleed exploit

HSTS is always-on HTTPS. This tutorial on IT igloo sums up how to configure HSTS on Apache and Nginx. However, be sure to append the preload directive to both the Apache and Nginx versions.

What Does Preload Do?

The OWASP Wiki on HSTS provides the ansswer:
The `preload` flag indicates the site owner’s consent to have their domain preloaded. The site owner still needs to then go and submit the domain to the [HSTS preload list maintained by Chrome (and used by Firefox and Safari)].
Preloading for Apache
Header always set Strict-Transport-Security "max-age=31536000; includeSubdomains; preload"
Preloading for Nginx
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload";

Go to SSLlabs and test your certificate install. Aim for an A+.