proxy/haproxy: Update haproxy documentation#1499
Conversation
This comment has been minimized.
This comment has been minimized.
e9171b4 to
c8da05b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
3b7c4da to
943faf4
Compare
8228946 to
a57f3eb
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
||
| Dovecot must be configured to accept PROXY protocol headers: | ||
|
|
||
| - Set `haproxy = yes` on the listener |
There was a problem hiding this comment.
Set [[setting,inet_listener_haproxy,yes]] on the [[setting,inet_listener]].
| - Set [[setting,haproxy_trusted_networks]] to the IP address(es) or CIDR | ||
| range(s) of HAProxy. The value is a space-separated list and accepts CIDR | ||
| notation, e.g. `haproxy_trusted_networks = 127.0.0.1 10.0.0.0/24 | ||
| 2001:db8::/32`. Dovecot rejects PROXY headers from any unlisted address. |
There was a problem hiding this comment.
Could expand what "rejects" means: If a client from unlisted address connects to a haproxy listener, a warning is logged and the client is disconnected.
|
|
||
| * Consistent TLS handling at a single point | ||
| * End-to-end encryption (client → HAProxy → Dovecot) | ||
| * Reduced risk of configuration drift |
There was a problem hiding this comment.
What configuration drift? Does this mean it avoids having to keep ssl settings in sync between Dovecot and HAProxy when STARTTLS is provided by Dovecot? Should say that clearly.
| Backend TLS only adds security when the HAProxy ↔ Dovecot path can be observed | ||
| or tampered with. When both run on the same host and traffic stays on | ||
| `127.0.0.1`, backend TLS adds CPU overhead with no threat-model benefit; a | ||
| plaintext backend with the PROXY protocol is acceptable in that case. |
There was a problem hiding this comment.
"plaintext connection to backend"?
| ``` | ||
|
|
||
| ```doveconf[dovecot_tls_listener] | ||
| # ssl = required: HAProxy always connects via TLS, so Dovecot can enforce it |
There was a problem hiding this comment.
A bit repetitive to have ssl = required: here
| perform SNI-based routing, or do TLS offloading. | ||
|
|
||
| Because HAProxy never decrypts the stream, the PROXYv2 header is the only way | ||
| for Dovecot to learn the original client IP. Add `send-proxy-v2` on the |
There was a problem hiding this comment.
First sentence is confusing. PROXYv2 header is always the only way to learn the original client IP.
|
|
||
| backend dovecot_imap_tls | ||
| mode tcp | ||
| server dovecot1 127.0.0.1:993 send-proxy-v2 |
There was a problem hiding this comment.
Again an issue with bind *:993 conflicting with Dovecot's 127.0.0.1:993.
| defaults | ||
| mode tcp | ||
| timeout client 1h | ||
| timeout server 1h |
There was a problem hiding this comment.
How about 31min? There is hardcoded 30 min timeout in Dovecot, suggested also by IMAP RFC.
| backend dovecot_imap_tls | ||
| mode tcp | ||
| option ssl-hello-chk | ||
| server dovecot1 127.0.0.1:993 check ssl verify required \ |
There was a problem hiding this comment.
Again here better to use non-127.0.0.1
| mode tcp | ||
| option tcp-check | ||
| tcp-check expect string * OK | ||
| server dovecot1 127.0.0.1:143 check send-proxy-v2 |
JIRA: DOV-6879