-
Notifications
You must be signed in to change notification settings - Fork 591
config/v1: TLSSecurityProfile: Remove go's unsupported ciphers #2697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,27 +37,32 @@ type TLSSecurityProfile struct { | |
| // - ECDHE-RSA-AES256-GCM-SHA384 | ||
| // - ECDHE-ECDSA-CHACHA20-POLY1305 | ||
| // - ECDHE-RSA-CHACHA20-POLY1305 | ||
| // - DHE-RSA-AES128-GCM-SHA256 | ||
| // - DHE-RSA-AES256-GCM-SHA384 | ||
| // - DHE-RSA-CHACHA20-POLY1305 | ||
| // - ECDHE-ECDSA-AES128-SHA256 | ||
| // - ECDHE-RSA-AES128-SHA256 | ||
| // - ECDHE-ECDSA-AES128-SHA | ||
| // - ECDHE-RSA-AES128-SHA | ||
| // - ECDHE-ECDSA-AES256-SHA384 | ||
| // - ECDHE-RSA-AES256-SHA384 | ||
| // - ECDHE-ECDSA-AES256-SHA | ||
| // - ECDHE-RSA-AES256-SHA | ||
| // - DHE-RSA-AES128-SHA256 | ||
| // - DHE-RSA-AES256-SHA256 | ||
| // - AES128-GCM-SHA256 | ||
| // - AES256-GCM-SHA384 | ||
| // - AES128-SHA256 | ||
| // - AES256-SHA256 | ||
| // - AES128-SHA | ||
| // - AES256-SHA | ||
| // - DES-CBC3-SHA | ||
| // | ||
| // // Ciphers not in this profile even though listed | ||
| // // in the Mozilla Server Side TLS configuration guidelines: | ||
| // // Go's crypto/tls does not support DHE ciphers (see https://github.com/golang/go/issues/7758) | ||
| // - DHE-RSA-AES128-GCM-SHA256 | ||
| // - DHE-RSA-AES256-GCM-SHA384 | ||
| // - DHE-RSA-CHACHA20-POLY1305 | ||
| // - DHE-RSA-AES128-SHA256 | ||
| // - DHE-RSA-AES256-SHA256 | ||
| // // Go's crypto/tls does not support CBC mode ciphers (see https://github.com/golang/go/issues/26652) | ||
| // - ECDHE-ECDSA-AES256-SHA384 | ||
| // - ECDHE-RSA-AES256-SHA384 | ||
| // - AES256-SHA256 | ||
| // | ||
| // +optional | ||
| // +nullable | ||
| Old *OldTLSProfile `json:"old,omitempty"` | ||
|
Comment on lines
66
to
68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. old field missing optional docs • The Old *OldTLSProfile field has +optional and +nullable markers, but its comment only lists cipher details and does not explain what happens when the field is omitted or explicitly set to null. • This makes the API behavior unclear to consumers and violates the requirement that field comments document the meaning/behavior of kubebuilder optionality markers. Agent Prompt
|
||
|
|
@@ -81,6 +86,10 @@ type TLSSecurityProfile struct { | |
| // - ECDHE-RSA-AES256-GCM-SHA384 | ||
| // - ECDHE-ECDSA-CHACHA20-POLY1305 | ||
| // - ECDHE-RSA-CHACHA20-POLY1305 | ||
| // | ||
| // // Ciphers not in this profile even though listed | ||
| // // in the Mozilla Server Side TLS configuration guidelines: | ||
| // // Go's crypto/tls does not support DHE ciphers (see https://github.com/golang/go/issues/7758) | ||
| // - DHE-RSA-AES128-GCM-SHA256 | ||
| // - DHE-RSA-AES256-GCM-SHA384 | ||
| // | ||
|
|
@@ -220,26 +229,30 @@ var TLSProfiles = map[TLSProfileType]*TLSProfileSpec{ | |
| "ECDHE-RSA-AES256-GCM-SHA384", | ||
| "ECDHE-ECDSA-CHACHA20-POLY1305", | ||
| "ECDHE-RSA-CHACHA20-POLY1305", | ||
| "DHE-RSA-AES128-GCM-SHA256", | ||
| "DHE-RSA-AES256-GCM-SHA384", | ||
| "DHE-RSA-CHACHA20-POLY1305", | ||
| "ECDHE-ECDSA-AES128-SHA256", | ||
| "ECDHE-RSA-AES128-SHA256", | ||
| "ECDHE-ECDSA-AES128-SHA", | ||
| "ECDHE-RSA-AES128-SHA", | ||
| "ECDHE-ECDSA-AES256-SHA384", | ||
| "ECDHE-RSA-AES256-SHA384", | ||
| "ECDHE-ECDSA-AES256-SHA", | ||
| "ECDHE-RSA-AES256-SHA", | ||
| "DHE-RSA-AES128-SHA256", | ||
| "DHE-RSA-AES256-SHA256", | ||
| "AES128-GCM-SHA256", | ||
| "AES256-GCM-SHA384", | ||
| "AES128-SHA256", | ||
| "AES256-SHA256", | ||
| "AES128-SHA", | ||
| "AES256-SHA", | ||
| "DES-CBC3-SHA", | ||
| // Ciphers not in this profile even though listed | ||
| // in the Mozilla Server Side TLS configuration guidelines: | ||
| // Go's crypto/tls does not support DHE ciphers (see https://github.com/golang/go/issues/7758) | ||
| // - DHE-RSA-AES128-GCM-SHA256 | ||
| // - DHE-RSA-AES256-GCM-SHA384 | ||
| // - DHE-RSA-CHACHA20-POLY1305 | ||
| // - DHE-RSA-AES128-SHA256 | ||
| // - DHE-RSA-AES256-SHA256 | ||
| // Go's crypto/tls does not support CBC mode ciphers (see https://github.com/golang/go/issues/26652) | ||
| // - ECDHE-ECDSA-AES256-SHA384 | ||
| // - ECDHE-RSA-AES256-SHA384 | ||
| // - AES256-SHA256 | ||
| }, | ||
| MinTLSVersion: VersionTLS10, | ||
| }, | ||
|
|
@@ -254,8 +267,11 @@ var TLSProfiles = map[TLSProfileType]*TLSProfileSpec{ | |
| "ECDHE-RSA-AES256-GCM-SHA384", | ||
| "ECDHE-ECDSA-CHACHA20-POLY1305", | ||
| "ECDHE-RSA-CHACHA20-POLY1305", | ||
| "DHE-RSA-AES128-GCM-SHA256", | ||
| "DHE-RSA-AES256-GCM-SHA384", | ||
| // Ciphers not in this profile even though listed | ||
| // in the Mozilla Server Side TLS configuration guidelines: | ||
| // Go's crypto/tls does not support DHE ciphers (see https://github.com/golang/go/issues/7758) | ||
| // - DHE-RSA-AES128-GCM-SHA256 | ||
| // - DHE-RSA-AES256-GCM-SHA384 | ||
| }, | ||
| MinTLSVersion: VersionTLS12, | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -291,6 +291,10 @@ spec: | |
| - ECDHE-RSA-AES256-GCM-SHA384 | ||
| - ECDHE-ECDSA-CHACHA20-POLY1305 | ||
| - ECDHE-RSA-CHACHA20-POLY1305 | ||
|
|
||
| // Ciphers not in this profile even though listed | ||
| // in the Mozilla Server Side TLS configuration guidelines: | ||
| // Go's crypto/tls does not support DHE ciphers (see https://github.com/golang/go/issues/7758) | ||
| - DHE-RSA-AES128-GCM-SHA256 | ||
| - DHE-RSA-AES256-GCM-SHA384 | ||
|
Comment on lines
+295
to
299
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Invalid yaml doc snippets • Multiple CRD/OpenAPI descriptions contain YAML configuration examples that now include // ... lines; // is not valid YAML comment syntax. • Users/operators copying these examples into real YAML manifests will hit YAML parse errors (or end up with unintended config). • Because these are generated artifacts, the issue propagates widely (config, operator, machineconfiguration, payload manifests, OpenAPI). Agent Prompt
|
||
| nullable: true | ||
|
|
@@ -328,26 +332,31 @@ spec: | |
| - ECDHE-RSA-AES256-GCM-SHA384 | ||
| - ECDHE-ECDSA-CHACHA20-POLY1305 | ||
| - ECDHE-RSA-CHACHA20-POLY1305 | ||
| - DHE-RSA-AES128-GCM-SHA256 | ||
| - DHE-RSA-AES256-GCM-SHA384 | ||
| - DHE-RSA-CHACHA20-POLY1305 | ||
| - ECDHE-ECDSA-AES128-SHA256 | ||
| - ECDHE-RSA-AES128-SHA256 | ||
| - ECDHE-ECDSA-AES128-SHA | ||
| - ECDHE-RSA-AES128-SHA | ||
| - ECDHE-ECDSA-AES256-SHA384 | ||
| - ECDHE-RSA-AES256-SHA384 | ||
| - ECDHE-ECDSA-AES256-SHA | ||
| - ECDHE-RSA-AES256-SHA | ||
| - DHE-RSA-AES128-SHA256 | ||
| - DHE-RSA-AES256-SHA256 | ||
| - AES128-GCM-SHA256 | ||
| - AES256-GCM-SHA384 | ||
| - AES128-SHA256 | ||
| - AES256-SHA256 | ||
| - AES128-SHA | ||
| - AES256-SHA | ||
| - DES-CBC3-SHA | ||
|
|
||
| // Ciphers not in this profile even though listed | ||
| // in the Mozilla Server Side TLS configuration guidelines: | ||
| // Go's crypto/tls does not support DHE ciphers (see https://github.com/golang/go/issues/7758) | ||
| - DHE-RSA-AES128-GCM-SHA256 | ||
| - DHE-RSA-AES256-GCM-SHA384 | ||
| - DHE-RSA-CHACHA20-POLY1305 | ||
| - DHE-RSA-AES128-SHA256 | ||
| - DHE-RSA-AES256-SHA256 | ||
| // Go's crypto/tls does not support CBC mode ciphers (see https://github.com/golang/go/issues/26652) | ||
| - ECDHE-ECDSA-AES256-SHA384 | ||
| - ECDHE-RSA-AES256-SHA384 | ||
| - AES256-SHA256 | ||
| nullable: true | ||
| type: object | ||
| type: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/api
Length of output: 96
🏁 Script executed:
Repository: openshift/api
Length of output: 4697
🌐 Web query:
Go crypto/tls CBC cipher support all versions limitations💡 Result:
Go
crypto/tlsCBC cipher suite support (by TLS version) and key limitations1) TLS 1.3: No CBC at all
TLS 1.3 cipher suites in Go are AEAD-only (AES-GCM, ChaCha20-Poly1305) and cannot be configured via
Config.CipherSuites. So CBC suites are never negotiated in TLS 1.3. [1], [2]2) TLS 1.0–1.2: CBC is implemented, but with important caveats
Go implements multiple AES-CBC suites for TLS 1.0–1.2, including (examples):
TLS_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, etc. [3]However:
tls.InsecureCipherSuites(). [3], [2]InsecureCipherSuites()), but CBC as a family is historically attack-prone (e.g., Lucky13-style side channels). Go’s mitigations are described as only partial/complex, and CBC suites are intended mainly for compatibility fallback. [2]3) “Default enabled” vs “implemented” changes across Go versions
Even when CBC suites are implemented, whether they’re in the default set can change across Go releases:
GODEBUG=tlsrsakex=1) and 3DES removed from defaults in Go 1.23 (re-add viaGODEBUG=tls3des=1). (3DES is CBC-mode and is also classified insecure.) [1], [3]4) Configuring CBC in Go: what you can and can’t do
Config.CipherSuitesonly affects TLS 1.0–1.2; it does nothing for TLS 1.3. [1]MaxVersion: tls.VersionTLS12), otherwise TLS 1.3 will avoid CBC entirely. [1]5) Extra restriction: FIPS mode
In Go’s FIPS 140-3 mode, non-approved cipher suites/versions are “silently ignored” or rejected; this can further limit (or eliminate) CBC availability depending on the selected module and Go version. [1]
Sources: Go
crypto/tlsdocs (Go 1.25.2) [1], Go blog on cipher suite ordering / CBC & Lucky13 notes [2], Gocrypto/tlscipher suite source (lists secure vs insecure suites and supported versions) [3].🏁 Script executed:
Repository: openshift/api
Length of output: 1776
🏁 Script executed:
Repository: openshift/api
Length of output: 815
Clarify CBC support wording in both Old profile locations.
The Old profile still lists CBC SHA1 suites (AES128-SHA, AES256-SHA, DES-CBC3-SHA), so the comment "Go's crypto/tls does not support CBC mode ciphers" is overstated. The actual limitation applies only to the CBC SHA-256/384 suites listed below. Narrow the wording to match the specific ciphers excluded.
✏️ Suggested wording
Also applies to: 252-255
🤖 Prompt for AI Agents