Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

chore(tlsversion): Add a tls minimum version for webhooks #4229

Merged
merged 1 commit into from
Oct 7, 2021
Merged
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
1 change: 1 addition & 0 deletions pkg/crdconversion/crdconversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func (crdWh *crdConversionWebhook) run(stop <-chan struct{}) {
// #nosec G402
webhookServer.TLSConfig = &tls.Config{
Certificates: []tls.Certificate{cert},
MinVersion: tls.VersionTLS13,
}

if err := webhookServer.ListenAndServeTLS("", ""); err != nil {
Expand Down
5 changes: 4 additions & 1 deletion pkg/health/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ func (httpProbe HTTPProbe) Probe() (int, error) {
// similar to how k8s api server handles HTTPS probes.
// #nosec G402
transport := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
MinVersion: tls.VersionTLS13,
},
}
client.Transport = transport
}
Expand Down
1 change: 1 addition & 0 deletions pkg/injector/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func (wh *mutatingWebhook) run(stop <-chan struct{}) {
// #nosec G402
server.TLSConfig = &tls.Config{
Certificates: []tls.Certificate{cert},
MinVersion: tls.VersionTLS13,
}

if err := server.ListenAndServeTLS("", ""); err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/utils/mtls.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func setupMutualTLS(insecure bool, serverName string, certPem []byte, keyPem []b
ClientAuth: tls.RequireAndVerifyClientCert,
Certificates: []tls.Certificate{certif},
ClientCAs: certPool,
MinVersion: tls.VersionTLS13,
}
return grpc.Creds(credentials.NewTLS(&tlsConfig)), nil
}
Expand Down
1 change: 1 addition & 0 deletions pkg/validator/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func (s *validatingWebhookServer) run(port int, certificater certificate.Certifi
// #nosec G402
server.TLSConfig = &tls.Config{
Certificates: []tls.Certificate{cert},
MinVersion: tls.VersionTLS13,
}

if err := server.ListenAndServeTLS("", ""); err != nil {
Expand Down