Skip to content

Commit 6cff7f8

Browse files
committed
Disable http/2 on webhook server
Signed-off-by: Siddhesh Ghadi <[email protected]>
1 parent 4fbe54a commit 6cff7f8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ func main() {
110110
}
111111
c.NextProtos = []string{"http/1.1"}
112112
}
113-
webhookServerOptions := webhook.Options{
114-
TLSOpts: []func(config *tls.Config){disableHTTP2},
115-
Port: 9443,
116-
}
117-
webhookServer := webhook.NewServer(webhookServerOptions)
118113

119114
metricsServerOptions := metricsserver.Options{
120115
BindAddress: metricsAddr,
@@ -124,7 +119,6 @@ func main() {
124119
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
125120
Scheme: scheme,
126121
Metrics: metricsServerOptions,
127-
WebhookServer: webhookServer,
128122
HealthProbeBindAddress: probeAddr,
129123
LeaderElection: enableLeaderElection,
130124
LeaderElectionID: "2b63967d.openshift.io",
@@ -153,6 +147,12 @@ func main() {
153147
setupLog.Error(err, "unable to create webhook", "webhook", "ArgoCD")
154148
os.Exit(1)
155149
}
150+
151+
// disable http/2 to mitigate CVE-2023-44487 & CVE-2023-39325
152+
server, ok := mgr.GetWebhookServer().(*webhook.DefaultServer)
153+
if ok {
154+
server.Options.TLSOpts = append(server.Options.TLSOpts, disableHTTP2)
155+
}
156156
}
157157

158158
if err = (&controllers.ReconcileGitopsService{

0 commit comments

Comments
 (0)