docker-nginx icon indicating copy to clipboard operation
docker-nginx copied to clipboard

TLSv1.3 support and OpenSSL 1.1.1

Open julianxhokaxhiu opened this issue 9 years ago • 99 comments

I saw that your current image is build on top of OpenSSL 1.0.2k.

Any plan to move to the newest one, in order to enable support for TLS 1.3?


//EDIT: Sorry, I saw it now that is still to be released ( https://www.openssl.org/news/changelog.html#x0 ). Can you please keep this issue anyway in your future plans? Would be nice to have support for TLS 1.3.

julianxhokaxhiu avatar Aug 20 '17 18:08 julianxhokaxhiu

There are no plans for that; It'd be automatically available when distributions we use (namely Debian and Alpine) will import openssl-1.1.1.

thresheek avatar Aug 22 '17 12:08 thresheek

Good to know :) Thank you!

julianxhokaxhiu avatar Aug 23 '17 19:08 julianxhokaxhiu

Hi @julianxhokaxhiu

In the meantime it works:

nginx -v

nginx version: nginx/1.14.0

nginx -V

nginx version: nginx/1.14.0 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) built with OpenSSL 1.1.1-dev xx XXX xxxx TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-openssl=openssl --with-openssl-opt=enable-tls1_3

openssl version

OpenSSL 1.1.1-pre5 (beta) 17 Apr 2018

Today, there is even a newer version out:

https://www.openssl.org/source/openssl-1.1.1-pre6.tar.gz

Haven't tested OpenSSL 1.1.1 pre6 so far! :-)

Hope it helps!

McKinleyGroup avatar May 01 '18 14:05 McKinleyGroup

Unfortunately it doesn't work for the Alpine image yet because Alpine does not ship with openssl > 1.1.1 yet..

sanderkoenders avatar Jun 09 '18 18:06 sanderkoenders

What about using libressl on Alpine? I saw Nginx can compile just fine with it.

julianxhokaxhiu avatar Jun 10 '18 08:06 julianxhokaxhiu

Does libressl on alpine offer support for the new TLSv3?

sanderkoenders avatar Jun 10 '18 09:06 sanderkoenders

Looking at this issue ( https://github.com/libressl-portable/portable/issues/228 ), the official documentation ( https://man.openbsd.org/TLS_method.3 ) and the Wikipedia page ( https://en.wikipedia.org/wiki/Comparison_of_TLS_implementations ) it seems it doesn't. I was too optimistic.

But boringssl does ( https://github.com/google/boringssl ). and it seems Nginx can be compiled with it too ( https://github.com/cloudflare/sslconfig/issues/87 ). Actually this looks like to me the best option as BoringSSL is a fork of OpenSSL ( most compatible actually then LibreSSL could be )

An example of Nginx with BoringSSL using Alpine: https://github.com/nginx-modules/docker-nginx-boringssl

julianxhokaxhiu avatar Jun 10 '18 10:06 julianxhokaxhiu

Hmm, in my opinion we should stick with one of the official versions even if that means we have to wait, libressl and openssl sound good in that regard, boringssl not so much..

sanderkoenders avatar Jun 11 '18 07:06 sanderkoenders

Hi all:

Nginx 1.14 and 1.1.5 can be compiled with support for TLS 1.3. Reportedly Nginx 1.13 should work to, but I haven't tested it...


#nginx -V

nginx version: nginx/1.14.0 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) built with OpenSSL 1.1.1-dev xx XXX xxxx TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-openssl=openssl --with-openssl-opt=enable-tls1_3

McKinleyGroup avatar Jun 11 '18 12:06 McKinleyGroup

Hi @julianxhokaxhiu

https://csrc.nist.gov/CSRC/media/Publications/sp/800-52/rev-2/draft/documents/sp800-52r2-draft.pdf

In (DRAFT) of NIST Special Publication 800-52, Revision 2 Guidelines for the Selection, Configuration, and Use of Transport Layer Security (TLS) Implementations

it states: "(...) shall be configured to use TLS 1.2, and should be configured to use TLS 1.3. These servers should not be configured to use TLS 1.1, and shall not use TLS 1.0, SSL 3.0, or SSL 2.0."

So, TLS 1.2 and TLS 1.3 are allowed and any older protocol is forbidden... :-)

@Archcry

