OCPBUGS-62238: configure tls profile for router metrics#1378
OCPBUGS-62238: configure tls profile for router metrics#1378jcmoraisjr wants to merge 1 commit intoopenshift:masterfrom
Conversation
|
@jcmoraisjr: This pull request references Jira Issue OCPBUGS-62238, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis change updates the ingress deployment controller to add TLS metrics configuration. It computes OpenSSL-to-IANA cipher suite names via 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/retest |
|
tested it with 4.21.0-0-2026-03-10-115701-test-ci-ln-mwiic1k-latest, two new envs ROUTER_METRICS_TLS_CIPHERS and ROUTER_METRICS_TLS_MIN_VERSION were added |
|
/assign |
davidesalerno
left a comment
There was a problem hiding this comment.
A couple of comments
| // User facing config uses OpenSSL names. Internally we always use IANA ones. | ||
| // OpenSSLToIANACipherSuites() converts and also removes any invalid cipher, otherwise router would crash. | ||
| ianaNames := crypto.OpenSSLToIANACipherSuites(tlsProfileMetrics.Ciphers) | ||
| env = append(env, corev1.EnvVar{Name: "ROUTER_METRICS_TLS_CIPHERS", Value: strings.Join(ianaNames, ":")}) |
There was a problem hiding this comment.
If tlsProfileMetrics.Ciphers is empty OR conversion drops everything, strings.Join(ianaNames, ":") becomes "".
Isn't it better to set ROUTER_METRICS_TLS_CIPHERS only when len(ianaNames) > 0
There was a problem hiding this comment.
Just realized that this is already handled by router: in case envvar is missing or empty, it defaults to the intermediate profile. So assigning empty is fine. Moreover apiserver api already validates if the user input has at least one valid tls1.0-1.2 cipher name, so it ensures that this will never be empty.
| } | ||
| env = append(env, corev1.EnvVar{Name: "SSL_MIN_VERSION", Value: minTLSVersion}) | ||
|
|
||
| tlsProfileMetrics := tlsProfileSpecForSecurityProfile(apiConfig.Spec.TLSSecurityProfile) |
There was a problem hiding this comment.
I could be useful to add a small guard/comment or unit test to cover the case when TLSSecurityProfile is nil.
There was a problem hiding this comment.
This is already implemented inside tlsProfileSpecForSecurityProfile(): in case the profile is nil, it uses the intermediate profile.
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bentito The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@ShudiLi can you re-verify please? |
|
/lgtm |
|
/hold I'll add another validation on the incoming ciphers, on top of the apiserver api ones, to ensure we send only a valid list to the router. |
Router has two new envvars to configure TLS minimal version and allowed ciphers. This update reads the configuration from the apiserver TLS profile and configures those envvars accordingly. TLS profile has cipher names in OpenSSL format, while internally library-go uses IANA names. The name is converted before sending to router, which is an internal component. https://issues.redhat.com/browse/OCPBUGS-62238
8d9a3fd to
9ddddd1
Compare
|
/lgtm |
|
/tide refresh |
|
/test unit |
|
/retest-required |
|
tested it with 4.22.0-0-2026-03-17-024743-test-ci-ln-yy3r7fk-latest |
|
/verified by @ShudiLi |
|
@ShudiLi: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/test hypershift-e2e-aks |
|
/unhold |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
/test e2e-aws-ovn-hypershift-conformance |
|
/override ci/prow/e2e-aws-ovn-hypershift-conformance |
|
@jcmoraisjr: Overrode contexts on behalf of jcmoraisjr: ci/prow/e2e-aws-ovn-hypershift-conformance DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@jcmoraisjr: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Router has two new envvars to configure TLS minimal version and allowed ciphers. This update reads the configuration from the apiserver TLS profile and configures those envvars accordingly.
TLS profile has cipher names in OpenSSL format, while internally library-go uses IANA names. The name is converted before sending to router, which is an internal component.
https://issues.redhat.com/browse/OCPBUGS-62238