UPSTREAM: <carry>: NE-2744: Remove hardcoded TLS ciphers and set PQC …#193
UPSTREAM: <carry>: NE-2744: Remove hardcoded TLS ciphers and set PQC …#193davidesalerno wants to merge 1 commit into
Conversation
|
@davidesalerno: This pull request references NE-2744 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough
ChangesTLS Defaults Update
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
IIuc, this is only an |
|
|
||
| func setTLSDefaults(ctls *tls.Config) { | ||
| ctls.MinVersion = tls.VersionTLS12 | ||
| ctls.MaxVersion = tls.VersionTLS13 |
There was a problem hiding this comment.
MaxVersion should not have any impact on this. Please keep it in.
There was a problem hiding this comment.
I removed MaxVersion since the crypto/tls documentation states that when MaxVersion is zero, Go uses the highest version it supports (currently TLS 1.3).
Removing it was unnecessary for the PQC goal and even if it It would allow us to avoid having to update anything should Go's maximum supported version become 1.4 at same time it could introduced risk for no benefit.
I'm restoring it in the next push.
| func setTLSDefaults(ctls *tls.Config) { | ||
| ctls.MinVersion = tls.VersionTLS12 | ||
| ctls.MaxVersion = tls.VersionTLS13 | ||
| ctls.CipherSuites = []uint16{ |
There was a problem hiding this comment.
We may still need the cipher suites if TLS v1.2 is being used. Why remove them entirely?
There was a problem hiding this comment.
You're right, since MinVersion is still TLS 1.2 we need those cipher suites for TLS 1.2 negotiation. I probably over-scoped the change: the only thing needed for ML-KEM support is adding CurvePreferences. I've restored the CipherSuites (and also removed 3 duplicate entries that were copy-paste artifacts) list and the updated diff now only adds CurvePreferences on top of the existing defaults.
Looking at the repo history, UPSTREAM: is used for all downstream-only patches that persist across rebases (e.g., the ocp_dnsnameresolver plugin, vendor tracking, go-version bumps). This change fits that pattern - since it's an OpenShift-specific TLS default we'll want to carry forward. Happy to change it if I misunderstood the commit message conventions and it is better to use a different convention though. |
Add CurvePreferences (X25519MLKEM768, X25519, P-256, P-384) to setTLSDefaults to enable post-quantum key exchange negotiation, aligning with the OpenShift Intermediate TLS profile and the TLSGroupPreferences feature gate introduced in openshift/api#2583. Existing MaxVersion and CipherSuites are preserved unchanged. Remove 3 duplicate cipher suite entries that were copy-paste artifacts.
1c46d3b to
83e30aa
Compare
|
@davidesalerno: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
…curve preferences
The setTLSDefaults function hardcoded a MaxVersion of TLS 1.3 and a list of ECDHE-only cipher suites (with duplicate entries). This prevented Go's crypto/tls from negotiating post-quantum key exchange (ML-KEM) and bypassed OpenShift's dynamic TLS security profiles.
Remove the hardcoded MaxVersion and CipherSuites to let Go's standard library manage cipher negotiation with its secure defaults. Set explicit CurvePreferences matching the OpenShift Intermediate TLS profile (X25519MLKEM768, X25519, P-256, P-384) to align with the TLSGroupPreferences feature gate introduced in openshift/api#2583.
1. Why is this pull request needed and what does it do?
OpenShift's PQC (Post-Quantum Cryptography) readiness requires all core network components to adopt dynamic TLS policies. An audit (NE-2744) found that CoreDNS's shared TLS library (plugin/pkg/tls/tls.go) hardcodes a MaxVersion of TLS 1.3 and 9 ECDHE-only cipher suites (3 of which are duplicates). These hardcoded values bypass OpenShift's centralized TLS security profiles and prevent negotiation of ML-KEM post-quantum key exchange - even though Go 1.24+ supports it natively.
2. Which issues (if any) are related?
This PR is related to NE-2744
3. Which documentation changes (if any) need to be made?
None. This change modifies internal TLS defaults with no impact on user-facing configuration or APIs.
4. Does this introduce a backward incompatible change or deprecation?
No, this does not introduce a backward incompatible change or deprecation.
Summary by CodeRabbit