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

Allow TLS 1.2 with restricted ciphers for webhooks #3318

Merged
merged 1 commit into from
Aug 9, 2023
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
17 changes: 16 additions & 1 deletion pkg/config/runtime_config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"crypto/tls"
"time"

"github.com/spf13/pflag"
Expand Down Expand Up @@ -131,5 +132,19 @@ func BuildRuntimeOptions(rtCfg RuntimeConfig, scheme *runtime.Scheme) ctrl.Optio
func ConfigureWebhookServer(rtCfg RuntimeConfig, mgr ctrl.Manager) {
mgr.GetWebhookServer().CertName = rtCfg.WebhookCertName
mgr.GetWebhookServer().KeyName = rtCfg.WebhookKeyName
mgr.GetWebhookServer().TLSMinVersion = "1.3"
mgr.GetWebhookServer().TLSOpts = []func(config *tls.Config){
func(config *tls.Config) {
config.MinVersion = tls.VersionTLS12
config.CipherSuites = []uint16{
// AEADs w/ ECDHE
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,

// AEADs w/o ECDHE
tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
}
},
}
}
Loading