Hmm, in my opinion we should stick with one of the official versions even if that means we have to wait, (...)

Like you would stick with Linux Kernel 3.10 in CentOS 7 / RHEL 7?

In the era of GDPR I would suggest to take cyber security finally more seriously and switch to Linux Kernel 4.16.14 and switch to TLS 1.2 and TLS 1.3... :-)

McKinleyGroup avatar Jun 11 '18 12:06 McKinleyGroup

I don't think you get the point, Nginx will work just fine with TLSv1.3 but the problem lies with openssl in alpine not being up to date.

In the era of GDPR I would suggest to take cyber security finally more seriously and switch to Linux Kernel 4.16.14 and switch to TLS 1.2 and TLS 1.3... :-)

you're talking about an extreme scenario here, it's not like we need TLSv1.3 because alternatives aren't safe. TLSv1.2 is safe so I don't see why we can't wait for Alpine to update openssl. You're talking as if TLSv1.3 is the only safe piece of software at the moment.

sanderkoenders avatar Jun 11 '18 12:06 sanderkoenders

@Archcry TLS 1.2 actually isn't safe... and that's the problem!

Please read e.g. Cisco's blog:

https://blogs.cisco.com/security/tls-1-3-and-forward-secrecy-count-us-in-and-heres-why

Security Fans are Forward Secrecy Fans

The goal of forward secrecy is to protect the secrecy of past sessions so that a session stays secret going forward. With TLS 1.2 and earlier versions, a bad actor who discovered a server’s private key could use it to decrypt network traffic that had been sent earlier. For example, suppose someone started recording encrypted traffic in our network on January 1st and then discovered a server’s private key on January 31st. That person could decrypt all of the server’s traffic and make off with the credit card numbers we entered yesterday, our lab results from last week, and our team’s patent application from the week before.

With the forward secrecy in TLS 1.3, there’s no longer a single secret value that will decrypt multiple sessions. Instead, TLS 1.3 uses the Ephemeral Diffie-Hellman key exchange protocol, which generates a one-time key that’s used only for the current network session. At the end of the session, the key is discarded. While attackers can still record and store encrypted network traffic, to decode it they need the unique key for each session. A session key won’t decode data sent during an earlier session or help an attacker discover future session keys.

Forward secrecy is a best practice for security—which is why we’re all for it.

McKinleyGroup avatar Jun 11 '18 13:06 McKinleyGroup

But still, the issue lies with Alpine, they should update their openssl

sanderkoenders avatar Jun 11 '18 13:06 sanderkoenders

@Archcry

But still, the issue lies with Alpine, they should update their openssl

I agree with you on that of course! :-)

McKinleyGroup avatar Jun 11 '18 13:06 McKinleyGroup

Anyways, I though boringssl was some kind of shady fork of openssl but it turns out it's forked by Google. So if boringssl is upt-do-date in Alpine and supports TLSv1.3 for Nginx it would be an option to use that for the Alpine docker image.

sanderkoenders avatar Jun 11 '18 13:06 sanderkoenders

It's just me or even nginx 1.15.0 image doesn't have openssl 1.1.1, which i'm waiting for to enable TLS1.3?

$ docker run --rm -it nginx:1.15.0 nginx -V

nginx version: nginx/1.15.0
built by gcc 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)
built with OpenSSL 1.1.0f  25 May 2017
TLS SNI support enabled

tnguyenns1 avatar Aug 11 '18 03:08 tnguyenns1

Some alpine + TLS1.3 images available here -- using OpenSSL 1.1.1-beta9. (It supports TLS 1.3 final, not the draft version. Currently non-nightly browsers don't support the final version)

ghadishayban avatar Sep 04 '18 18:09 ghadishayban

OpenSSL 1.1.0 is now available in the edge branch of Alpine Linux: https://pkgs.alpinelinux.org/packages?name=openssl1.1&branch=edge

The upgrade from 1.1.0 to 1.1.1 shouldn't break any APIs. So I'm looking forward to get TLS 1.3 with the next Alpine Linux release and Debian backports, once 1.1.1 has been released.

J0WI avatar Sep 08 '18 13:09 J0WI

Ye the final release should not be far away now.

sanderkoenders avatar Sep 08 '18 17:09 sanderkoenders

What about re-opening this issue until is really fixed?

julianxhokaxhiu avatar Sep 16 '18 09:09 julianxhokaxhiu