Skip to content

feat: integrate with cluster TLS security profile - #4931

Open
ugiordan wants to merge 1 commit into
ray-project:masterfrom
ugiordan:tls-profile-upstream
Open

ugiordan wants to merge 1 commit into
ray-project:masterfrom
ugiordan:tls-profile-upstream

Conversation

@ugiordan

Copy link
Copy Markdown

Summary

  • Read the cluster-wide TLS security profile from apiservers.config.openshift.io/cluster at startup
  • TLS resolution code in ray-operator/pkg/tls/ using typed configv1.APIServer objects (openshift/api already a dependency)
  • Apply MinVersion, CipherSuites, and NextProtos to metrics server TLS config
  • Fail closed on unexpected errors, use Intermediate defaults (TLS 1.2, ECDHE ciphers) on non-OpenShift clusters
  • Add RBAC for config.openshift.io/apiservers (get/list/watch)
  • Sync Helm chart RBAC with generated role.yaml

Motivation

OCP 5.0 requires all components to honor the centralized TLS profile. The kuberay operator already imports openshift/api (for routes). This PR extends that to also read the cluster TLS security posture, ensuring the operator's metrics endpoint uses the correct TLS version and cipher suites configured by the cluster admin.

On non-OpenShift clusters, the code gracefully falls back to hardened defaults (TLS 1.2, Intermediate cipher set).

Reference: openshift/cluster-machine-approver #286

Test plan

  • go build ./... passes
  • go test ./pkg/tls/... -v passes (9 table-driven tests)
  • make manifests regenerated RBAC
  • Deploy on OpenShift cluster with Intermediate profile
  • Deploy on vanilla K8s, verify fallback

Comment thread ray-operator/pkg/tls/tls.go Outdated
@ugiordan
ugiordan force-pushed the tls-profile-upstream branch from 5ff3ccc to c13d4c4 Compare June 19, 2026 15:23
Comment thread ray-operator/main.go
@ugiordan
ugiordan force-pushed the tls-profile-upstream branch from c13d4c4 to e2e3932 Compare June 19, 2026 15:45
Comment thread ray-operator/main.go Outdated
Comment thread ray-operator/main.go
@ugiordan
ugiordan force-pushed the tls-profile-upstream branch from 54193e6 to 056577f Compare July 27, 2026 07:28
Comment thread helm-chart/kuberay-operator/templates/_helpers.tpl
@ugiordan
ugiordan force-pushed the tls-profile-upstream branch from 056577f to 1cc66ab Compare July 27, 2026 07:46
Comment thread helm-chart/kuberay-operator/templates/role.yaml
@ugiordan ugiordan closed this Jul 27, 2026
@ugiordan ugiordan reopened this Jul 27, 2026
Read the cluster-wide TLS security profile from
apiservers.config.openshift.io/cluster at startup and apply MinVersion,
CipherSuites, and NextProtos to the metrics server TLS config.

On non-OpenShift clusters or when the API is temporarily unavailable,
fall back to hardened Intermediate defaults (TLS 1.2, ECDHE AEAD
ciphers, ALPN h2/http1.1). Transient errors (503, timeout, 429,
context deadline) are handled gracefully. Non-transient errors
(including 403 Forbidden from missing RBAC) crash the operator so
kubelet restarts it until the configuration is correct.

Signed-off-by: Ugo Giordano <ugiordan@redhat.com>
@ugiordan
ugiordan force-pushed the tls-profile-upstream branch from 1cc66ab to 79e5ef9 Compare August 18, 2026 08:32

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 79e5ef9. Configure here.

"ECDHE-RSA-CHACHA20-POLY1305-SHA256": tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
"ECDHE-ECDSA-CHACHA20-POLY1305": tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
"ECDHE-RSA-CHACHA20-POLY1305": tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom cipher map is incomplete

Medium Severity

openSSLToGoCipher only maps GCM and ChaCha20 ECDHE suites. Go-supported suites that still appear in OpenShift custom or Old profiles (for example CBC SHA and RSA GCM names) are dropped. A custom profile can therefore lose most of its intended ciphers, or fail startup if every listed cipher is treated as unsupported.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 79e5ef9. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants