Repository navigation
OPRUN-4798: feat: configure OLMv0 TLS curves from cluster profile #3946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -374,7 +374,7 @@ func applyClusterTLSProfile(ctx context.Context, config *rest.Config, serving *g | |
|
|
||
| // applyClusterTLSProfileWithClients is the testable core of applyClusterTLSProfile. | ||
| // It applies the cluster-wide APIServer TLS security profile to the SecureServingOptions, | ||
| // but only for fields not already set by explicit flags (--tls-min-version / --tls-cipher-suites). | ||
| // but only for fields not already set by explicit TLS flags. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. olmapiserver.GetSecurityProfileConfig() is called by_applyClusterTLSProfileWithClients()_ which in turn is called only via applyClusterTLSProfile(). This issue (getting olmapiserver.GetSecurityProfileConfig() in the call stack only when |
||
| // It is a no-op on non-OpenShift clusters. | ||
| func applyClusterTLSProfileWithClients(ctx context.Context, discovery apidiscovery.DiscoveryInterface, cfgClient configv1client.Interface, serving *genericoptions.SecureServingOptionsWithLoopback) error { | ||
| available, err := openshiftconfig.IsAPIAvailable(discovery) | ||
|
|
@@ -390,14 +390,20 @@ func applyClusterTLSProfileWithClients(ctx context.Context, discovery apidiscove | |
| return fmt.Errorf("failed to get APIServer config: %w", err) | ||
| } | ||
|
|
||
| minVersion, cipherSuites := olmapiserver.GetSecurityProfileConfig(apiServer.Spec.TLSSecurityProfile) | ||
| minVersion, cipherSuites, curvePreferences := olmapiserver.GetSecurityProfileConfig(apiServer.Spec.TLSSecurityProfile) | ||
| // Only override fields not already set by explicit flags. | ||
| if serving.MinTLSVersion == "" { | ||
| serving.MinTLSVersion = libcrypto.TLSVersionToNameOrDie(minVersion) | ||
| } | ||
| if len(serving.CipherSuites) == 0 { | ||
| serving.CipherSuites = libcrypto.CipherSuitesToNamesOrDie(cipherSuites) | ||
| } | ||
| log.Infof("Applying cluster TLS security profile: minVersion=%s cipherSuites=%v", serving.MinTLSVersion, serving.CipherSuites) | ||
| if len(serving.CurvePreferences) == 0 { | ||
|
tmshort marked this conversation as resolved.
Resolved
|
||
| serving.CurvePreferences = make([]int32, len(curvePreferences)) | ||
| for i, curvePreference := range curvePreferences { | ||
| serving.CurvePreferences[i] = int32(curvePreference) | ||
| } | ||
| } | ||
| log.Infof("Applying cluster TLS security profile: minVersion=%s cipherSuites=%v curvePreferences=%v", serving.MinTLSVersion, serving.CipherSuites, serving.CurvePreferences) | ||
| return nil | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.