Uses sed to copy and modify ports to create PROXY Protocol ports#174
Uses sed to copy and modify ports to create PROXY Protocol ports#174cfis merged 4 commits intodocker-mailserver:masterfrom
Conversation
| enabled: true | ||
| # List of sources (in CIDR format, space-separated) to permit PROXY protocol from | ||
| trustedNetworks: "10.0.0.0/8 192.168.0.0/16 172.16.0.0/16" | ||
| trustedNetworks: "10.0.0.0/8 192.168.0.0/16 172.16.0.0/12" |
There was a problem hiding this comment.
Just FYI, you should be certain you can trust these subnets.
In Docker, at least historically due to the userland-proxy process, if the host could be reached by IPv6 but the container only had a private range IPv4 network, what would happen is Docker rerouted the IPv6 connection to IPv4 through the IPv4 subnet gateway IP (eg: 172.16.0.0), so all IPv6 clients appeared to be internal traffic as that gateway IP was trusted.
If the container had an IPv6 network as well, then it would retain the original client IPv6 IP and that wouldn't happen. Likewise if the userland-proxy feature was disabled, it would not try to route it like described and the connection would just fail.
When it comes to PROXY protocol trust, the risk would have been any IPv6 client could provide their own PROXY protocol header and that would be trusted. However, since there should be a proxy service inbetween the client and DMS/Dovecot here, that should be enforcing that any untrusted connection has PROXY protocol stripped away before the connection is forwarded to DMS, where PROXY protocol headers are added from your proxy service.
Just thought I'd mention this for context, as I think our official docs caution about such (such as only setting to an IP of your proxy service, if you have the control to pin that in a deterministic manner).
Any container compromised in the network could likewise fake PROXY protocol otherwise, which unlike the non-PROXY protocol ports, could allow for bypassing some security restraints if manipulating the client IP to Dovecot/Postfix provides more access/trust.
Co-authored-by: Brennan Kinney <[email protected]>
0931439 to
6335027
Compare
6335027 to
0dc44c1
Compare
|
Thanks! |
This produces a
/etc/postfix/master.cffile with only these differences from the current version:Fixes #173
References:
docker-mailserver/docker-mailserver#4066 (additional ref)
v15 Docs reference (rendered page)
docker-mailserver/docker-mailserver#3866 (comment) to simplify this process.