Skip to content

Commit dd97cd3

Browse files
Merge pull request #1378 from jcmoraisjr/OCPBUGS-62238-router-tls-metrics
OCPBUGS-62238: configure tls profile for router metrics
2 parents d028938 + 9ddddd1 commit dd97cd3

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

pkg/operator/controller/ingress/deployment.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"github.com/google/go-cmp/cmp/cmpopts"
2121

2222
operatorv1 "github.com/openshift/api/operator/v1"
23+
"github.com/openshift/library-go/pkg/crypto"
2324

2425
"github.com/openshift/cluster-ingress-operator/pkg/manifests"
2526
"github.com/openshift/cluster-ingress-operator/pkg/operator/controller"
@@ -983,6 +984,18 @@ func desiredRouterDeployment(ci *operatorv1.IngressController, config *Config, i
983984
}
984985
env = append(env, corev1.EnvVar{Name: "SSL_MIN_VERSION", Value: minTLSVersion})
985986

987+
tlsProfileMetrics := tlsProfileSpecForSecurityProfile(apiConfig.Spec.TLSSecurityProfile)
988+
989+
// User facing config uses OpenSSL names. Internally we always use IANA ones.
990+
// OpenSSLToIANACipherSuites() converts and also removes any invalid cipher, otherwise router would crash.
991+
ianaNames := crypto.OpenSSLToIANACipherSuites(tlsProfileMetrics.Ciphers)
992+
if len(ianaNames) == 0 {
993+
log.Info("no valid ciphers found on TLS profile configuration, using Intermediate profile")
994+
ianaNames = crypto.OpenSSLToIANACipherSuites(configv1.TLSProfiles[configv1.TLSProfileIntermediateType].Ciphers)
995+
}
996+
env = append(env, corev1.EnvVar{Name: "ROUTER_METRICS_TLS_CIPHERS", Value: strings.Join(ianaNames, ":")})
997+
env = append(env, corev1.EnvVar{Name: "ROUTER_METRICS_TLS_MIN_VERSION", Value: string(tlsProfileMetrics.MinTLSVersion)})
998+
986999
usingIPv4 := false
9871000
usingIPv6 := false
9881001
for _, clusterNetworkEntry := range networkConfig.Status.ClusterNetwork {

0 commit comments

Comments
 (0)