Seneca-CDOT/telescope

Audit nginx SSL setup with new Mozilla Config tool

humphd opened this issue · 1 comments

Mozilla has updated their SSL Config tool. We have SSL setup on production, see https://github.com/Seneca-CDOT/telescope/blob/master/config/nginx.conf.template.

If there is anything that Mozilla is doing, or doing different from us, let's figure out why and make sure we fix our config if it's wrong.

Not familiar with SSL setup.
I haven't had time to deep dive, just time to gather some info.

Comparing the two configs, here is what they have and we don't.

ssl_session_timeout 1d;
ssl_session_tickets off;

# intermediate configuration
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;

The NGINX default for `ssl_session_timeout

Syntax:	ssl_session_timeout time;
Default:	ssl_session_timeout 5m;
Context:	http, server.

Specifies a time during which a client may reuse the session parameters.

Default at 5m, while Mozilla has them set at 1d.
There has been different perspectives on the "right" time to set it to.
More info:


Nginx default for ssl_session_tickets

Syntax:	ssl_session_tickets on | off;
Default:	ssl_session_tickets on;
Context:	http, server
This directive appeared in version 1.5.9.

Default is on while Mozilla has it off. The rationale was that it was for better security.

But it seems nginx 1.23.2 might have a change to this that will make this no longer an issue?
https://nginx.org/en/CHANGES

Feature: TLS session tickets encryption keys are now automatically
     rotated when using shared memory in the "ssl_session_cache"
     directive.

Nginx default for ssl_session_protocols

Syntax:	ssl_protocols [SSLv2] [SSLv3] [TLSv1] [TLSv1.1] [TLSv1.2] [TLSv1.3];
Default:	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
Context:	http, server

Mozilla has them set at TLSv1.2 TLSv1.3
According to Nginx,

The TLSv1.1 and TLSv1.2 parameters (1.1.13, 1.0.12) work only when OpenSSL 1.0.1 or higher is used.

The TLSv1.3 parameter (1.13.0) works only when OpenSSL 1.1.1 or higher is used.

Nginx default for ssl_ciphers

Syntax:	ssl_ciphers ciphers;
Default:	ssl_ciphers HIGH:!aNULL:!MD5;
Context:	http, server

Specifies the enabled ciphers. The ciphers are specified in the format understood by the OpenSSL library, for example:

ssl_ciphers ALL:!aNULL:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;

The full list can be viewed using the “openssl ciphers” command.

Mozilla has these ciphers

  1. ECDHE-ECDSA-AES128-GCM-SHA256
  2. ECDHE-ECDSA-AES256-GCM-SHA384
  3. ECDHE-ECDSA-CHACHA20-POLY1305
  4. DHE-RSA-AES128-GCM-SHA256
  5. DHE-RSA-AES256-GCM-SHA384

The NGINX default for ssl_prefer_server_ciphers

Syntax:	ssl_prefer_server_ciphers on | off;
Default:	ssl_prefer_server_ciphers off;
Context:	http, server

Specifies that server ciphers should be preferred over client ciphers when using the SSLv3 and TLS protocols.

Default is off, just like what Mozilla has.