Skip to content

NO-JIRA: Set minimum TLS 1.3 for metrics and webhook servers #1325

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion cmd/cluster-node-tuning-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ func operatorRun() {
return
}

tlsOpts := []func(*tls.Config){
func(c *tls.Config) {
// CVE-2023-44487
c.NextProtos = []string{"http/1.1"}
// Default minimum version is TLS 1.3. PQ algorithms will only be supported in TLS 1.3+.
// Hybrid key agreements for TLS 1.3 X25519MLKEM768 is supported by default in go 1.24.
c.MinVersion = tls.VersionTLS13
},
}

// We have two namespaces that we need to watch:
// 1. NTO namespace: for NTO resources. Note this is not necessarily where the operator itself
// runs, for example operator managing HyperShift hosted clusters.
Expand All @@ -147,7 +157,7 @@ func operatorRun() {
CertDir: webhookCertDir,
CertName: webhookCertName,
KeyName: webhookKeyName,
TLSOpts: []func(config *tls.Config){func(c *tls.Config) { c.NextProtos = []string{"http/1.1"} }}, // CVE-2023-44487
TLSOpts: tlsOpts,
}),
})

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