Skip to content
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

util: Disable 3DES ciphers for TLS connections (#27690) #27859

Merged
merged 3 commits into from
Sep 22, 2021
Merged
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
18 changes: 18 additions & 0 deletions util/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,28 @@ func LoadTLSCertificates(ca, key, cert string, autoTLS bool) (tlsConfig *tls.Con
}
}
}

// This excludes ciphers listed in tls.InsecureCipherSuites() and can be used to filter out more
var cipherSuites []uint16
var cipherNames []string
for _, sc := range tls.CipherSuites() {
switch sc.ID {
case tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA:
logutil.BgLogger().Info("Disabling weak cipherSuite", zap.String("cipherSuite", sc.Name))
default:
cipherNames = append(cipherNames, sc.Name)
cipherSuites = append(cipherSuites, sc.ID)
}

}
logutil.BgLogger().Info("Enabled ciphersuites", zap.Strings("cipherNames", cipherNames))

/* #nosec G402 */
tlsConfig = &tls.Config{
Certificates: []tls.Certificate{tlsCert},
ClientCAs: certPool,
ClientAuth: clientAuthPolicy,
CipherSuites: cipherSuites,
}
return
}
Expand Down