Add configurable TLS profiles for listeners#295
Add configurable TLS profiles for listeners#295StrongWind1 wants to merge 1 commit intodecke:masterfrom
Conversation
|
Thanks for the PR! I do agree that this is useful and the implementation is technically okay as well. I still try to understand what the practical difference between hardened and extended is. I guess you added hardened because testssl.sh reported some worrying vulns against extended? I really think having 5 profiles is too much and explaining the difference between hardened and extended is a waste of time. What do you think about keeping hardened and giving it a new name (Mozilla SSL Config Generator would call it intermediate) and remove extended? The legacy profile should cover that anyway and using it does not weaken your modern clients - they can continue using TLS1.3. |
69de251 to
3dec4ed
Compare
Add a tls_profile option that controls the minimum TLS version and allowed cipher suites for STARTTLS/TLS listeners. Profiles align with the Mozilla SSL Configuration Generator guidelines. Profiles: default - Go standard library defaults (no explicit constraints) modern - TLS 1.3+ only (Mozilla modern) intermediate - TLS 1.2+ with AEAD + ECDHE suites only (Mozilla intermediate) legacy - TLS 1.0+ with all Go cipher suites including insecure ones
3dec4ed to
81a5e2c
Compare
|
Thanks for the review! Apologies on taking so long to get back to this. You're right, the hardened/extended split was hard to justify. I've reworked the PR down to 4 profiles and matched them to the Mozilla SSL Configuration Generator naming. What changed
Current profiles
Intermediate TLS 1.2 cipher suitesHow this lines up with MozillaI checked against Mozilla guidelines v5.7 (current), v5.8, and v6.0 (still a proposal, not final yet) to make sure we stay aligned as the spec evolves. modern
Lines up across all three versions. We don't configure curves explicitly so Go's defaults apply, and they'll pick up post quantum curve support as Go adds it. intermediate
Same 6 suites across the board. Mozilla 5.7 had 3 DHE-RSA suites but Go doesn't implement DHE at all, and Mozilla dropped them in 5.8 anyway. legacy vs Mozilla old
Our |
This PR adds a new configuration option,
tls_profile, to control the TLS policy used by inboundstarttls://andtls://listeners.Why:
Changes:
tls_profile(default:default)default: Go standard library defaults (recommended for most deployments)modern: TLS 1.3 onlyhardened: TLS 1.2 and TLS 1.3; TLS 1.2 restricted to modern AEAD + ECDHE suites (GCM + ChaCha20). No CBC fallback suites.extended: TLS 1.2 and TLS 1.3; hardened plus additional TLS 1.2 compatibility suites (CBC + RSA key exchange) to support older internal clients.legacy: last resort; enables TLS 1.0+ and all TLS 1.0–1.2 cipher suites exposed by the Go standard library.File updates:
config.gotls_profileoption (flag/config) with accepted values:modern | hardened | default | extended | legacy(default is the default )main.gogetTLSConfig()to apply the selected TLS profilesmtprelay.initls_profileand example usage