Signal-TLS-Proxy icon indicating copy to clipboard operation
Signal-TLS-Proxy copied to clipboard

Use upstream NGINX image

Open TommyTran732 opened this issue 2 years ago • 8 comments

The current images are 2 years out of date, and if it's too much work to track the releases I'd suggest just using the upstream image. Using alpine as the base OS will also help reduce the attack surface as well.

This PR includes the changes in my previous PR https://github.com/signalapp/Signal-TLS-Proxy/pull/22.

TommyTran732 avatar Sep 06 '22 22:09 TommyTran732

Yes, I came here wanting to mention this too. Speaking of attack surfaces: there are two flavours of nginx docker images published by nginxinc themselves, with or without root. The ones which runs without root could also be a possibility: nginxinc/nginx-unprivileged. With the unprivileged image, the default port is 8080.

olof-nord avatar Sep 24 '22 22:09 olof-nord

I run some Nginx as proxies, and I have them running with the filesystem in read-only and the config in tmpfs, in this case, since they're a shared volume, wouldn't be better to have them in :ro instead of :Z? I mean the one for nginx-terminate.

jtheo avatar Sep 28 '22 12:09 jtheo

I think this project needs to user the Dockerfile build methods and can't just switch to nginx:alpine. ngx_stream_ssl_module / ngx_stream_ssl_preread_module aren't built by default, but are used by both images.

So #28 looks like the correct path for updating the nginx version.

abscondment avatar Oct 03 '22 17:10 abscondment

@abscondment, sorry, not sure to understand:

I think this project needs to user the Dockerfile build methods and can't just switch to nginx:alpine. ngx_stream_ssl_module / ngx_stream_ssl_preread_module aren't built by default, but are used by both images.

The modules are already present in the alpine image:

$ docker run -it nginx:alpine nginx -V | tr ' ' '\n' | grep ssl
--with-http_ssl_module
--with-mail_ssl_module
--with-stream_ssl_module
--with-stream_ssl_preread_module

jtheo avatar Oct 12 '22 13:10 jtheo

@abscondment, sorry, not sure to understand:

I think this project needs to user the Dockerfile build methods and can't just switch to nginx:alpine. ngx_stream_ssl_module / ngx_stream_ssl_preread_module aren't built by default, but are used by both images.

The modules are already present in the alpine image:

$ docker run -it nginx:alpine nginx -V | tr ' ' '\n' | grep ssl
--with-http_ssl_module
--with-mail_ssl_module
--with-stream_ssl_module
--with-stream_ssl_preread_module

With that excellent one-liner, I can also confirm that also the rootless image contains the required modules:

$ docker run -it nginxinc/nginx-unprivileged nginx -V | tr ' ' '\n' | grep ssl
--with-http_ssl_module
--with-mail_ssl_module
--with-stream_ssl_module
--with-stream_ssl_preread_module

olof-nord avatar Oct 12 '22 13:10 olof-nord

Cool! TIL how alpine builds nginx :)

abscondment avatar Oct 12 '22 17:10 abscondment

Yes, I came here wanting to mention this too. Speaking of attack surfaces: there are two flavours of nginx docker images published by nginxinc themselves, with or without root. The ones which runs without root could also be a possibility: nginxinc/nginx-unprivileged. With the unprivileged image, the default port is 8080.

Do you have a working config for the rootless container?

I have the root container working with privileges dropped and what not, but I couldn't get the rootless one working. I could try again though when I have time, though it would be nice if someone has a working config ready.

TommyTran732 avatar Oct 15 '22 20:10 TommyTran732

I was about to file a bug to do exactly what this PR does. The current state of having the nginx versions hardcoded in the source code is difficult to maintain and leads to security bugs. Using nginx:latest or nginx:alpine as this PR does is the obvious solution.

+1 to merge this.

benbucksch avatar Jan 05 '23 20:01 benbucksch