Skip to content

Commit fd761db

Browse files
authored
Set minimum TLS 1.3 for metrics and webhook servers (#1325)
Set the minimum default version to TLS 1.3. PQ algorithms will only be supported in TLS 1.3+. Hybrid key agreements for TLS 1.3 X25519MLKEM768 is automatically supported by default in go 1.24. See: OCPSTRAT-1858 Co-authored-by: Jiri Mencak <jmencak@users.noreply.github.com>
1 parent df3b43e commit fd761db

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

cmd/cluster-node-tuning-operator/main.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,16 @@ func operatorRun() {
121121
return
122122
}
123123

124+
tlsOpts := []func(*tls.Config){
125+
func(c *tls.Config) {
126+
// CVE-2023-44487
127+
c.NextProtos = []string{"http/1.1"}
128+
// Default minimum version is TLS 1.3. PQ algorithms will only be supported in TLS 1.3+.
129+
// Hybrid key agreements for TLS 1.3 X25519MLKEM768 is supported by default in go 1.24.
130+
c.MinVersion = tls.VersionTLS13
131+
},
132+
}
133+
124134
// We have two namespaces that we need to watch:
125135
// 1. NTO namespace: for NTO resources. Note this is not necessarily where the operator itself
126136
// runs, for example operator managing HyperShift hosted clusters.
@@ -147,7 +157,7 @@ func operatorRun() {
147157
CertDir: webhookCertDir,
148158
CertName: webhookCertName,
149159
KeyName: webhookKeyName,
150-
TLSOpts: []func(config *tls.Config){func(c *tls.Config) { c.NextProtos = []string{"http/1.1"} }}, // CVE-2023-44487
160+
TLSOpts: tlsOpts,
151161
}),
152162
})
153163

pkg/metrics/server.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ func buildServer(port int, caBundle string) *http.Server {
6969
if caCertPool.AppendCertsFromPEM([]byte(caBundle)) {
7070
tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert
7171
tlsConfig.ClientCAs = caCertPool
72-
// Default minimum version is TLS 1.2, previous versions are insecure and deprecated.
73-
tlsConfig.MinVersion = tls.VersionTLS12
72+
// Default minimum version is TLS 1.3. PQ algorithms will only be supported in TLS 1.3+.
73+
// Hybrid key agreements for TLS 1.3 X25519MLKEM768 is supported by default in go 1.24.
74+
tlsConfig.MinVersion = tls.VersionTLS13
7475
tlsConfig.CipherSuites = []uint16{
7576
// Drop
7677
// - 64-bit block cipher 3DES as it is vulnerable to SWEET32 attack.

0 commit comments

Comments
 (0)