RHOAIENG-96983, RHOAIENG-96984: harden TLS profile resolution and add BFF live reload #10325
All Vouch review confidence checks passed
Residual risk 0.40 = Change Risk (0.75) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #10325"
general
weight: 0.35
lucferbux
Fixes: https://issues.redhat.com/browse/RHOAIENG-96983
Fixes: https://issues.redhat.com/browse/RHOAIENG-96984
Problem
As part of the OCP 5 / RHOAI 3.6 TLS hardening epic (RHOAIENG-96306), the dashboard's TLS profile handling had three gaps assigned to Pewter:
apiservers.config.openshift.io/cluster) could not be read due to RBAC (401/403), both the shared BFF resolver (pkg/tls) and the operator resolver (dashboard-operator/internal/tls) silently fell back to Mozilla Intermediate defaults. A misconfigured cluster could therefore serve a weaker TLS policy than the admin intended, with no signal. The operator also substituted Intermediate for unknown profile types, missingCustomblocks, and unknownminTLSVersion, and neither resolver validated that mapped TLS ≤1.2 ciphers are actually negotiable by the running Go runtime.workspaces/backend) constructedtls.Config{MinVersion: TLS13}directly instead of honoring the cluster profile, and thenotebookscluster-role lackedconfig.openshift.io/apiserversaccess entirely.Solution
pkg/tls(shared BFF resolver): fail closed on 401/403 and on unknown profile types; validate mapped TLS ≤1.2 ciphers againsttls.CipherSuites()∪tls.InsecureCipherSuites()and reject sets with no usable suite; keepNotFound/NoMatchError(non-OpenShift) fail-open to Intermediate; keep nil/empty → Intermediate. AddedServeTLSWithReload/ListenAndServeTLSWithReload, which poll the cluster profile and gracefully restart the HTTPS listener when the resolved config changes.dashboard-operator/internal/tls: mirror the fail-closed behavior so the two resolvers stay in sync — 401/403, unknown type, missingCustomblock, and unknownminTLSVersionnow return errors; errors are threaded throughparseProfile/parseCustomProfile; ciphers are validated against the Go runtime.ListenAndServeTLSWithReloadbehind a single signal-driven shutdown path; fail fast (exit 1) on fatal serve errors. The non-TLS path is unchanged.NewServernow takes a resolvedtls.Configderived from the cluster profile via the notebooks controller's existingpkg/tls.Resolve(already a dependency — no upstream divergence), with a graceful restart loop driven by the existingProfileWatcher.config.openshift.io/apiserversget;list;watchto thenotebookscluster-role (was missing) and thedata-connect-hubcluster-role (list/watchrequire noresourceNames;apiserversis a cluster singleton, so this stays effectively least-privilege).Behavior change / security note: 401/403 and unknown-profile-type now fail closed in both resolvers. This is intentional per the hardening epic and the 96983 acceptance criteria. The availability tradeoff: a service account missing
apiserversget permission, or a cluster advertising a TLS profile type this code doesn't recognize, will now fail to start rather than silently serving Intermediate. RBAC for all affected modules is included here.Scope note on 96984: the data-connect-hub BFF listener already consumed the shared resolver (the ticket text was stale for that half); this PR adds its live reload and the RBAC verb bump. The notebooks backend reuses the controller's resolver, whose 401/403 handling is fail-open-with-watcher-self-heal by that component's own design/tests; this PR does not change that upstream contract. With an unset cluster profile the notebooks listener now resolves to Intermediate (TLS 1.2 Mozilla baseline) rather than the previous hardcoded TLS 1.3.
Evidence
All changed Go modules build, vet, and test clean locally (Go 1.25.4; the notebooks backend auto-fetched its go 1.26.5 toolchain). gofmt reports no diffs on any edited file.
<details>
<summary>Verification commands and results</summary>
</details>
Automated coverage added:
pkg/tls: 401/403 fail-closed, unknown-type fail-closed, runtime cipher validation,tlsConfigEqual,watchForReload(change / unchanged / transient-error / ctx-cancel), and an end-to-endserveTLSWithReloadtest that serves over TLS and asserts the listener restarts when the resolved profile changes.dashboard-operator/internal/tls: Forbidden/Unauthorized/unknown-type/missing-Custom/bad-minTLSVersion all fail closed.ReloadTLSConfigswaps the config and signals a non-blocking restart.Not cluster-verified: live reload against a real OpenShift APIServer profile edit is covered by unit/e2e tests here; an on-cluster check with the built images is a reasonable follow-up before release.
[RHOAIENG-96306]: https://redhat.atlassian.net/browse/RHOAIENG-96306?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[RHOAIENG-96983]: https://redhat.atlassian.net/browse/RHOAIENG-96983?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[RHOAIENG-96983]: https://redhat.atlassian.net/browse/RHOAIENG-96983?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
HTTPS listeners use the cluster-wide TLS security profile and periodically apply changes with a graceful restart.
HTTPS starts only when both a certificate and key are configured.
Bug Fixes
Malformed or unsupported TLS profiles and denied profile access now return errors instead of silently using defaults. Transient API errors can still use Intermediate defaults.
Cipher suites unsupported by the running environment are excluded.
Documentation
* Updated HTTPS guidance to cover profile access requirements, reload behavior, and fallback conditions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->