nginxinc / nginx-ldap-auth

Example of LDAP authentication using ngx_http_auth_request_module
BSD 2-Clause "Simplified" License
678 stars 202 forks source link

Is communication between nginx and ldap-auth encrypted? #77

Open yzargari opened 3 years ago

yzargari commented 3 years ago

Hello,

I couldn't help but noticing that traffic between nginx and ldap-auth contains the most sensitive info (passwords) but nowhere in the docs I see any reference to whether if the channel is encrypted or not. I can only assume that it isn't, as I didn't provide certificate...

Anyone knows anything about it? Can I provide a certificate and enforce HTTPS?

Thanks!

vl-homutov commented 3 years ago

As you may see from configuration. proxy_pass to http url is used to communicate with auth daemon. This means no encryption is used. Since you are passing data between two processes on loopback interface, it doesn't make too much sense to use encryption. If you want to run services on different hosts, it makes sens to enable https, set up certificates, etc. Note you will have to touch daemon code to enable ssl server, provide it with certificates and corresponding settings like ciphers. On the nginx side, you have normal https client, so just change proxy_pass scheme to secure and setup client ssl as required.

yzargari commented 3 years ago

Thanks @vl-homutov I'm actually planning to run one ldap-auth daemon and use it from multiple nginx servers, so encrypting the traffic is important.

Would you accept a PR to add support in setting up HTTPS using args? (only if passed, ssl is added)

vl-homutov commented 3 years ago

Well, it will depend on impact, but in general, I have no objections for optional tls configuration for daemon, unless it complicates things unnecessary. Anyway, this project is an example implementation, feel free to do whatever you want and share results with everyone, even it may be possibly rejected.

mclei-asw commented 3 years ago

Why don't you just use nginx as SSL proxy to this service? So your nginx will communicate with another nginx, which is just a proxy to this service.

tacerus commented 2 years ago

@mclei-asw Using nginx to improve nginx - I love how I would have never thought of that. :-D