Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.
Closed
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
15 changes: 12 additions & 3 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,22 @@ func main() {
log.Fatalf("Failed to initialize certificate watcher: %v", err)
}

tlsOpts := func(config *tls.Config) {
config.GetCertificate = cw.GetCertificate
// Ensure HTTP/2 is disabled by default for webhooks. Disabling HTTP/2 mitigates vulnerabilities associated with:
// - HTTP/2 Stream Cancellation (GHSA-qppj-fm5r-hxr3)
// - HTTP/2 Rapid Reset (GHSA-4374-p667-p6c8)
// While CVE fixes exist, they remain insufficient; disabling HTTP/2 helps reduce risks.
// For details, see: https://github.com/kubernetes/kubernetes/issues/121197
setupLog.Info("disabling http/2")
config.NextProtos = []string{"http/1.1"}
}

// Create webhook server and configure TLS
webhookServer := crwebhook.NewServer(crwebhook.Options{
Port: webhookPort,
TLSOpts: []func(*tls.Config){
func(cfg *tls.Config) {
cfg.GetCertificate = cw.GetCertificate
},
tlsOpts,
},
})

Expand Down