Skip to content

Commit d81d23d

Browse files
Merge pull request #2647 from danielmellado/enforce_ocp_intermediate_tls
OCPBUGS-58475: Enforce secure TLS settings in CMO server
2 parents 5875266 + ed50c30 commit d81d23d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/server/server.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"github.com/openshift/library-go/pkg/authorization/hardcodedauthorizer"
2525
"github.com/openshift/library-go/pkg/config/configdefaults"
2626
"github.com/openshift/library-go/pkg/config/serving"
27+
"github.com/openshift/library-go/pkg/crypto"
2728
"k8s.io/apiserver/pkg/authorization/authorizer"
2829
"k8s.io/apiserver/pkg/authorization/union"
2930
genericapiserver "k8s.io/apiserver/pkg/server"
@@ -73,6 +74,11 @@ func (s *Server) Run(ctx context.Context, collectionProfilesEnabled bool) error
7374
// Don't set a CA file for client certificates because the CA is read from
7475
// the kube-system/extension-apiserver-authentication ConfigMap.
7576
servingInfo.ServingInfo.ClientCA = ""
77+
// Use intermediate TLS profile cipher suites to avoid insecure cipher warnings
78+
// Convert OpenSSL cipher names to IANA names for Kubernetes validation
79+
intermediateTLSProfile := configv1.TLSProfiles[configv1.TLSProfileIntermediateType]
80+
servingInfo.ServingInfo.CipherSuites = crypto.OpenSSLToIANACipherSuites(intermediateTLSProfile.Ciphers)
81+
servingInfo.ServingInfo.MinTLSVersion = string(intermediateTLSProfile.MinTLSVersion)
7682

7783
serverConfig, err := serving.ToServerConfig(
7884
ctx,

0 commit comments

Comments
 (0)