← Back to Pull requests

RHOAIENG-98916: Narrow operator and module Secret RBAC #10887

Open
liday-rh opened this pull request with 1422 lines diff across 37 files
View on GitHub
liday-rh liday-rh commented on Nov 27, 2026 00:19 UTC
Author

Fixes: https://redhat.atlassian.net/browse/RHOAIENG-98916

Problem

The dashboard-operator ClusterRole grants Secret CRUD across the entire cluster. The operator service account can therefore read and mutate every Secret in every namespace, even though the controller only needs Secret access in its applications namespace and the consented notebooks/model-registry target namespaces.

The notebooks, gen-ai, and autorag module service accounts also need cross-namespace Secret access for user-project workspaces, pgvector provisioning, and router-CA reads. Those module grants must remain functional after the operator’s own broad Secret permission is removed.

Solution

  • Remove Secret permissions from the dashboard-operator ClusterRole in both the Helm chart and Kustomize install paths.

  • Install the operator's Secret Role and RoleBinding in the applications namespace. For standalone installs, provision notebooks and model-registry target grants through chart values or opt-in Kustomize components.

  • Wire bindings to the rendered operator and module ServiceAccount identities, including Helm and Kustomize installs with separate operator and applications namespaces. The chart labels the installer-owned module grants with its standard ownership labels.

  • Add chart- and Kustomize-installed module Secret ClusterRoles and ClusterRoleBindings for notebooks, gen-ai, and autorag.

  • Remove Secret rules from the runtime-applied module ClusterRoles so the operator no longer needs cluster-wide Secret permission to create or repair module RBAC.

  • Preserve the operator-owned Secret Roles and RoleBindings during Dashboard teardown.

  • Keep the notebooks Secret grant free of watch, matching the backend’s direct API reads.
  • The consent-webhook work is already merged in #10716. This PR contains only the RHOAIENG-98916 RBAC changes.

    Production rollout prerequisite

    Merge opendatahub-operator#4378 before this PR. For platform-managed ODH and RHOAI, the platform operator creates and reconciles its own Secret Roles and RoleBindings for consented DSC targets before publishing the corresponding namespaces in the Dashboard CR. Verify those grants are in place before deploying this Dashboard chart and image. The chart supplies the applications-namespace grant. If a grant is missing and Kubernetes denies reconciliation, the Dashboard reports Ready=False with reason NamespacedRBACFailed and identifies the namespace to check.

    Evidence

  • make test

  • make lint

  • make chart-validate

  • TestIntegration_NamespacedRBACUnderOperatorPermissions

  • TestIntegration_ManagementStateRemoved_TeardownResources

  • TestIntegration_ManagementStateRemoved_IdempotentRereconcile
  • The integration test installs actual Helm and Kustomize renders, verifies recovery after applying the grants for an existing Dashboard's targets, and checks the operator and three module ServiceAccount identities against the API server. Render tests also verify binding subjects and role references for co-located and split-namespace Helm installs and the stock and split-namespace Kustomize overlays.

    Justifications

    The notebooks, gen-ai, and autorag service accounts intentionally retain cross-namespace Secret access because their backends operate on user-project resources. Those grants are now installer-owned ClusterRoles and ClusterRoleBindings rather than runtime-applied operator-created RBAC, so the operator itself no longer needs the permissions it delegates. The module bindings are inert until each module’s service account is created.

    Diff: 1422 lines (+1358 / -64) across 37 files Reviewer: lucferbux Review duration: 13014m
    All Vouch review confidence checks passed
    Residual risk 0.10 = Change Risk (0.95) × (1 − Review Confidence (0.90)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.95 · 1422 lines diff across 37 files
    0.95
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.96 · 5 substantive comment(s)
    0.96
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    89%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.400
    Sensitive Paths sensitive_paths
    0.095
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    48 items
    coderabbitai[bot] coderabbitai[bot] commented on Nov 27, 2026 00:19 UTC
    Bot

    <!-- coderabbit-ai-generated:v1 -->

    <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
    <!-- pre_merge_checks_walkthrough_start -->

    <details>
    <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 6</strong></summary>
    <dl>
    <dd>
    <br>

    | Check name | Status | Explanation |
    | :------------------------------------- | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Contribution Quality And Spam Detection | !Passed | Verdict: PASS. The PR does not meet the check's threshold of at least two signals from different categories, with at least one from SECURITY THEATER or CODE QUALITY. Context: - Provider-reported prima… |
    | No Hardcoded Secrets | !Passed | The "No Hardcoded Secrets" check passes. I diffed the PR head (dfff1cf) against origin/main (352f67f), covering 37 changed files. The added lines contain no private key blocks, no known token formats … |
    | No Weak Cryptography | !Passed | No weak cryptography introduced. The PR (RHOAIENG-98916, #10887, author liday-rh) narrows Secret RBAC. It changes the dashboard-operator ClusterRole, Helm and Kustomize RBAC manifests, Role/RoleBi… |
    | No Injection Vectors | !Passed | No Injection Vectors: PASS. The PR (opendatahub-io/odh-dashboard #10887, author liday-rh) introduces no matching injection pattern. Scope checked: the PR commits (180c4b5d through dfff1cf) against… |
    | No Privileged Containers | !Passed | The check is applicable: the PR touches Kubernetes/Helm manifests. I compared the PR head (dfff1cf) against main (352f67f) and excluded Markdown. The diff covers 34 files: Helm chart templates and val… |
    | No Sensitive Data In Logs | !Passed | Result: PASS. The PR adds no logging statement that exposes passwords, tokens, API keys, PII, session IDs, bearer tokens, credentials, or raw request/response bodies. Scope of evidence. The ch… |

    <details>
    <summary><strong>Full details: Contribution Quality And Spam Detection</strong></summary>
    <dl>
    <dd>
    <br>

    Explanation

    Verdict: PASS. The PR does not meet the check's threshold of at least two signals from different categories, with at least one from SECURITY THEATER or CODE QUALITY. Context: - Provider-reported primary PR: opendatahub-io/odh-dashboard #10887, base main, head rhoaieng-98916-narrow-secret-rbac, author login liday-rh. - Title: "RHOAIENG-98916: Narrow operator and module Secret RBAC". - Description links a Jira ticket (RHOAIENG-98916) and a dependency PR (opendatahub-operator#4378). It names specific artifacts: the dashboard-operator ClusterRole, the Helm and Kustomize install paths, and the notebooks, gen-ai, and autorag module ServiceAccounts. It also lists specific test names. Signal review: - Templated content: The description uses Problem/Solution/Evidence/Justifications headings. Its content is specific to this codebase, so the template signal is weak. - Security theater: Not present. This is a least-privilege reduction (CWE-272 context) of cluster-wide Secret permissions in the operator's own RBAC. It is not a theoretical fix in dev tooling or a scanner-driven change with no runtime impact. - Contribution pattern: A linked Jira ticket exists. The change spans multiple files and components, so it is not a single-file additive edit. - Code quality: No evidence in the description of unreachable checks or redundant validation. I did not inspect the diff. - Cross-repo spray: No verifiable cross-repo evidence was available. This category does not count. Limitations: I did not inspect the diff, the commit history, or the author's prior activity. The verdict rests on the PR metadata and description. The check also states that a single signal is insufficient and that doubt favors PASS.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong>Full details: No Hardcoded Secrets</strong></summary>
    <dl>
    <dd>
    <br>

    Explanation

    The "No Hardcoded Secrets" check passes. I diffed the PR head (dfff1cf) against origin/main (352f67f), covering 37 changed files. The added lines contain no private key blocks, no known token formats (AWS, GitHub, Slack, OpenAI-style, JWT), no URLs with embedded user:pass credentials, and no base64-like literal values. The hits for secret, token, credential and similar words are RBAC rule resource names (for example secrets, genai-pgvector-credentials, router-ca), Role and RoleBinding object names, Go test function and identifier names, and Secret object names that are never given data. The only value: fields are test env values (integration-test, real-rbac-notebooks, real-rbac-model-registry). None of these is a credential. The check does not apply to a diff with no credential material, so no finding is raised. This pass covers the diff text only. It does not scan unchanged files.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong>Full details: No Weak Cryptography</strong></summary>
    <dl>
    <dd>
    <br>

    Explanation

    No weak cryptography introduced. The PR (RHOAIENG-98916, #10887, author liday-rh) narrows Secret RBAC. It changes the dashboard-operator ClusterRole, Helm and Kustomize RBAC manifests, Role/RoleBinding wiring, and the runtime RBAC reconciliation in dashboard-operator/internal/controller/namespaced_rbac.go. None of these changes involves cryptographic primitives, hashing, ciphers, or secret/token comparison. Evidence gathered: - The checkout has no usable base revision. HEAD is a root commit that adds the whole repository, so a PR-only diff could not be isolated. I therefore scanned the PR-touched area directly. - A repository-wide search for MD5, SHA-1, DES, RC4, Blowfish, ECB, createCipher, aes.NewCipher, hmac.Equal, and similar patterns returned no matches under dashboard-operator/. - The only SHA-1 hit (packages/analytics/src/segmentUtils.ts) and the other hashing and Math.random hits sit in unrelated packages that the PR description does not mention. They are not attributed to this PR. - Token comparisons in the gen-ai and core BFF code already use subtle.ConstantTimeCompare. Those files are not part of this PR. - Secret-related comparisons in dashboard-operator are structural (volume.Secret != nil, deploymentSecret != webhookTLSSecret). They are not secret-value or HMAC comparisons. The PR introduces no banned primitive, no custom cryptography, and no non-constant-time comparison of secrets, tokens, or HMAC values.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong>Full details: No Injection Vectors</strong></summary>
    <dl>
    <dd>
    <br>

    Explanation

    No Injection Vectors: PASS. The PR (opendatahub-io/odh-dashboard #10887, author liday-rh) introduces no matching injection pattern. Scope checked: the PR commits (180c4b5d through dfff1cf) against base 352f67fe. The diff touches 37 files: Helm templates and values, Kustomize configs, Go controller code, Go tests, docs, and module ClusterRole manifests. Evidence: - Non-test Go changes (dashboard_controller.go, namespaced_rbac.go) add name helpers built from constants and a fixed scope string, an expected-resource map, and an fmt.Errorf error message. None of these is SQL, a shell call, eval/exec, deserialization, or HTML output. - Pattern search over non-test added lines found no exec/subprocess/os.system, eval/exec, pickle, yaml.Unmarshal/yaml.load, innerHTML/dangerouslySetInnerHTML, or SQL string building. - exec.Command("helm", ...) appears only in _test.go files, which the check excludes. Its arguments are fixed test inputs. - Helm templates interpolate install values such as namespaces and labels through include/printf. These are installer-controlled deployment settings, not untrusted runtime input, and they do not match any CWE listed in the check. - No frontend changes appear in the PR diff. Out of scope: the tone instruction requests a supply-chain focus on dependency, CI/CD, IDE, and .gitattributes changes. That focus is not part of this check's criteria, so I did not treat it as a failure condition. The PR does not change dependency or CI files in the listed diff. Limitation: the local checkout is shallow. I established the PR diff from the commit range 352f67fe..HEAD in the local repository, not from the provider's PR diff view.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong>Full details: No Privileged Containers</strong></summary>
    <dl>
    <dd>
    <br>

    Explanation

    The check is applicable: the PR touches Kubernetes/Helm manifests. I compared the PR head (dfff1cf) against main (352f67f) and excluded Markdown. The diff covers 34 files: Helm chart templates and values, Kustomize configs, controller Go code and tests, and module ClusterRole manifests. I searched all added and removed lines for privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation, runAsUser, runAsNonRoot, securityContext, capabilities, and USER root. None matched. No Dockerfile changed, and no Pod, Deployment, or container spec changed. The PR changes RBAC rules and bindings only. It removes Secret rules from the operator ClusterRole and adds namespaced or cluster-scoped Secret grants for module service accounts. That is a permission change, not a container privilege change, so no pod-level privilege condition in the check is introduced.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong>Full details: No Sensitive Data In Logs</strong></summary>
    <dl>
    <dd>
    <br>

    Explanation

    Result: PASS. The PR adds no logging statement that exposes passwords, tokens, API keys, PII, session IDs, bearer tokens, credentials, or raw request/response bodies. Scope of evidence. The checked-out HEAD is a single commit with no usable parent. I compared it with origin/main (352f67f). The diff touches 37 files, mainly Helm and Kustomize RBAC manifests, Go controller and test files, docs, and module ClusterRoles. Checks performed. - I grepped every added Go line for logging calls (logger., log., klog, Info(, Error(, Printf, and similar). Every hit was a require.NoError or yaml.Unmarshal call in test code, or the fmt.Errorf below. No new logger call was added. - The only changed non-test Go production code is namespaced_rbac.go and dashboard_controller.go. The dashboard_controller.go diff adds Role and RoleBinding name constants and operator-owned resource map entries. The namespaced_rbac.go diff wraps a Forbidden error with a message that names the namespace. The existing logger.Error(rbacErr, ...) call that consumes this error was already present before the PR. - The added error text includes only a namespace name, the instruction text, and the wrapped Kubernetes Forbidden error. It does not include secret data, tokens, or credentials. - The YAML and Helm diff contains the Secret name genai-pgvector-credentials in RBAC resourceNames. This is a resource name, not a secret value. - The integration tests and render tests use Secret objects. They do not log those objects. Residual note. The pre-existing log lines in the controller, such as Neutralizing stale namespaced RBAC Role with name and namespace, log only object names. The PR does not change them.

    </dd>
    </dl>
    </details>

    </dd>
    </dl>
    </details>

    <!-- pre_merge_checks_walkthrough_end -->

    <!-- internal state start -->

    <!-- N4IgzgxgFgpgtgQwGowE5gJYHsB2IBcAjADTgAuqArhGZajACYDKZCZMBoYF1t9K6bHiKkADvQCyaAOYwAwrAgBrMJxAYwABQBKAIQA2WZYzlY4cGDjKas3RgQBmCfWBikNAeQBuaVBgYMlo7OrqQQWIHaCABG0RhkAOqoWOyaqAAq8foc+E4ubiD6CNwKMMraMGCU+mSq+ADaoNBlSgByCBYEIKZWftGUZEIABACKlM7xAJ5DAII4DENMoh1DACIw7DRCIKTcbJR1PAX04TgOGNJ0OXmhIDAAHqJFOGzb+CACDBg0+EOaM0wmAA6IbpWB/bRDBhYSpDHApIYWDZDMjg5rKADkYBRUHoYCgWH0CywDiGbCG2WKZBRAHcsENMNIXi4hg5knAoRgHA40JZqRA2DBpFg/JViEMafEoGTqZTuENcDBWezFgBROQAVW0AEl0gBNUEACVVM3SqshIqGcg8q1Vow1MwAMrq9SCeux7mRfgBaP7JLz+NDe+iiEXsBbiDCIVDTHS/LCiSwMNgIKCUaLe7AAegiUG9yfx0SwCFQCwAxIQAAwADmrAHZxdFikqAAaIDA4Fvi2AIBYt1AEhAYSzSb0ATmrY8IADZvS9UMkad7XBB6GRg02IF2yQMCagKVhpB2hi39P4EJNg1AWyDfZkyNlfgAdEDaQ0eGba1WtADi48nM6/O0C5YDSCqJqgbCWgg8yIhE1RKkwZRrkMegzHIL63mslSrhgoiDLgFIdioZJDAAUhgkEot8SjIgAFG+H5fr+/5TtOACUZKwQgUIwIm8yWBAsaQnRCZJimaYZmJkFkCKZYACwAMx1tW7Egtq1IvBY2JgImEBct8ZKoIMTg0GAvyokqBZQEWJYMN60lQfucj6Ac7CoNohJuDiSqGjA+gcjBCwANJuWYGAAF5Kh2ez6PoQzLKiYDikFPlwikMBFlgKjirIODekOKXcQMIoINIcEMAhixoAGEAwDMEDhJQVhgOp1IhPSZ7cDpekGRAKKVJpHSVCCTA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HiK6+ovY6fNKVf4U1dwubgL1aXhr2Xx3kUOidfx37232mhpPtryMoUi1iBgXUn0YjfQLCWmAUxXA/iRFPwX2KvFi6q7W1iAPawiNB6bLWEKHR4i39uMvCcEJAwbLbwa2x9cENv0DoMpMWw+HFtiBbB78F8/gW6OdROrdYKEbCDsKyzliv5ZMrAXrlmlW5Ld0MAxRAeKj1AzBoaASMug5XnYxQ0oopYTCeFgwYB4MiGb+Chnywrdb0x4FvNbw2pz8KU0GerDgVn5/phMSHfuDqSGBGY0+W8czJZkIh6Yx+v3LIglXzQIlRSAmb+IGlgCn16QH8erjiHxIKgqMngkEMV0qD+Al4psK7lV3FQUxvQD/QYNXn8GE1d8WiEKqbkaqdwW6OCFsL4QGCQQzwEUL1LFENLt1y+CwFvMRlvQfdS+w0LkrBFqHaR2q24fwaHQ8FCYAMcjRLKcWHY+Q4AGTXMoxySS5NWORZDjsUy46lN1snON5ttiqSCdakwnbZo9nkjLlAgK5QgIpA6b/Ixw0QTFHWB3KYo+yYKXcrp1BS4o4cBnR5gwCmbdJ5IdYfplWGmY2VFOXTOsHZyPIOcTyuzLHBeVxxXljmROO8l50fLQpKcfnBFAF1RRBdvyLOAlMSgAC6uwAkNUAYA2FlAOgJXAUC+AMBtAzUdYHvDwgHwGkWI0gDiLxE4B7w2QEkRC1uDkj8RRgFgFbS+g0jcuJKTJmgTeCgBt+8QGANqAYBdAdkJyP7I1HiHLkHA3oCHGpwKgdIEA3oEZtMzM5tkZwDgYlESiJRAA== -->

    <!-- internal state end -->

    fullsend-ai-review[bot] fullsend-ai-review[bot] commented on Nov 27, 2026 00:20 UTC
    Bot

    <!-- fullsend:agent-status:45916054768 -->
    <!-- fullsend:status:terminal -->
    🤖 Finished Review · ✅ Success · Started 12:20 AM UTC · Completed 1:00 AM UTC

    Commit: 28a5751 · View workflow run →

    Runtime: pi · Model: openai/gpt-6.1-sol → gpt-6.1-sol · Effort: high · Cost: $5.85

    dchourasia dchourasia commented on Nov 27, 2026 00:32 UTC
    Contributor

    /early-gate-build

    fullsend-ai-review[bot] fullsend-ai-review[bot] commented on Nov 27, 2026 00:59 UTC
    Bot

    <!-- fullsend:review-agent -->
    <!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJoaWdoIiwiY2F0ZWdvcnkiOiJhcGktY29udHJhY3QiLCJmaWxlIjoiZGFzaGJvYXJkLW9wZXJhdG9yL2NoYXJ0cy9kYXNoYm9hcmQvdGVtcGxhdGVzL3JiYWMueWFtbCIsImxpbmUiOjcwNn0seyJzZXZlcml0eSI6Im1lZGl1bSIsImNhdGVnb3J5IjoiZWRnZS1jYXNlIiwiZmlsZSI6ImRhc2hib2FyZC1vcGVyYXRvci9jb25maWcvcmJhYy9rdXN0b21pemF0aW9uLnlhbWwiLCJsaW5lIjo3fSx7InNldmVyaXR5IjoiaGlnaCIsImNhdGVnb3J5IjoiY29kZXJhYmJpdCIsImZpbGUiOiJkYXNoYm9hcmQtb3BlcmF0b3IvY29uZmlnL2RlZmF1bHQva3VzdG9taXphdGlvbi55YW1sIiwibGluZSI6Mjh9LHsic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6InBlcm1pc3Npb24tcmVkdWN0aW9uIiwiZmlsZSI6ImRhc2hib2FyZC1vcGVyYXRvci9jaGFydHMvZGFzaGJvYXJkL3RlbXBsYXRlcy9yYmFjLnlhbWwiLCJsaW5lIjo3MDV9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImNvZGUtb3JnYW5pemF0aW9uIiwiZmlsZSI6ImRhc2hib2FyZC1vcGVyYXRvci9jaGFydHMvZGFzaGJvYXJkL3RlbXBsYXRlcy9faGVscGVycy50cGwiLCJsaW5lIjo2N30seyJzZXZlcml0eSI6ImhpZ2giLCJjYXRlZ29yeSI6ImNvZGVyYWJiaXQiLCJmaWxlIjoiZGFzaGJvYXJkLW9wZXJhdG9yL2NvbmZpZy9yYmFjL21vZHVsZS1zZWNyZXQtcmJhYy55YW1sIiwibGluZSI6MjV9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImluY29ycmVjdC1kb2MiLCJmaWxlIjoiZG9jcy9kYXNoYm9hcmQtb3BlcmF0b3IubWQiLCJsaW5lIjo5N30seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiaW5jb21wbGV0ZS1kb2MiLCJmaWxlIjoibWFuaWZlc3RzL21vZHVsZXMvUkVBRE1FLm1kIiwibGluZSI6NDZ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6Im1pc3NpbmctZG9jIiwiZmlsZSI6ImRvY3MvZGFzaGJvYXJkLW9wZXJhdG9yLm1kIiwibGluZSI6Njk2fSx7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJjb2RlcmFiYml0IiwiZmlsZSI6ImRhc2hib2FyZC1vcGVyYXRvci9pbnRlcm5hbC9jb250cm9sbGVyL25hbWVzcGFjZWRfcmJhY19yZWFsX3Blcm1pc3Npb25zX2ludGVncmF0aW9uX3Rlc3QuZ28iLCJsaW5lIjoyMDZ9XX0= -->
    <!-- Head SHA: df9880b990c030bafe0b122f78f788bd78576622 -->

    Finished Review · request-changes · Commit: df9880b
    Started 12:45 UTC · Completed 13:17 UTC · View workflow run

    Change summary

    Removes cluster-wide Secret access from the dashboard operator, adds installer-owned namespace-scoped operator grants and separate module Secret grants, and preserves operator Secret RBAC during Dashboard teardown. Adds render, policy, teardown, and real-permission reconciliation tests.

    Status

    🔴 Waiting on author — 3 blocking findings and 1 failed readiness check before the agent bar can clear. Human still finalizes.

    Signals

    | Signal | Level | Assessment |
    | --- | --- | --- |
    | Risk | critical | This changes the platform’s Secret authorization boundary, moving permission ownership between the operator and installers across Helm, Kustomize, and three module identities. Incorrect grants affect credential access and cross-namespace reconciliation, making sensitivity the binding dimension. |
    | Confidence | low | The stated intent is clear and product-aligned, but completed evidence checks show that synthetic operator-permission tests do not establish preservation of production module Secret access. Final findings identify upgrade and namespace-wiring failures that contradict the preservation claim, so verified evidence is insufficient despite completed review coverage. |

    Checks

    | Check | Status | Details |
    | --- | --- | --- |
    | Test impact | ❌ fail | Substantial automation covers operator scoping and teardown, but the evidence does not adequately protect the claimed preservation of module Secret access.<br><br>Automation: warning — chart assertions cover operator Secret Role rules and binding subjects, unit tests reject runtime-applied Secret grants, and teardown tests check preservation of installer-owned operator RBAC. Important module-policy and installer-wiring assertions remain thin.<br><br>Efficiency: pass — Go unit/render tests handle policy structure and teardown, with an API-server integration test for authorization boundaries. This is an appropriate tier mix without Cypress dependence.<br><br>Evidence depth: fail — TestDashboardChartModuleSecretRBAC in dashboard-operator/charts/chart_sync_test.go does not assert module binding subject names or the gen-ai/autorag permission rules. TestModuleSecretRBACIsInstallerOwned checks Kustomize binding presence but not their subjects or role references; TestKustomizeSecretRBAC checks Role namespaces and ClusterRole presence, not effective binding wiring. Incorrect module service-account subjects could therefore leave these assertions passing while breaking the cross-namespace Secret access the PR promises to preserve.<br><br>The PR description names TestIntegration_NamespacedRBACUnderOperatorPermissions as evidence. Its committed steps exercise operator Secret creation in allowed namespaces, denial in an unrelated namespace, and creation of target-namespace dashboard RBAC. However, dashboard-operator/internal/controller/namespaced_rbac_real_permissions_integration_test.go constructs separate policy fixtures rather than installing the changed module RBAC, never impersonates module identities, and only rereads the synthetic module grants. The unchanged createIntegrationManifests helper supplies minimal Deployments and Services rather than production module ClusterRoles. This supports the narrower operator-reconciliation claim, not preservation of production module Secret access. Add exact rendered policy/binding assertions or authorization tests using rendered installer resources and the actual module identities.<br><br>Visual delta: none -- this head changes RBAC manifests and controller teardown logic without changing rendered UI. This assessment is based on source and supplied author evidence; it makes no independent runtime-verification claim. |
    | PR description | ✅ pass | The description supplies substantive Problem, Solution, and Evidence content.<br><br>Problem: Explains the operator's excessive cluster-wide Secret access and the module workflows that must remain functional.<br><br>Solution: Describes namespace-scoped operator grants, installer-owned module grants, teardown preservation, and the security rationale for retaining module cross-namespace access.<br><br>Evidence: Lists test, lint, and chart-validation commands plus named integration tests, and describes the real-permission test scenario. |

    Findings

    High (3)

  • Correctness · api-contract (dashboard-operator/charts/dashboard/templates/rbac.yaml:706): The replacement target-namespace permissions depend on new Helm values that default to empty, independently of Dashboard.spec.notebooksNamespace and Dashboard.spec.modelRegistryNamespace. Rendering the chart with its defaults and reconciling an existing valid Dashboard with either cross-namespace target now fails: reconcileNamespacedRBAC still creates Secret-granting Roles, but Kubernetes rejects those writes as privilege escalation because the operator no longer holds Secret permissions there. Namespace consent does not supply the missing permissions. The new integration test avoids this compatibility case by manually provisioning both target grants. See also: [permission-reduction] finding at this location.

  • - Why: An installer that continues rendering the chart without the newly introduced values loses working cross-namespace reconciliation immediately when the narrowed ClusterRole is applied. The controller cannot repair its own missing permissions.
    - Remediation: Coordinate and gate the installer migration so these values are populated from the same namespace source as the Dashboard CR before removing the existing grant, including subsequent target changes. Add a compatibility test covering the installer-rendered RBAC and the actual Dashboard target configuration.

  • CodeRabbit · coderabbit (dashboard-operator/config/default/kustomization.yaml:28): The target-namespace replacements run inside the child Kustomize overlays. A supported parent overlay with namespace: my-ns overwrites the already-replaced namespaces on notebooks/model-registry Secret Roles and RoleBindings, placing them in my-ns rather than their intended target namespaces. The parent workflow re-runs certificate/webhook wiring but has no corresponding Secret-RBAC wiring.

  • - Why: Parent overlays that set their own namespace (the supported custom-namespace workflow in docs/dashboard-operator.md) rewrite metadata.namespace on the target Secret Roles and RoleBindings after config/default's replacements have run. The notebook and model-registry grants then land in the parent namespace, so cross-namespace reconcileNamespacedRBAC is rejected as privilege escalation.
    - Remediation: Move the notebooks and model-registry RBAC replacements into a shared wiring kustomization, and add that wiring under transformers in both config/default and config/webhook-enabled while retaining their existing replacements for direct installs. Update the parent-overlay workflow to instruct parent overlays to include the wiring in their own transformers, so the replacements run after the parent namespace transform and preserve the namespaces specified by the annotations.

  • CodeRabbit · coderabbit (dashboard-operator/config/rbac/module-secret-rbac.yaml:25): The installer-owned module Secret bindings and applications Secret Role follow the operator installation namespace, while module service accounts follow ApplicationsNamespace. In supported Kustomize installations that override APPLICATIONS_NAMESPACE to a different namespace, the actual notebooks, gen-ai and autorag service accounts lose their Secret grants after Secret rules are removed from the runtime module ClusterRoles. The operator also lacks its intended Secret grant in the actual applications namespace.

  • - Why: The installer-owned module Secret bindings, and the applications Secret Role/RoleBinding, follow the installation/operator namespace. Module service accounts are rendered into ApplicationsNamespace, which manager.yaml documents as an override point that may differ from the operator namespace. In split-namespace installations the real notebooks, gen-ai, and autorag service accounts get 403 on Secret operations, and the operator lacks Secret access in the actual applications namespace.
    - Remediation: Represent the applications namespace separately in installer configuration and use it for module Secret binding subjects and the applications Secret Role/RoleBinding location, while retaining the operator namespace for the operator service-account subject. Wire the Kustomize configuration to the APPLICATIONS_NAMESPACE override and cover unequal operator/applications namespaces in permission tests; preserve the autorag router-ca binding's existing access.

    Medium (3)

  • Correctness · edge-case (dashboard-operator/config/rbac/kustomization.yaml:7): Both Kustomize installation paths now unconditionally include Roles and RoleBindings targeting namespaces named notebooks and model-registry. The ServiceAccount annotation defaults and overlay replacements preserve those destinations, but neither installation creates those namespaces. A standalone installation with only the applications namespace therefore gets namespace-not-found errors from oc apply, even when the Dashboard has neither target configured.

  • - Why: Previously optional notebook/model-registry integrations become mandatory installation dependencies, and the documented default installation command now exits unsuccessfully on an otherwise valid standalone cluster.
    - Remediation: Make target-namespace RBAC opt-in through components or overlays, keeping the base installation limited to the applications namespace. Test installation with both optional integrations absent.

  • Security · permission-reduction (dashboard-operator/charts/dashboard/templates/rbac.yaml:705): The replacement target-namespace grants depend exclusively on new Helm values, which default to empty. An existing Dashboard with spec.notebooksNamespace or spec.modelRegistryNamespace outside the applications namespace therefore loses working RBAC reconciliation when upgraded without additional chart configuration. Both target paths in namespaced_rbac.go still create Roles containing Secret permissions; Kubernetes rejects those operations because the operator no longer holds the permissions it delegates. Namespace consent alone cannot satisfy this new prerequisite. The integration test manually provisions both target grants, so it does not exercise this upgrade case. See also: [api-contract] finding at this location.

  • - Why: Previously valid installations can fail with NamespacedRBACFailed after the cluster-wide grant is removed, and newly configured or changed target namespaces cannot receive the required dashboard access until installer configuration is updated separately.
    - Remediation: Coordinate and verify installer propagation of both Dashboard target namespaces into these chart values before removing the broad grant. Add an upgrade test covering an existing Dashboard with cross-namespace targets and the actual installer-rendered RBAC; make the new configuration prerequisite explicit.

  • CodeRabbit · coderabbit (dashboard-operator/internal/controller/namespaced_rbac_real_permissions_integration_test.go:206): The new real-permission integration test enables and reconciles notebooks, gen-ai and autorag in the shared integrationNamespace, but its cleanup only deletes the Dashboard CR. Unlike the other module integration tests, it does not call cleanupModuleResources(t), leaving module resources that can affect later tests.

  • - Why: The adapter reports shared integration-test resources may remain and affect later tests.
    - Remediation: Call deleteDashboard(t) and then cleanupModuleResources(t) in the cleanup callback, following the other module integration tests.

    Low (4)

  • Style conventions · code-organization (dashboard-operator/charts/dashboard/templates/_helpers.tpl:67) · actionable follow-up: The newly added namespaceRoleName and namespaceRoleBindingName helpers are unused, and their output (-namespaced-role / -namespaced-rolebinding) does not match the scoped Secret Role names rendered in rbac.yaml. Remove them or make them scope-aware and use them for those resources.
  • Docs currency · incorrect-doc (docs/dashboard-operator.md:97) · actionable follow-up: The managementState: Removed description says labeled Roles and RoleBindings are deleted, but the controller now explicitly preserves its operator-owned Secret Role and RoleBinding resources during teardown, including the applications-namespace pair.

  • - Why: This makes the documented teardown behavior incorrect for the new operator-owned RBAC resources and can lead readers to expect those resources to be removed.
    - Remediation: Qualify the deletion list to note that operator-owned Secret Roles and RoleBindings are preserved during teardown.

  • Docs currency · incomplete-doc (manifests/modules/README.md:46) · actionable follow-up: The module layout describes each module's cluster-role.yaml as its least-privilege RBAC, but this PR removes Secret permissions from the notebooks, gen-ai, and autorag runtime ClusterRoles and provisions those permissions separately through installer-owned RBAC.

  • - Why: Readers using the module manifests may not realize that the module Secret permissions are no longer included in the per-module ClusterRole or package.
    - Remediation: Document that the installer provisions the separate Secret ClusterRoles and bindings for these modules, and clarify which permissions remain in each runtime ClusterRole.

  • Docs currency · missing-doc (docs/dashboard-operator.md:696) · actionable follow-up: The Helm deployment documentation does not describe the new notebooksNamespace and modelRegistryNamespace chart values, which control whether the chart installs operator Secret Roles and RoleBindings in those target namespaces.

  • - Remediation: Document the new chart values and explain when to set them, distinguishing them from the similarly named Dashboard CR fields.

    Justified (1)

    _These findings were raised by review producers but the PR's Justifications were accepted as sufficient for this run. They do not block disposition. A human reviewer may still disagree._

  • Security · permission-expansion (dashboard-operator/charts/dashboard/templates/module-secret-rbac.yaml:19) · _Info_: The new Helm and Kustomize module bindings are installed independently of module enablement and remain after runtime module RBAC is removed. Verified subjects are the notebooks, gen-ai, and autorag service accounts in the installation namespace. Notebooks receives cluster-wide Secret CRUD/list without watch; gen-ai receives unrestricted Secret create plus name-restricted reads/updates/deletes; autorag receives get on Secrets named router-ca. The grants preserve enabled-module capabilities, but their lifetime now extends beyond module enablement. The PR explicitly justifies this installer ownership; the bindings are dormant, not absent, when their service accounts do not exist.

  • - Justification: Claim: the notebooks, gen-ai and autorag service accounts deliberately keep cross-namespace Secret access, now through installer-owned ClusterRoles and ClusterRoleBindings that do nothing until each module's service account exists. Diff fact: module-secret-rbac.yaml depends only on rbac.create, not module enablement. It binds the odh-dashboard-notebooks, gen-ai and autorag service accounts to rules that match the Secret rules removed from manifests/modules//cluster-role.yaml.

    Product ask

    Status: aligned · RHOAIENG-98916

    Aligned:

  • The PR states it removes Secret permissions from the operator ClusterRole and installs namespaced Roles and RoleBindings in the applications, notebooks, and model-registry namespaces, directly matching the ticket's Secret-access narrowing.

  • The PR describes preserving intended functionality through installer-owned module Secret grants and verifying operator reconciliation under reduced permissions. Retaining module access does not contradict the ticket's restriction on the operator's own access.

  • The ticket also calls for narrowing other namespaced resources and coordinating cache scoping; the PR's Secret-focused scope is an aligned subset, not a conflicting product direction.
  • TODO

    Findings

  • dashboard-operator/charts/dashboard/templates/rbac.yaml:706 — Coordinate and gate the installer migration so these values are populated from the same namespace source as the Dashboard CR before removing the existing grant, including subsequent target changes. Add a compatibility test covering the installer-rendered RBAC and the actual Dashboard target configuration.

  • dashboard-operator/config/default/kustomization.yaml:28 — Move the notebooks and model-registry RBAC replacements into a shared wiring kustomization, and add that wiring under transformers in both config/default and config/webhook-enabled while retaining their existing replacements for direct installs. Update the parent-overlay workflow to instruct parent overlays to include the wiring in their own transformers, so the replacements run after the parent namespace transform and preserve the namespaces specified by the annotations.

  • dashboard-operator/config/rbac/module-secret-rbac.yaml:25 — Represent the applications namespace separately in installer configuration and use it for module Secret binding subjects and the applications Secret Role/RoleBinding location, while retaining the operator namespace for the operator service-account subject. Wire the Kustomize configuration to the APPLICATIONS_NAMESPACE override and cover unequal operator/applications namespaces in permission tests; preserve the autorag router-ca binding's existing access.

  • dashboard-operator/config/rbac/kustomization.yaml:7 — Make target-namespace RBAC opt-in through components or overlays, keeping the base installation limited to the applications namespace. Test installation with both optional integrations absent.

  • dashboard-operator/charts/dashboard/templates/rbac.yaml:705 — Coordinate and verify installer propagation of both Dashboard target namespaces into these chart values before removing the broad grant. Add an upgrade test covering an existing Dashboard with cross-namespace targets and the actual installer-rendered RBAC; make the new configuration prerequisite explicit.

  • dashboard-operator/internal/controller/namespaced_rbac_real_permissions_integration_test.go:206 — Call deleteDashboard(t) and then cleanupModuleResources(t) in the cleanup callback, following the other module integration tests.
  • Checks

  • Substantial automation covers operator scoping and teardown, but the evidence does not adequately protect the claimed preservation of module Secret access. Add exact rendered module policy/binding assertions or authorization tests using rendered installer resources and actual module identities.
  • Judgement

  • Have a human review installer namespace migration and deployment impact before approving this high-risk permission change.

  • Provide deployment-representative evidence covering Helm target values, Kustomize parent overlays, and module identities before approval.
  • Nits

  • dashboard-operator/charts/dashboard/templates/_helpers.tpl — The newly added namespaceRoleName and namespaceRoleBindingName helpers are unused, and their output (-namespaced-role / *-namespaced-rolebinding) does not match the scoped Secret Role names rendered in rbac.yaml. Remove them or make them scope-aware and use them for those resources.

  • docs/dashboard-operator.md — The managementState: Removed description says labeled Roles and RoleBindings are deleted, but the controller now explicitly preserves its operator-owned Secret Role and RoleBinding resources during teardown, including the applications-namespace pair.

  • manifests/modules/README.md — The module layout describes each module's cluster-role.yaml as its least-privilege RBAC, but this PR removes Secret permissions from the notebooks, gen-ai, and autorag runtime ClusterRoles and provisions those permissions separately through installer-owned RBAC.

  • docs/dashboard-operator.md — The Helm deployment documentation does not describe the new notebooksNamespace and modelRegistryNamespace chart values, which control whether the chart installs operator Secret Roles and RoleBindings in those target namespaces.
  • <details>
    <summary>🔍 <strong>Review details</strong> — 14 producer(s) ran, 1 skipped</summary>

    Producers

    | Producer | Type | Ran | Result |
    | --- | --- | --- | --- |
    | PR description | check | ✅ | pass — The description supplies substantive Problem, Solution, and Evidence content. |
    | Test impact | check | ✅ | fail — Substantial automation covers operator scoping and teardown, but the evidence does not adequately protect the claimed preservation of module Secret access. |
    | Investigator | context | ✅ | Context available. |
    | Jira | context | ✅ | Context available. |
    | CodeRabbit | findings | ✅ | 3 findings: coderabbit |
    | Correctness | findings | ✅ | 3 findings: api-contract, edge-case |
    | Cross-repo contracts | findings | ✅ | No findings. |
    | Docs currency | findings | ✅ | 3 findings: incorrect-doc, incomplete-doc, missing-doc |
    | Intent coherence | findings | ✅ | No findings. |
    | RBAC | findings | ✅ | 1 finding: namespace-scope |
    | Security | findings | ✅ | 3 findings: permission-reduction, permission-expansion |
    | Style | findings | ➖ | No changed TSX, CSS or SCSS files; operator Go and RBAC manifests only. |
    | Style conventions | findings | ✅ | 1 finding: code-organization |
    | Product ask | section | ✅ | product_ask aligned |
    | Rating | signal | ✅ | risk critical · confidence low |

    Challenger

    Adjudicated 14 findings; kept 7 (removed 2, justified 1, merged 2, downgraded 2).

    <details>
    <summary>Removed findings (audit only)</summary>

    Audit only — ignore for disposition. These findings were removed or merged by the challenger. Agents and humans must not treat them as actionable review findings; use findings[] / ## Findings instead.

  • Correctness · api-contract (dashboard-operator/config/default/kustomization.yaml:28): The target-namespace replacements run inside config/default; the equivalent replacements in config/webhook-enabled have the same composition problem. When either is wrapped by the supported parent overlay with namespace: my-ns, the parent's namespace transformer overwrites the already-replaced metadata.namespace fields on the target Roles and RoleBindings. Consequently, the notebook and model-registry Secret grants land in my-ns instead of their target namespaces. The existing certificate/webhook wiring transformers do not restore these new RBAC destinations. See also: [coderabbit] finding at this location.

  • - Why: Custom-namespace installations lose the target Secret permissions required by reconcileNamespacedRBAC, so creating or repairing the Dashboard's cross-namespace Roles is rejected as privilege escalation.
    - Removal reason: Merged into coderabbit at dashboard-operator/config/default/kustomization.yaml:28

  • RBAC · namespace-scope (dashboard-operator/config/rbac/module-secret-rbac.yaml:25): The installer-owned Secret bindings target module service accounts in the operator installation namespace, not the configured applications namespace. The supported APPLICATIONS_NAMESPACE override can differ from OPERATOR_NAMESPACE (cmd/manager/main.go), and module_deploy.go renders module service accounts into r.ApplicationsNamespace. Previously their runtime-rendered ClusterRoleBindings followed that namespace; after removing Secret permissions from the runtime ClusterRoles, all three modules lose their Secret grants in split-namespace installations. The new applications Secret Role likewise stays in the installation namespace. The Helm equivalents also use dashboard.namespace for both purposes. See also: [coderabbit] finding at this location.

  • - Why: With separate operator and operand namespaces, the real notebooks, gen-ai, and autorag service accounts receive 403 responses for Secret operations, breaking notebook credential management, pgvector provisioning, and router-CA reads. The operator also lacks its intended Secret access in the actual applications namespace.
    - Removal reason: Merged into coderabbit at dashboard-operator/config/rbac/module-secret-rbac.yaml:25

    </details>

    Evidence inspected

    Reviewed the 22-file, 1,201-line PR diff through specialized findings, product-alignment, and readiness producers, then adjudicated findings against PR-head source. No changed path matches the configured protected prefixes.

    Could not verify:

  • The prior-review comparison returned diverged, so a precise prior-to-head delta and unchanged-code severity anchoring were unavailable. This run used the full PR diff and normal dispatch.

  • The investigation brief is partial because its exploration budget was exhausted; reviewers received the full diff independently.

  • No independent test or cluster execution was performed by this static review; named test and lint commands in the PR description are author-reported evidence.
  • Signals

    +1151 / −50 · 22 files

    </details>

    fullsend-ai-review[bot] fullsend-ai-review[bot] commented on Nov 27, 2026 01:00 UTC
    Reviewer

    See the review comment for full details.

    lucferbux lucferbux commented on code on Nov 27, 2026 10:57 UTC
    Code Review
    dashboard-operator/internal/controller/namespaced_rbac.go:1
    @@ -41,128 +46,588 @@ func dashboardSAName(platform cluster.Platform) string {
     // for the dashboard SA in the notebooks and model-registry namespaces, then GCs
     // any resources left over in namespaces that are no longer in the desired set.
     func (r *DashboardReconciler) reconcileNamespacedRBAC(ctx context.Context, dashboard *v1alpha1.Dashboard) error {
    +	enforceConsent, err := r.ensureNamespacedRBACConsentEnforced(ctx, dashboard)
    +	if err != nil {
    +		return err
    +	}
    +	if err := r.ensureNamespacedRBACGrantInventory(ctx, dashboard); err != nil {
    +		return err
    +	}
    +	if enforceConsent && !r.NamespacedRBACWebhookEnabled {
    +		cleanupErr := r.gcStaleNamespacedRBAC(ctx, dashboard, map[string]bool{})
    +		return errors.Join(
    +			fmt.Errorf("namespaced RBAC consent was enforced previously, but the validating webhook is disabled"),
    +			cleanupErr,
    +		)
    +	}
    +
     	saName := dashboardSAName(r.Platform)
     	saNamespace := r.ApplicationsNamespace
     
     	desired := map[string]bool{}
    +	var errs []error
     
     	if ns := dashboard.Spec.NotebooksNamespace; ns != "" {
    -		if err := r.applyNamespacedRBAC(ctx, saName, saNamespace, ns, "notebooks", notebooksRBACRules()); err != nil {
    -			return fmt.Errorf("notebooks namespace RBAC in %s: %w", ns, err)
    +		if err := r.reconcileNamespacedRBACGrant(ctx, dashboard, desired, enforceConsent, saName, saNamespace, ns, "notebooks", notebooksRBACRules()); err != nil {
    +			errs = append(errs, fmt.Errorf("notebooks namespace RBAC in %s: %w", ns, err))
     		}
    -		desired[namespacedRBACKey(ns, "notebooks")] = true
     	}
     
     	if ns := dashboard.Spec.ModelRegistryNamespace; ns != "" {
    -		if err := r.applyNamespacedRBAC(ctx, saName, saNamespace, ns, "model-registry", modelRegistryRBACRules()); err != nil {
    -			return fmt.Errorf("model-registry namespace RBAC in %s: %w", ns, err)
    +		if err := r.reconcileNamespacedRBACGrant(ctx, dashboard, desired, enforceConsent, saName, saNamespace, ns, "model-registry", modelRegistryRBACRules()); err != nil {
    +			errs = append(errs, fmt.Errorf("model-registry namespace RBAC in %s: %w", ns, err))
    +		}
    +	}
    +
    +	// Invalid targets are deliberately absent from desired. Run GC even when
    +	// validation or apply failed so removing opt-in immediately revokes stale grants.
    +	if err := r.gcStaleNamespacedRBAC(ctx, dashboard, desired); err != nil {
    +		errs = append(errs, err)
    +	}
    +
    +	return errors.Join(errs...)
    +}
    +
    +func (r *DashboardReconciler) reconcileNamespacedRBACGrant(
    +	ctx context.Context,
    +	dashboard *v1alpha1.Dashboard,
    +	desired map[string]bool,
    +	enforceConsent bool,
    +	saName, saNamespace, namespace, suffix string,
    +	rules []rbacv1.PolicyRule,
    +) error {
    +	key := namespacedRBACKey(namespace, suffix)
    +	if enforceConsent {
    +		if err := r.validateNamespacedRBACTarget(ctx, namespace); err != nil {
    +			// Only an authoritative revocation signal (the Namespace is gone or
    +			// consent is absent) may remove an existing grant. Preserve it across
    +			// transient API failures so a timeout or throttling response cannot
    +			// revoke otherwise valid access.
    +			if !k8serrors.IsNotFound(err) && !errors.Is(err, errNamespacedRBACConsentMissing) {
    +				desired[key] = true
    +			}
    +			return err
     		}
    -		desired[namespacedRBACKey(ns, "model-registry")] = true
     	}
     
    -	return r.gcStaleNamespacedRBAC(ctx, desired)
    +	desired[key] = true
    +	if err := r.recordNamespacedRBACGrant(ctx, dashboard, key); err != nil {
    +		return fmt.Errorf("recording grant: %w", err)
    +	}
    +	return r.applyNamespacedRBAC(ctx, saName, saNamespace, namespace, suffix, rules)

    This Role grants secrets, but the operator no longer holds them in this namespace and has no escalate, so create and repair will fail with Forbidden. The installer should provision a Secret Role for the operator here.

    lucferbux lucferbux commented on code on Nov 27, 2026 10:57 UTC
    Code Review
    dashboard-operator/charts/dashboard/templates/module-rbac.yaml:1
    @@ -0,0 +1,302 @@
    +{{- if .Values.rbac.create }}
    +---
    +kind: ClusterRole
    +apiVersion: rbac.authorization.k8s.io/v1
    +metadata:
    +  name: odh-dashboard-notebooks
    +rules:
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - get
    +      - list
    +      - watch
    +    resources:
    +      - namespaces
    +      - configmaps
    +      - pods
    +      - persistentvolumes
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - get
    +      - list
    +      - watch
    +      - create
    +      - update
    +      - patch
    +      - delete
    +    resources:
    +      - secrets
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - get
    +      - list
    +      - watch
    +      - create
    +      - delete
    +    resources:
    +      - persistentvolumeclaims
    +  - apiGroups:
    +      - storage.k8s.io
    +    verbs:
    +      - get
    +      - list
    +      - watch
    +    resources:
    +      - storageclasses
    +  - apiGroups:
    +      - kubeflow.org
    +    verbs:
    +      - get
    +      - list
    +      - watch
    +      - create
    +      - update
    +      - patch
    +      - delete
    +    resources:
    +      - workspaces
    +      - workspacekinds
    +  - apiGroups:
    +      - authorization.k8s.io
    +    verbs:
    +      - create
    +    resources:
    +      - subjectaccessreviews
    +  - apiGroups:
    +      - authentication.k8s.io
    +    verbs:
    +      - create
    +    resources:
    +      - tokenreviews
    +  # Read the cluster-wide TLS security profile (apiservers.config.openshift.io/cluster)
    +  # so the notebooks BFF can enforce it on its HTTPS listener and reload on change.
    +  # Keep get scoped to the singleton: the chart installs this role, so the grant
    +  # remains limited to the public TLS security profile.
    +  # Unlike the polling BFFs, the notebooks backend watches the
    +  # profile through an informer, which needs list/watch; those must omit resourceNames.
    +  - apiGroups:
    +      - config.openshift.io
    +    resources:
    +      - apiservers
    +    resourceNames:
    +      - cluster
    +    verbs:
    +      - get
    +  - apiGroups:
    +      - config.openshift.io
    +    resources:
    +      - apiservers
    +    verbs:
    +      - list
    +      - watch
    +---
    +kind: ClusterRoleBinding

    This binds whenever rbac.create is true, so notebooks keeps cluster-wide Secret CRUD while disabled. Can we gate it on the module?

    lucferbux lucferbux commented on code on Nov 27, 2026 10:57 UTC
    Code Review
    manifests/modules/gen-ai/kustomization.yaml:1
    @@ -2,8 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
     kind: Kustomization
     resources:

    Kustomize installs don't render the chart, so this module ends up with no grants. Can we keep installer-owned RBAC in the Kustomize path?

    lucferbux lucferbux commented on code on Nov 27, 2026 10:57 UTC
    Code Review
    dashboard-operator/config/rbac/namespaced_role.yaml:1
    @@ -0,0 +1,19 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: Role
    +metadata:
    +  name: dashboard-operator-namespaced-role
    +  namespace: system
    +rules:
    +  # The controller manages Secrets only in its applications namespace. It does

    Should this live in the applications namespace? APPLICATIONS_NAMESPACE can differ from the operator namespace.

    lucferbux lucferbux commented on code on Nov 27, 2026 10:57 UTC
    Code Review
    dashboard-operator/config/webhook/webhook.yaml:1
    @@ -20,8 +20,54 @@ webhooks:
               - v1alpha1
             operations:
               - CREATE
    +          - UPDATE
             resources:
               - dashboards
    +      - apiGroups:
    +          - ""
    +        apiVersions:
    +          - v1
    +        operations:
    +          - CREATE
    +          - UPDATE
    +          - DELETE
    +        resources:
    +          - configmaps

    Fail-closed on ConfigMaps and Namespaces cluster-wide is its own security change. Can we move it to a separate PR?

    lucferbux lucferbux requested changes on Nov 27, 2026 10:57 UTC
    Changes Requested Reviewer

    I like the direction, but I can't take this one yet. Once the cluster-wide Secret grant is gone, the operator can't create the notebooks and model-registry Roles because they carry Secret verbs it no longer holds, and the ticket asks for operator Roles in those namespaces too. The module bindings also apply now even when a module is disabled, and Kustomize installs lose them. Could you split the consent webhook into its own PR and add an envtest that reconciles under the operator's real permissions?

    fullsend-ai-review[bot] fullsend-ai-review[bot] commented on Nov 27, 2026 11:29 UTC
    Bot

    <!-- fullsend:agent-status:45990741552 -->
    <!-- fullsend:status:terminal -->
    🤖 Finished Review · ✅ Success · Started 11:29 AM UTC · Completed 11:52 AM UTC

    Commit: f8507a3 · View workflow run →

    Runtime: pi · Model: openai/gpt-6.1-sol → gpt-6.1-sol · Effort: high · Cost: $2.91

    liday-rh liday-rh commented on code on Nov 27, 2026 11:39 UTC
    Code Review
    dashboard-operator/internal/controller/namespaced_rbac.go:1
    @@ -41,128 +46,588 @@ func dashboardSAName(platform cluster.Platform) string {
     // for the dashboard SA in the notebooks and model-registry namespaces, then GCs
     // any resources left over in namespaces that are no longer in the desired set.
     func (r *DashboardReconciler) reconcileNamespacedRBAC(ctx context.Context, dashboard *v1alpha1.Dashboard) error {
    +	enforceConsent, err := r.ensureNamespacedRBACConsentEnforced(ctx, dashboard)
    +	if err != nil {
    +		return err
    +	}
    +	if err := r.ensureNamespacedRBACGrantInventory(ctx, dashboard); err != nil {
    +		return err
    +	}
    +	if enforceConsent && !r.NamespacedRBACWebhookEnabled {
    +		cleanupErr := r.gcStaleNamespacedRBAC(ctx, dashboard, map[string]bool{})
    +		return errors.Join(
    +			fmt.Errorf("namespaced RBAC consent was enforced previously, but the validating webhook is disabled"),
    +			cleanupErr,
    +		)
    +	}
    +
     	saName := dashboardSAName(r.Platform)
     	saNamespace := r.ApplicationsNamespace
     
     	desired := map[string]bool{}
    +	var errs []error
     
     	if ns := dashboard.Spec.NotebooksNamespace; ns != "" {
    -		if err := r.applyNamespacedRBAC(ctx, saName, saNamespace, ns, "notebooks", notebooksRBACRules()); err != nil {
    -			return fmt.Errorf("notebooks namespace RBAC in %s: %w", ns, err)
    +		if err := r.reconcileNamespacedRBACGrant(ctx, dashboard, desired, enforceConsent, saName, saNamespace, ns, "notebooks", notebooksRBACRules()); err != nil {
    +			errs = append(errs, fmt.Errorf("notebooks namespace RBAC in %s: %w", ns, err))
     		}
    -		desired[namespacedRBACKey(ns, "notebooks")] = true
     	}
     
     	if ns := dashboard.Spec.ModelRegistryNamespace; ns != "" {
    -		if err := r.applyNamespacedRBAC(ctx, saName, saNamespace, ns, "model-registry", modelRegistryRBACRules()); err != nil {
    -			return fmt.Errorf("model-registry namespace RBAC in %s: %w", ns, err)
    +		if err := r.reconcileNamespacedRBACGrant(ctx, dashboard, desired, enforceConsent, saName, saNamespace, ns, "model-registry", modelRegistryRBACRules()); err != nil {
    +			errs = append(errs, fmt.Errorf("model-registry namespace RBAC in %s: %w", ns, err))
    +		}
    +	}
    +
    +	// Invalid targets are deliberately absent from desired. Run GC even when
    +	// validation or apply failed so removing opt-in immediately revokes stale grants.
    +	if err := r.gcStaleNamespacedRBAC(ctx, dashboard, desired); err != nil {
    +		errs = append(errs, err)
    +	}
    +
    +	return errors.Join(errs...)
    +}
    +
    +func (r *DashboardReconciler) reconcileNamespacedRBACGrant(
    +	ctx context.Context,
    +	dashboard *v1alpha1.Dashboard,
    +	desired map[string]bool,
    +	enforceConsent bool,
    +	saName, saNamespace, namespace, suffix string,
    +	rules []rbacv1.PolicyRule,
    +) error {
    +	key := namespacedRBACKey(namespace, suffix)
    +	if enforceConsent {
    +		if err := r.validateNamespacedRBACTarget(ctx, namespace); err != nil {
    +			// Only an authoritative revocation signal (the Namespace is gone or
    +			// consent is absent) may remove an existing grant. Preserve it across
    +			// transient API failures so a timeout or throttling response cannot
    +			// revoke otherwise valid access.
    +			if !k8serrors.IsNotFound(err) && !errors.Is(err, errNamespacedRBACConsentMissing) {
    +				desired[key] = true
    +			}
    +			return err
     		}
    -		desired[namespacedRBACKey(ns, "model-registry")] = true
     	}
     
    -	return r.gcStaleNamespacedRBAC(ctx, desired)
    +	desired[key] = true
    +	if err := r.recordNamespacedRBACGrant(ctx, dashboard, key); err != nil {
    +		return fmt.Errorf("recording grant: %w", err)
    +	}
    +	return r.applyNamespacedRBAC(ctx, saName, saNamespace, namespace, suffix, rules)

    Fixed in f8507a3a. The chart now pre-provisions narrowly scoped operator Secret Roles in the applications namespace and the optional notebooks/model-registry target namespaces, and module Secret permissions were moved from ClusterRoles to namespaced module Roles. TestIntegration_NamespacedRBACUnderOperatorPermissions now reconciles the grants while impersonating the operator under the real narrowed RBAC.

    liday-rh liday-rh commented on code on Nov 27, 2026 11:39 UTC
    Code Review
    dashboard-operator/charts/dashboard/templates/module-rbac.yaml:1
    @@ -0,0 +1,302 @@
    +{{- if .Values.rbac.create }}
    +---
    +kind: ClusterRole
    +apiVersion: rbac.authorization.k8s.io/v1
    +metadata:
    +  name: odh-dashboard-notebooks
    +rules:
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - get
    +      - list
    +      - watch
    +    resources:
    +      - namespaces
    +      - configmaps
    +      - pods
    +      - persistentvolumes
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - get
    +      - list
    +      - watch
    +      - create
    +      - update
    +      - patch
    +      - delete
    +    resources:
    +      - secrets
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - get
    +      - list
    +      - watch
    +      - create
    +      - delete
    +    resources:
    +      - persistentvolumeclaims
    +  - apiGroups:
    +      - storage.k8s.io
    +    verbs:
    +      - get
    +      - list
    +      - watch
    +    resources:
    +      - storageclasses
    +  - apiGroups:
    +      - kubeflow.org
    +    verbs:
    +      - get
    +      - list
    +      - watch
    +      - create
    +      - update
    +      - patch
    +      - delete
    +    resources:
    +      - workspaces
    +      - workspacekinds
    +  - apiGroups:
    +      - authorization.k8s.io
    +    verbs:
    +      - create
    +    resources:
    +      - subjectaccessreviews
    +  - apiGroups:
    +      - authentication.k8s.io
    +    verbs:
    +      - create
    +    resources:
    +      - tokenreviews
    +  # Read the cluster-wide TLS security profile (apiservers.config.openshift.io/cluster)
    +  # so the notebooks BFF can enforce it on its HTTPS listener and reload on change.
    +  # Keep get scoped to the singleton: the chart installs this role, so the grant
    +  # remains limited to the public TLS security profile.
    +  # Unlike the polling BFFs, the notebooks backend watches the
    +  # profile through an informer, which needs list/watch; those must omit resourceNames.
    +  - apiGroups:
    +      - config.openshift.io
    +    resources:
    +      - apiservers
    +    resourceNames:
    +      - cluster
    +    verbs:
    +      - get
    +  - apiGroups:
    +      - config.openshift.io
    +    resources:
    +      - apiservers
    +    verbs:
    +      - list
    +      - watch
    +---
    +kind: ClusterRoleBinding

    Fixed in f8507a3a. The chart-owned module RBAC was removed. Secret grants now live with each module manifest as namespaced secret-rbac.yaml resources, so they are applied only when that module is enabled.

    liday-rh liday-rh commented on code on Nov 27, 2026 11:39 UTC
    Code Review
    manifests/modules/gen-ai/kustomization.yaml:1
    @@ -2,8 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
     kind: Kustomization
     resources:

    Fixed in f8507a3a. Module RBAC remains in the Kustomize module manifests. The notebooks, gen-ai, and autorag Secret grants are now namespaced secret-rbac.yaml resources included by each module kustomization, while the chart adds only the operator’s own namespaced Secret Role.

    liday-rh liday-rh commented on code on Nov 27, 2026 11:39 UTC
    Code Review
    dashboard-operator/config/rbac/namespaced_role.yaml:1
    @@ -0,0 +1,19 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: Role
    +metadata:
    +  name: dashboard-operator-namespaced-role
    +  namespace: system
    +rules:
    +  # The controller manages Secrets only in its applications namespace. It does

    Yes. In the Helm chart the Role uses dashboard.namespace, which is the applications namespace, not the controller pod namespace. In Kustomize, the overlay namespace transformer places the base Role in the configured applications namespace. The chart also accepts notebooksNamespace and modelRegistryNamespace to pre-provision operator Secret Roles in the target namespaces.

    liday-rh liday-rh commented on code on Nov 27, 2026 11:39 UTC
    Code Review
    dashboard-operator/config/webhook/webhook.yaml:1
    @@ -20,8 +20,54 @@ webhooks:
               - v1alpha1
             operations:
               - CREATE
    +          - UPDATE
             resources:
               - dashboards
    +      - apiGroups:
    +          - ""
    +        apiVersions:
    +          - v1
    +        operations:
    +          - CREATE
    +          - UPDATE
    +          - DELETE
    +        resources:
    +          - configmaps

    Done. The consent-webhook work was already split into and merged as #10716 (da7145a4). This PR has been rebased onto current main; its diff now contains only the RHOAIENG-98916 Secret-RBAC narrowing and does not modify the webhook or its ConfigMap/Namespace match conditions.

    fullsend-ai-review[bot] fullsend-ai-review[bot] commented on Nov 27, 2026 11:52 UTC
    Reviewer

    See the review comment for full details.

    codecov[bot] codecov[bot] commented on Nov 27, 2026 11:54 UTC
    Bot

    Codecov Report


    :white_check_mark: All modified and coverable lines are covered by tests.
    :white_check_mark: Project coverage is 66.42%. Comparing base (352f67f) to head (dfff1cf).
    :warning: Report is 4 commits behind head on main.

    <details><summary>Additional details and impacted files</summary>

    ![Impacted file tree graph](https://app.codecov.io/gh/opendatahub-io/odh-dashboard/pull/10887?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opendatahub-io)

    @@            Coverage Diff             @@
    ##             main   #10887      +/-   ##
    ==========================================
    - Coverage   66.44%   66.42%   -0.02%     
    ==========================================
      Files        3853     3853              
      Lines      125852   125842      -10     
      Branches    37890    37887       -3     
    ==========================================
    - Hits        83623    83594      -29     
    - Misses      42229    42248      +19     
    

    | Flag | Coverage Δ | |
    |---|---|---|
    | unit | 47.13% <ø> (ø) | |

    Flags with carried forward coverage won't be shown. Click here to find out more.
    see 16 files with indirect coverage changes

    ------

    Continue to review full report in Codecov by Harness.

    Legend - Click here to learn more

    Δ = absolute <relative> (impact), ø = not affected, ? = missing data

    Powered by Codecov. Last update 352f67f...dfff1cf. Read the comment docs.

    </details>
    <details><summary> :rocket: New features to boost your workflow: </summary>

  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

  • </details>

    lucferbux lucferbux commented on code on Nov 27, 2026 17:42 UTC
    Code Review
    manifests/modules/notebooks/secret-rbac.yaml:1
    @@ -0,0 +1,29 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: Role
    +metadata:
    +  name: odh-dashboard-notebooks-secrets
    +rules:
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - get
    +      - list
    +      - watch

    This blocks the notebooks module from deploying. The operator Secret Roles don't hold watch and the operator has no escalate, so the apiserver rejects this Role. The notebooks backend doesn't cache Secrets, so I think we can just drop watch.

    lucferbux lucferbux commented on code on Nov 27, 2026 17:42 UTC
    Code Review
    manifests/modules/notebooks/secret-rbac.yaml:1
    @@ -0,0 +1,29 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: Role
    +metadata:
    +  name: odh-dashboard-notebooks-secrets
    +rules:
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - get
    +      - list
    +      - watch
    +      - create
    +      - update
    +      - patch
    +      - delete
    +    resources:

    The notebooks backend lists, gets and creates Secrets with its own SA in the user's project (repositories/secrets/repo.go, helper/validation.go). With the grant only in the applications or notebooks namespace, the secrets API and workspace secret validation return Forbidden for every user project. We need a real cross namespace story here (consent gated per project grants or user scoped clients).

    lucferbux lucferbux commented on code on Nov 27, 2026 17:42 UTC
    Code Review
    manifests/modules/autorag/secret-rbac.yaml:1
    @@ -0,0 +1,25 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: Role
    +metadata:
    +  name: odh-dashboard-autorag-secrets
    +rules:
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - get
    +    resources:
    +      - secrets
    +    resourceNames:
    +      - router-ca

    router-ca lives in openshift-ingress-operator, but this Role has no namespace so it ends up in the applications namespace. Router CA sync will be Forbidden. Same thing in the gen-ai Role.

    lucferbux lucferbux commented on code on Nov 27, 2026 17:42 UTC
    Code Review
    manifests/modules/gen-ai/secret-rbac.yaml:1
    @@ -0,0 +1,44 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: Role
    +metadata:
    +  name: odh-dashboard-gen-ai-secrets
    +rules:
    +  - apiGroups:
    +      - ""
    +    resources:
    +      - secrets
    +    resourceNames:
    +      - router-ca
    +    verbs:
    +      - get
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - create
    +    resources:

    EnsurePostgres runs with the SA client in the user's project, so pgvector provisioning breaks anywhere outside the applications namespace with this scoping.

    lucferbux lucferbux commented on code on Nov 27, 2026 17:42 UTC
    Code Review
    dashboard-operator/internal/controller/module_deploy.go:1
    @@ -165,6 +165,7 @@ func (r *DashboardReconciler) deployModuleManifests(
     			return fmt.Errorf("failed to render manifests for module %s: %w", name, err)
     		}
     		remapRayDashboardGatewayRBAC(rendered)
    +		remapNotebooksSecretRBAC(rendered, dashboard.Spec.NotebooksNamespace)

    This remaps the notebooks Secret Role into notebooksNamespace without the consent label check, without inventory and without cleanup when the namespace changes. Also deleteModuleResources only deletes ClusterRoles and ClusterRoleBindings, so disabling notebooks, gen-ai or autorag leaves the *-secrets Roles and bindings in place. Before this PR the grant went away with the ClusterRole.

    lucferbux lucferbux commented on code on Nov 27, 2026 17:42 UTC
    Code Review
    dashboard-operator/internal/controller/namespaced_rbac_real_permissions_integration_test.go:1
    @@ -0,0 +1,186 @@
    +//go:build integration
    +
    +package controller_test
    +
    +import (
    +	"context"
    +	"os"
    +	"path/filepath"
    +	"testing"
    +
    +	"github.com/stretchr/testify/assert"
    +	"github.com/stretchr/testify/require"
    +	corev1 "k8s.io/api/core/v1"
    +	rbacv1 "k8s.io/api/rbac/v1"
    +	apierrors "k8s.io/apimachinery/pkg/api/errors"
    +	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    +	"k8s.io/apimachinery/pkg/types"
    +	"k8s.io/client-go/rest"
    +	"sigs.k8s.io/controller-runtime/pkg/client"
    +	"sigs.k8s.io/yaml"
    +
    +	"github.com/opendatahub-io/odh-platform-utilities/api/common"
    +
    +	v1alpha1 "github.com/opendatahub-io/odh-dashboard/dashboard-operator/api/v1alpha1"
    +)
    +
    +func TestIntegration_NamespacedRBACUnderOperatorPermissions(t *testing.T) {
    +	ctx := context.Background()
    +	admin := newIsolatedClient(t)
    +
    +	notebooksNS := "real-rbac-notebooks"
    +	modelRegistryNS := "real-rbac-model-registry"
    +	unrelatedNS := "real-rbac-unrelated"
    +	for _, namespace := range []string{notebooksNS, modelRegistryNS, unrelatedNS} {
    +		ns := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: namespace}}
    +		require.NoError(t, admin.Create(ctx, ns))
    +		t.Cleanup(func() { deleteIgnoreNotFound(t, ns) })
    +	}
    +	// Only the two target namespaces opt in to namespaced RBAC.
    +	for _, namespace := range []string{notebooksNS, modelRegistryNS} {
    +		target := &corev1.Namespace{}
    +		require.NoError(t, admin.Get(ctx, types.NamespacedName{Name: namespace}, target))
    +		if target.Labels == nil {
    +			target.Labels = map[string]string{}
    +		}
    +		target.Labels[v1alpha1.NamespacedRBACOptInLabel] = "true"
    +		require.NoError(t, admin.Update(ctx, target))
    +	}
    +
    +	operatorSA := &corev1.ServiceAccount{ObjectMeta: metav1.ObjectMeta{
    +		Name:      "real-rbac-operator",
    +		Namespace: integrationNamespace,
    +	}}
    +	require.NoError(t, admin.Create(ctx, operatorSA))
    +	t.Cleanup(func() { deleteIgnoreNotFound(t, operatorSA) })
    +
    +	// Load the real operator ClusterRole and remove only its Secret grant. This
    +	// mirrors the chart after RHOAIENG-98916 without granting test-only access.
    +	roleData, err := os.ReadFile(filepath.Join("..", "..", "config", "rbac", "role.yaml"))
    +	require.NoError(t, err)
    +	clusterRole := &rbacv1.ClusterRole{}
    +	require.NoError(t, yaml.Unmarshal(roleData, clusterRole))
    +	clusterRole.Name = "real-rbac-operator-role"
    +	for i := range clusterRole.Rules {
    +		resources := make([]string, 0, len(clusterRole.Rules[i].Resources))
    +		for _, resource := range clusterRole.Rules[i].Resources {
    +			if resource != "secrets" {
    +				resources = append(resources, resource)
    +			}
    +		}
    +		clusterRole.Rules[i].Resources = resources
    +	}
    +	require.NoError(t, admin.Create(ctx, clusterRole))
    +	t.Cleanup(func() { deleteIgnoreNotFound(t, clusterRole) })
    +
    +	clusterBinding := &rbacv1.ClusterRoleBinding{
    +		ObjectMeta: metav1.ObjectMeta{Name: "real-rbac-operator-rolebinding"},
    +		RoleRef:    rbacv1.RoleRef{APIGroup: rbacv1.GroupName, Kind: "ClusterRole", Name: clusterRole.Name},
    +		Subjects: []rbacv1.Subject{{
    +			Kind:      "ServiceAccount",
    +			Name:      operatorSA.Name,
    +			Namespace: operatorSA.Namespace,
    +		}},
    +	}
    +	require.NoError(t, admin.Create(ctx, clusterBinding))
    +	t.Cleanup(func() { deleteIgnoreNotFound(t, clusterBinding) })
    +
    +	// Pre-provision the operator's Secret Role in the applications namespace and
    +	// both target namespaces, exactly as the installer does in production.
    +	for _, namespace := range []string{integrationNamespace, notebooksNS, modelRegistryNS} {
    +		role := &rbacv1.Role{
    +			ObjectMeta: metav1.ObjectMeta{Name: "real-rbac-operator-secrets", Namespace: namespace},
    +			Rules: []rbacv1.PolicyRule{{
    +				APIGroups: []string{""},
    +				Resources: []string{"secrets"},
    +				Verbs:     []string{"get", "list", "create", "update", "patch", "delete"},
    +			}},
    +		}
    +		binding := &rbacv1.RoleBinding{
    +			ObjectMeta: metav1.ObjectMeta{Name: "real-rbac-operator-secrets", Namespace: namespace},
    +			RoleRef:    rbacv1.RoleRef{APIGroup: rbacv1.GroupName, Kind: "Role", Name: role.Name},
    +			Subjects: []rbacv1.Subject{{
    +				Kind:      "ServiceAccount",
    +				Name:      operatorSA.Name,
    +				Namespace: operatorSA.Namespace,
    +			}},
    +		}
    +		require.NoError(t, admin.Create(ctx, role))
    +		require.NoError(t, admin.Create(ctx, binding))
    +		t.Cleanup(func() {
    +			deleteIgnoreNotFound(t, role)
    +			deleteIgnoreNotFound(t, binding)
    +		})
    +	}
    +
    +	cfg := rest.CopyConfig(restCfg)
    +	cfg.Impersonate = rest.ImpersonationConfig{
    +		UserName: "system:serviceaccount:" + integrationNamespace + ":" + operatorSA.Name,
    +		Groups:   []string{"system:serviceaccounts", "system:serviceaccounts:" + integrationNamespace, "system:authenticated"},
    +	}
    +	restricted, err := client.New(cfg, client.Options{Scheme: admin.Scheme()})
    +	require.NoError(t, err)
    +
    +	// The restricted operator can manage Secrets only in its intended namespaces.
    +	for _, namespace := range []string{integrationNamespace, notebooksNS, modelRegistryNS} {
    +		secret := &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "dry-run", Namespace: namespace}}
    +		require.NoError(t, restricted.Create(ctx, secret, client.DryRunAll), "namespace: %s", namespace)
    +	}
    +	unrelatedSecret := &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "denied", Namespace: unrelatedNS}}
    +	err = restricted.Create(ctx, unrelatedSecret, client.DryRunAll)
    +	assert.True(t, apierrors.IsForbidden(err), "expected unrelated namespace Secret creation to be forbidden, got %v", err)
    +
    +	dashboard := newDashboard(v1alpha1.DashboardSpec{
    +		ManagementSpec:         common.ManagementSpec{ManagementState: "Managed"},
    +		NotebooksNamespace:     notebooksNS,
    +		ModelRegistryNamespace: modelRegistryNS,
    +		Modules:                disableAllModulesExcept(),
    +	})
    +	require.NoError(t, restricted.Create(ctx, dashboard))
    +	t.Cleanup(func() { deleteDashboard(t) })
    +
    +	r := newReconcilerWithClient(restricted, createIntegrationManifests(t, nil))
    +	r.NamespacedRBACAdmissionEnabled = true

    This sets NamespacedRBACAdmissionEnabled = true and never restores the consent state ConfigMap, so the later suites fail with namespaced RBAC consent was enforced previously, but the validating webhook is disabled. That's the red Dashboard Operator Tests. Also disableAllModulesExcept() on L137 has no args, so no module RBAC is ever applied under the impersonated operator. Enabling notebooks, gen-ai and autorag here would have caught the watch issue.

    lucferbux lucferbux commented on code on Nov 27, 2026 17:42 UTC
    Code Review
    dashboard-operator/internal/controller/module_rbac_escalation_test.go:1
    @@ -41,6 +41,70 @@ func TestOperatorRoleCoversDeployedClusterRoles(t *testing.T) {
     	}
     }
     
    +func TestModuleSecretPermissionsAreNamespaced(t *testing.T) {

    This only checks that a secrets rule exists. The coverage check above runs on ClusterRoles only, so namespaced module Roles are never compared against the operator Role. Can we add that?

    lucferbux lucferbux commented on code on Nov 27, 2026 17:42 UTC
    Code Review
    dashboard-operator/charts/dashboard/templates/rbac.yaml:1
    @@ -703,6 +702,54 @@ rules:
           - update
           - delete
     
    +{{- $operatorSecretNamespaces := list .Values.namespace }}

    nit: no uniq on the namespace list, so notebooksNamespace == namespace renders the Role twice and Helm fails. I'd also use the dashboard.namespace helper instead of raw .Values.namespace. And the Kustomize path still has no operator Roles for the target namespaces.

    lucferbux lucferbux requested changes on Nov 27, 2026 17:42 UTC
    Changes Requested Reviewer

    Thanks for splitting the webhook out and reworking this, the direction is right. But the new module Roles don't work yet: notebooks can't be applied because of watch, and the notebooks, gen-ai and autorag grants land in the applications namespace while those backends read and write Secrets in user projects and openshift-ingress-operator. Module Roles also stay behind on disable, and the new real permissions test is what turns Dashboard Operator Tests red. Details inline.

    liday-rh liday-rh commented on code on Nov 30, 2026 12:46 UTC
    Code Review
    manifests/modules/notebooks/secret-rbac.yaml:1
    @@ -0,0 +1,29 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: Role
    +metadata:
    +  name: odh-dashboard-notebooks-secrets
    +rules:
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - get
    +      - list
    +      - watch

    Fixed in df9880b9. The notebooks Secret grant is now an installer-owned ClusterRole, and watch is intentionally omitted. TestDashboardChartModuleSecretRBAC, TestModuleSecretRBACIsInstallerOwned, and the real-permission integration test all assert that notebooks does not receive watch.

    liday-rh liday-rh commented on code on Nov 30, 2026 12:46 UTC
    Code Review
    manifests/modules/notebooks/secret-rbac.yaml:1
    @@ -0,0 +1,29 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: Role
    +metadata:
    +  name: odh-dashboard-notebooks-secrets
    +rules:
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - get
    +      - list
    +      - watch
    +      - create
    +      - update
    +      - patch
    +      - delete
    +    resources:

    Fixed in df9880b9. The notebooks module now uses an installer-owned, cross-namespace Secret ClusterRole and ClusterRoleBinding for its own service account. This preserves the user-project Secret API and workspace validation behavior while removing cluster-wide Secret access from the operator service account. The PR description documents this trust-boundary distinction.

    fullsend-ai-review[bot] fullsend-ai-review[bot] commented on Nov 30, 2026 12:46 UTC
    Bot

    <!-- fullsend:agent-status:46421638829 -->
    <!-- fullsend:status:terminal -->
    🤖 Finished Review · ✅ Success · Started 12:46 PM UTC · Completed 1:17 PM UTC

    Commit: df9880b · View workflow run →

    Runtime: pi · Model: openai/gpt-6.1-sol → gpt-6.1-sol · Effort: high · Cost: $3.44

    liday-rh liday-rh commented on code on Nov 30, 2026 12:46 UTC
    Code Review
    manifests/modules/autorag/secret-rbac.yaml:1
    @@ -0,0 +1,25 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: Role
    +metadata:
    +  name: odh-dashboard-autorag-secrets
    +rules:
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - get
    +    resources:
    +      - secrets
    +    resourceNames:
    +      - router-ca

    Fixed in df9880b9. AutoRAG and gen-ai now receive their router-ca Secret access through installer-owned cross-namespace ClusterRoles, so access to openshift-ingress-operator/router-ca is preserved without granting the operator service account cluster-wide Secret access.

    liday-rh liday-rh commented on code on Nov 30, 2026 12:46 UTC
    Code Review
    manifests/modules/gen-ai/secret-rbac.yaml:1
    @@ -0,0 +1,44 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: Role
    +metadata:
    +  name: odh-dashboard-gen-ai-secrets
    +rules:
    +  - apiGroups:
    +      - ""
    +    resources:
    +      - secrets
    +    resourceNames:
    +      - router-ca
    +    verbs:
    +      - get
    +  - apiGroups:
    +      - ""
    +    verbs:
    +      - create
    +    resources:

    Fixed in df9880b9. gen-ai’s installer-owned Secret ClusterRole remains cross-namespace, so EnsurePostgres can continue provisioning pgvector resources in the user’s project. The operator’s own ClusterRole no longer carries the Secret permission used to delegate that grant.

    liday-rh liday-rh commented on code on Nov 30, 2026 12:47 UTC
    Code Review
    dashboard-operator/internal/controller/module_deploy.go:1
    @@ -165,6 +165,7 @@ func (r *DashboardReconciler) deployModuleManifests(
     			return fmt.Errorf("failed to render manifests for module %s: %w", name, err)
     		}
     		remapRayDashboardGatewayRBAC(rendered)
    +		remapNotebooksSecretRBAC(rendered, dashboard.Spec.NotebooksNamespace)

    Fixed in df9880b9. The namespaced module Secret Roles, namespace remapping, and operator-created module Secret RBAC were removed. The module grants are now installer-owned ClusterRoles and ClusterRoleBindings; they are inert until each module’s service account exists, so disabling a module removes the effective grant with the service account. The consent-webhook work is already merged in #10716, and this PR is RBAC-only.

    liday-rh liday-rh commented on code on Nov 30, 2026 12:47 UTC
    Code Review
    dashboard-operator/internal/controller/namespaced_rbac_real_permissions_integration_test.go:1
    @@ -0,0 +1,186 @@
    +//go:build integration
    +
    +package controller_test
    +
    +import (
    +	"context"
    +	"os"
    +	"path/filepath"
    +	"testing"
    +
    +	"github.com/stretchr/testify/assert"
    +	"github.com/stretchr/testify/require"
    +	corev1 "k8s.io/api/core/v1"
    +	rbacv1 "k8s.io/api/rbac/v1"
    +	apierrors "k8s.io/apimachinery/pkg/api/errors"
    +	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    +	"k8s.io/apimachinery/pkg/types"
    +	"k8s.io/client-go/rest"
    +	"sigs.k8s.io/controller-runtime/pkg/client"
    +	"sigs.k8s.io/yaml"
    +
    +	"github.com/opendatahub-io/odh-platform-utilities/api/common"
    +
    +	v1alpha1 "github.com/opendatahub-io/odh-dashboard/dashboard-operator/api/v1alpha1"
    +)
    +
    +func TestIntegration_NamespacedRBACUnderOperatorPermissions(t *testing.T) {
    +	ctx := context.Background()
    +	admin := newIsolatedClient(t)
    +
    +	notebooksNS := "real-rbac-notebooks"
    +	modelRegistryNS := "real-rbac-model-registry"
    +	unrelatedNS := "real-rbac-unrelated"
    +	for _, namespace := range []string{notebooksNS, modelRegistryNS, unrelatedNS} {
    +		ns := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: namespace}}
    +		require.NoError(t, admin.Create(ctx, ns))
    +		t.Cleanup(func() { deleteIgnoreNotFound(t, ns) })
    +	}
    +	// Only the two target namespaces opt in to namespaced RBAC.
    +	for _, namespace := range []string{notebooksNS, modelRegistryNS} {
    +		target := &corev1.Namespace{}
    +		require.NoError(t, admin.Get(ctx, types.NamespacedName{Name: namespace}, target))
    +		if target.Labels == nil {
    +			target.Labels = map[string]string{}
    +		}
    +		target.Labels[v1alpha1.NamespacedRBACOptInLabel] = "true"
    +		require.NoError(t, admin.Update(ctx, target))
    +	}
    +
    +	operatorSA := &corev1.ServiceAccount{ObjectMeta: metav1.ObjectMeta{
    +		Name:      "real-rbac-operator",
    +		Namespace: integrationNamespace,
    +	}}
    +	require.NoError(t, admin.Create(ctx, operatorSA))
    +	t.Cleanup(func() { deleteIgnoreNotFound(t, operatorSA) })
    +
    +	// Load the real operator ClusterRole and remove only its Secret grant. This
    +	// mirrors the chart after RHOAIENG-98916 without granting test-only access.
    +	roleData, err := os.ReadFile(filepath.Join("..", "..", "config", "rbac", "role.yaml"))
    +	require.NoError(t, err)
    +	clusterRole := &rbacv1.ClusterRole{}
    +	require.NoError(t, yaml.Unmarshal(roleData, clusterRole))
    +	clusterRole.Name = "real-rbac-operator-role"
    +	for i := range clusterRole.Rules {
    +		resources := make([]string, 0, len(clusterRole.Rules[i].Resources))
    +		for _, resource := range clusterRole.Rules[i].Resources {
    +			if resource != "secrets" {
    +				resources = append(resources, resource)
    +			}
    +		}
    +		clusterRole.Rules[i].Resources = resources
    +	}
    +	require.NoError(t, admin.Create(ctx, clusterRole))
    +	t.Cleanup(func() { deleteIgnoreNotFound(t, clusterRole) })
    +
    +	clusterBinding := &rbacv1.ClusterRoleBinding{
    +		ObjectMeta: metav1.ObjectMeta{Name: "real-rbac-operator-rolebinding"},
    +		RoleRef:    rbacv1.RoleRef{APIGroup: rbacv1.GroupName, Kind: "ClusterRole", Name: clusterRole.Name},
    +		Subjects: []rbacv1.Subject{{
    +			Kind:      "ServiceAccount",
    +			Name:      operatorSA.Name,
    +			Namespace: operatorSA.Namespace,
    +		}},
    +	}
    +	require.NoError(t, admin.Create(ctx, clusterBinding))
    +	t.Cleanup(func() { deleteIgnoreNotFound(t, clusterBinding) })
    +
    +	// Pre-provision the operator's Secret Role in the applications namespace and
    +	// both target namespaces, exactly as the installer does in production.
    +	for _, namespace := range []string{integrationNamespace, notebooksNS, modelRegistryNS} {
    +		role := &rbacv1.Role{
    +			ObjectMeta: metav1.ObjectMeta{Name: "real-rbac-operator-secrets", Namespace: namespace},
    +			Rules: []rbacv1.PolicyRule{{
    +				APIGroups: []string{""},
    +				Resources: []string{"secrets"},
    +				Verbs:     []string{"get", "list", "create", "update", "patch", "delete"},
    +			}},
    +		}
    +		binding := &rbacv1.RoleBinding{
    +			ObjectMeta: metav1.ObjectMeta{Name: "real-rbac-operator-secrets", Namespace: namespace},
    +			RoleRef:    rbacv1.RoleRef{APIGroup: rbacv1.GroupName, Kind: "Role", Name: role.Name},
    +			Subjects: []rbacv1.Subject{{
    +				Kind:      "ServiceAccount",
    +				Name:      operatorSA.Name,
    +				Namespace: operatorSA.Namespace,
    +			}},
    +		}
    +		require.NoError(t, admin.Create(ctx, role))
    +		require.NoError(t, admin.Create(ctx, binding))
    +		t.Cleanup(func() {
    +			deleteIgnoreNotFound(t, role)
    +			deleteIgnoreNotFound(t, binding)
    +		})
    +	}
    +
    +	cfg := rest.CopyConfig(restCfg)
    +	cfg.Impersonate = rest.ImpersonationConfig{
    +		UserName: "system:serviceaccount:" + integrationNamespace + ":" + operatorSA.Name,
    +		Groups:   []string{"system:serviceaccounts", "system:serviceaccounts:" + integrationNamespace, "system:authenticated"},
    +	}
    +	restricted, err := client.New(cfg, client.Options{Scheme: admin.Scheme()})
    +	require.NoError(t, err)
    +
    +	// The restricted operator can manage Secrets only in its intended namespaces.
    +	for _, namespace := range []string{integrationNamespace, notebooksNS, modelRegistryNS} {
    +		secret := &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "dry-run", Namespace: namespace}}
    +		require.NoError(t, restricted.Create(ctx, secret, client.DryRunAll), "namespace: %s", namespace)
    +	}
    +	unrelatedSecret := &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "denied", Namespace: unrelatedNS}}
    +	err = restricted.Create(ctx, unrelatedSecret, client.DryRunAll)
    +	assert.True(t, apierrors.IsForbidden(err), "expected unrelated namespace Secret creation to be forbidden, got %v", err)
    +
    +	dashboard := newDashboard(v1alpha1.DashboardSpec{
    +		ManagementSpec:         common.ManagementSpec{ManagementState: "Managed"},
    +		NotebooksNamespace:     notebooksNS,
    +		ModelRegistryNamespace: modelRegistryNS,
    +		Modules:                disableAllModulesExcept(),
    +	})
    +	require.NoError(t, restricted.Create(ctx, dashboard))
    +	t.Cleanup(func() { deleteDashboard(t) })
    +
    +	r := newReconcilerWithClient(restricted, createIntegrationManifests(t, nil))
    +	r.NamespacedRBACAdmissionEnabled = true

    Fixed in df9880b9. The test now cleans up the namespaced-RBAC state ConfigMap and enables notebooks, gen-ai, and autorag. It also installs and verifies the module Secret RBAC while impersonating the operator under the real narrowed permissions. The focused integration suite passes.

    liday-rh liday-rh commented on code on Nov 30, 2026 12:47 UTC
    Code Review
    dashboard-operator/internal/controller/module_rbac_escalation_test.go:1
    @@ -41,6 +41,70 @@ func TestOperatorRoleCoversDeployedClusterRoles(t *testing.T) {
     	}
     }
     
    +func TestModuleSecretPermissionsAreNamespaced(t *testing.T) {

    Fixed in df9880b9. TestModuleSecretRBACIsInstallerOwned now verifies the module Secret ClusterRoles and bindings are installer-owned, that runtime module ClusterRoles contain no Secret rules, and that notebooks omits watch. Chart and Kustomize render tests verify the installer-owned module and operator Secret RBAC on both install paths.

    liday-rh liday-rh commented on code on Nov 30, 2026 12:47 UTC
    Code Review
    dashboard-operator/charts/dashboard/templates/rbac.yaml:1
    @@ -703,6 +702,54 @@ rules:
           - update
           - delete
     
    +{{- $operatorSecretNamespaces := list .Values.namespace }}

    Fixed in df9880b9. The chart now builds the namespace list with uniq, uses the dashboard.namespace helper for the applications namespace, and uses scope-specific Role names. The Kustomize path now installs applications, notebooks, and model-registry operator Secret Roles and uses replacements to place the target Roles in the configured namespaces.

    fullsend-ai-review[bot] fullsend-ai-review[bot] commented on Nov 30, 2026 13:17 UTC
    Reviewer

    See the review comment for full details.

    lucferbux lucferbux commented on code on Dec 01, 2026 13:08 UTC
    Code Review
    dashboard-operator/config/rbac/namespaced_role_applications.yaml:1
    @@ -0,0 +1,35 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: Role
    +metadata:
    +  name: dashboard-operator-applications-secret-role
    +  namespace: opendatahub
    +  labels:
    +    dashboard.opendatahub.io/secret-rbac-scope: applications
    +rules:
    +  - apiGroups:
    +      - ""
    +    resources:
    +      - secrets
    +    verbs:
    +      - get
    +      - list
    +      - create
    +      - update
    +      - patch
    +      - delete
    +---
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: RoleBinding
    +metadata:
    +  name: dashboard-operator-applications-secret-rolebinding
    +  namespace: opendatahub
    +  labels:
    +    dashboard.opendatahub.io/secret-rbac-scope: applications
    +roleRef:
    +  apiGroup: rbac.authorization.k8s.io
    +  kind: Role
    +  name: dashboard-operator-applications-secret-role
    +subjects:
    +  - kind: ServiceAccount
    +    name: dashboard-operator
    +    namespace: opendatahub

    This subject doesn't get renamed. Kustomize only rewrites it when the namespace matches the ServiceAccount resource, so it renders as dashboard-operator in opendatahub while the real SA is odh-dashboard-operator (checked with kustomize build config/default). Using namespace: system like role_binding.yaml fixes it, and the notebooks and model-registry files have the same issue. Could TestKustomizeSecretRBAC assert binding subjects too?

    lucferbux lucferbux commented on code on Dec 01, 2026 13:08 UTC
    Code Review
    dashboard-operator/charts/dashboard/templates/rbac.yaml:1
    @@ -703,6 +702,52 @@ rules:
           - update
           - delete
     
    +{{- $operatorSecretRBAC := list (dict "suffix" "applications" "namespace" (include "dashboard.namespace" .)) }}
    +{{- if .Values.notebooksNamespace }}

    These default to empty and don't follow spec.notebooksNamespace or spec.modelRegistryNamespace on the Dashboard CR. After an upgrade with defaults, reconcileNamespacedRBAC still writes Roles with Secret verbs there and gets rejected as escalation. Can we link the installer change that sets these, or at least surface a clear condition when the operator Role is missing?

    lucferbux lucferbux commented on code on Dec 01, 2026 13:08 UTC
    Code Review
    dashboard-operator/config/default/kustomization.yaml:1
    @@ -24,3 +24,35 @@ resources:
     # config/certmanager/wiring/kustomization.yaml.
     transformers:
       - ../certmanager/wiring
    +
    +replacements:

    A parent overlay with namespace: my-ns moves the notebooks and model-registry Roles into my-ns, since its namespace transform runs after these replacements. The base also always ships Roles in notebooks and model-registry, so apply fails when those namespaces don't exist. I'd make the target RBAC an opt-in component.

    lucferbux lucferbux commented on code on Dec 01, 2026 13:08 UTC
    Code Review
    dashboard-operator/config/rbac/module-secret-rbac.yaml:1
    @@ -0,0 +1,102 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: ClusterRole
    +metadata:
    +  name: dashboard-notebooks-secrets
    +rules:
    +  - apiGroups:
    +      - ""
    +    resources:
    +      - secrets
    +    verbs:
    +      - get
    +      - list
    +      - create
    +      - update
    +      - patch
    +      - delete
    +---
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: ClusterRoleBinding
    +metadata:
    +  name: dashboard-notebooks-secrets
    +subjects:
    +  - kind: ServiceAccount
    +    name: odh-dashboard-notebooks
    +    namespace: opendatahub

    The module SA subjects are hardcoded to opendatahub and stay there under a parent overlay namespace, while the module SAs are created in APPLICATIONS_NAMESPACE. Same on L71 and L98.

    lucferbux lucferbux requested changes on Dec 01, 2026 13:08 UTC
    Changes Requested Reviewer

    Thanks Liam, moving the module grants to installer-owned ClusterRoles is the right call and it settles the watch, namespace and disable points from my last pass. I rendered config/default though, and the new operator Secret RoleBindings bind dashboard-operator in opendatahub instead of odh-dashboard-operator, so on Kustomize installs the operator loses Secret access everywhere. The Helm side also needs the installer to set notebooksNamespace and modelRegistryNamespace before this lands, otherwise existing Dashboards with target namespaces fail to reconcile. Details inline.

    lucferbux lucferbux commented on Dec 02, 2026 16:33 UTC
    Reviewer

    Thanks Liam, this round fixes everything from my last pass: I rendered the stock and split Kustomize overlays, subjects and target namespaces come out right, and the envtest suite passes locally. Two things before I approve. The branch conflicts again with #10199, which adds applicationsNamespace for xKS, so the operator Secret Role and the module binding subjects need to follow that helper when you merge main. And since the chart ships inside the operator image, let's hold this until opendatahub-operator#4378 lands so RHOAI nightlies don't go Ready=False on rhods-notebooks.

    fullsend-ai-review[bot] fullsend-ai-review[bot] commented on Dec 03, 2026 12:00 UTC
    Bot

    <!-- fullsend:agent-status:47100910822 -->
    <!-- fullsend:status:terminal -->
    🤖 Finished Review · ✅ Success · Started 12:00 PM UTC · Completed 12:20 PM UTC

    Commit: dfff1cf · View workflow run →

    Runtime: pi · Model: openai/gpt-6.1-sol → gpt-6.1-sol · Effort: high · Cost: $3.47

    fullsend-ai-review[bot] fullsend-ai-review[bot] commented on Dec 03, 2026 12:20 UTC
    Bot

    <!-- fullsend:review-agent -->
    <!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJjb21tZW50IiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJwYXR0ZXJuLWluY29uc2lzdGVuY3kiLCJmaWxlIjoiZGFzaGJvYXJkLW9wZXJhdG9yL2ludGVybmFsL2NvbnRyb2xsZXIvbW9kdWxlX3JiYWNfZXNjYWxhdGlvbl90ZXN0LmdvIiwibGluZSI6MTQ3LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJzdHlsZS1jb252ZW50aW9ucyJ9XX0= -->
    <!-- Head SHA: dfff1cfa280078787372dd9d810617de81bf5a2b -->

    Finished Review · comment · Commit: dfff1cf
    Started 11:57 UTC · Completed 12:20 UTC · View workflow run

    Change summary

    Replaces the operator's cluster-wide Secret permissions with installer-provisioned namespace Roles and moves notebooks, gen-ai, and AutoRAG Secret privileges into separate installer-owned cluster grants. Adds optional target-namespace configuration, binding-identity wiring, teardown protection, actionable forbidden errors, regression coverage, and installation guidance.

    Status

    💬 Needs human judgment — 2 non-blocking findings. Human still finalizes.

    Signals

    | Signal | Level | Assessment |
    | --- | --- | --- |
    | Risk | critical | This changes the cluster's Secret authorization boundary: operator-wide Secret privileges become namespace grants, while three module identities retain installer-owned cross-namespace privileges. Incorrect subjects, scopes, or rollout sequencing can expose cluster credentials or disrupt Secret-dependent reconciliation across modules and both installation paths. |
    | Confidence | high | The stated RBAC ownership and scoping changes match the fully inspected diff, with relied-on files readable at the PR head. Committed render tests verify identities and rules across Helm and Kustomize layouts, and API-server integration tests exercise missing-grant recovery, allowed and denied Secret access, module permissions, and teardown preservation. |

    Checks

    | Check | Status | Details |
    | --- | --- | --- |
    | Test impact | ✅ pass | Durable render, controller, and API-server authorization tests adequately cover the Secret RBAC changes and their principal failure paths.<br><br>Automation: pass - Chart/Kustomize tests pin Secret rules, binding identities, optional targets and split namespaces; controller tests cover teardown preservation, installer ownership and removal of runtime Secret grants.<br><br>Efficiency: pass - Fast Go render and fake-client tests cover configuration and teardown, with shared envtest helpers reserved for real authorization and reconciliation behavior; no Cypress dependence.<br><br>Evidence depth: pass - The description identifies test, lint and chart validation plus targeted integration tests; committed Helm/Kustomize scenarios assert missing-grant diagnostics, recovery, intended-namespace access, unrelated-namespace denial and module allow/deny policies.<br><br>Visual delta: none -- Operator logic, RBAC manifests and documentation change; no rendered UI or interaction changes. |
    | PR description | ✅ pass | All three aspects contain substantive reviewer-facing information.<br><br>Problem: passed - Describes excessive cluster-wide operator Secret access and the module workflows that must retain access.<br><br>Solution: passed - Explains namespaced operator grants, installer-owned module grants, their rationale, and rollout prerequisites and failure impact.<br><br>Evidence: passed - Supplies test and validation commands, named integration tests, and descriptions of permission and rendered-binding checks. |

    Findings

    Medium (2)

  • CodeRabbit · permission-expansion (dashboard-operator/charts/dashboard/templates/module-secret-rbac.yaml:1): Do not install module Secret grants on XKS. XKS does not deploy the federated BFF modules, but this guard still renders all three grants. If a workload already uses odh-dashboard-notebooks in the XKS applications namespace, the install gives that workload permission to read and modify Secrets across the cluster. The binding does not require the Dashboard operator to create the ServiceAccount. This is CWE-250. Keep the operator's applications Role, and omit the module grants on XKS. Update the split XKS render test to assert that the module bindings are absent. (raw.githubusercontent.com) &lt;details> &lt;summary>Proposed template change&lt;/summary> &lt;/details> As per path instructions, prioritize “Security vulnerabilities” and provide the triggering scenario and remediation.
  • CodeRabbit · test-inadequate (dashboard-operator/internal/controller/namespaced_rbac_real_permissions_integration_test.go:179): Reconcile after grant creation can fail before the authorizer sees the grants. At namespaced_rbac_real_permissions_integration_test.go:179, reconcile(t, r) runs immediately after the target grants are created in the loop at lines 175-178. The operator's escalation checks and Role reads use the API server's RBAC authorizer, which reads from informer caches. A successful Create returns once the object is stored, not once the authorizer's cache has observed it. The reconcile helper in integration_test.go calls r.Reconcile once and requires err == nil. A stale cache can make that call fail with Forbidden or set NamespacedRBACFailed, and the test then fails intermittently. Before reconcile(t, r) runs, the operator identity must be able to use the granted permissions. Add a bounded wait for that condition after the target grants are created, and keep the wait limited to the operator's own access. The test also needs a failure message that names the grant that is still not visible. &lt;details> &lt;summary>Scope of this finding&lt;/summary> The test has no Eventually, poll, or permission check between line 176 and line 179. The reconcile helper has no wait or retry. The concern therefore applies to this call site. &lt;/details>
  • Low (3)

  • Style conventions · pattern-inconsistency (dashboard-operator/internal/controller/module_rbac_escalation_test.go:147) · actionable follow-up: The new test function ends immediately before TestOperatorRoleDoesNotAllowImpersonation, without the blank line used to separate functions throughout this file.

  • - Remediation: Add a blank line between the two function declarations.

  • CodeRabbit · incomplete-doc (dashboard-operator/config/rbac/namespaced_role_applications.yaml:25) · actionable follow-up: Document cleanup of the old applications Secret grant when moving namespaces. When an existing install moves applications from opendatahub to dashboard-apps and keeps the operator in opendatahub, the applications wiring renders a new Role and RoleBinding in the new namespace. kubectl apply does not prune the previous pair. The operator ServiceAccount then keeps get, list, create, update, patch, and delete on Secrets in opendatahub until someone removes that pair. This is unnecessary privilege (CWE-250). Exploiting it requires a compromised operator identity, so the impact is limited to the former namespace. The operations guide explains the namespace split but does not say to remove the previous grant. Add this migration step to the Secret RBAC section of docs/dashboard-operator-operations.md: 1. Confirm that the operator can read Secrets in the new applications namespace: ``shell kubectl auth can-i get secrets -n dashboard-apps --as=system:serviceaccount:&lt;operator-namespace>:&lt;operator-service-account> ` 2. List the previous applications Role and RoleBinding by their scope label: `shell kubectl -n &lt;previous-namespace> get role,rolebinding -l dashboard.opendatahub.io/secret-rbac-scope=applications ` 3. Delete the listed RoleBinding, then the listed Role.
  • CodeRabbit · logic-error (manifests/modules/autorag/cluster-role.yaml:20) · actionable follow-up: The standalone AutoRAG package no longer grants the router CA Secret read it needs. manifests/modules/README.md describes each module directory as a complete, independently deployable kustomize package. The autorag ClusterRole no longer grants get on router-ca. The BFF reads that Secret from openshift-ingress-operator to build its trust pool. When the read returns Forbidden, the sync fails and the BFF continues without the router CA. A standalone kustomize build manifests/modules/autorag deployment that lacks the installer's dashboard-autorag-secrets binding therefore has no router CA trust. TLS to router-CA-signed MaaS private gateway endpoints can then fail. Standalone deployments must keep router CA trust. Either the package carries a grant scoped to the router-ca Secret in openshift-ingress-operator, or the installer binding is documented as a required prerequisite for standalone use.
  • Justified (1)

    _These findings were raised by review producers but the PR's Justifications were accepted as sufficient for this run. They do not block disposition. A human reviewer may still disagree._

  • Security · permission-expansion (dashboard-operator/config/rbac/module-secret-rbac.yaml:3) · _Info_: The new installer-owned Secret ClusterRoles and ClusterRoleBindings, also present in charts/dashboard/templates/module-secret-rbac.yaml, deliberately retain module-level cross-namespace access rather than narrowing every module to the operator's managed namespaces. Verified each module independently against the removed runtime rules: notebooks retains unrestricted Secret get/list/create/update/patch/delete and loses watch; gen-ai retains unrestricted create, get of router-ca, and get/update/delete of the four deterministic pgvector names; AutoRAG retains get of router-ca. Each binding targets its corresponding module ServiceAccount in the applications namespace. The runtime ClusterRoles in manifests/modules/{notebooks,gen-ai,autorag}/cluster-role.yaml no longer declare Secret access. This introduces installer-owned grants, not additional effective verbs or resource names for enabled modules; the PR explicitly justifies retaining their cross-namespace functionality. In particular, resourceNames limits names, not namespaces, so router-ca reads remain cluster-wide.

  • - Justification: Justified by the PR's ## Justifications claim: "The notebooks, gen-ai, and autorag service accounts intentionally retain cross-namespace Secret access because their backends operate on user-project resources. Those grants are now installer-owned ClusterRoles and ClusterRoleBindings rather than runtime-applied operator-created RBAC, so the operator itself no longer needs the permissions it delegates." Source confirms the checkable statements: config/rbac/module-secret-rbac.yaml and charts/dashboard/templates/module-secret-rbac.yaml add the three installer-owned ClusterRoles/ClusterRoleBindings with the same verbs/resourceNames the diff removes from manifests/modules/{notebooks,gen-ai,autorag}/cluster-role.yaml (notebooks loses only watch); the operator ClusterRole (config/rbac/role.yaml, charts rbac.yaml) no longer lists secrets. The claim states intentional scope (retained pre-existing module access, not widened), so this informational cross-namespace retention is accepted for human review.

    Product ask

    Status: aligned · RHOAIENG-98916

    Aligned:

  • The PR states that it removes cluster-wide Secret access from the operator ClusterRole and supplies namespaced Secret Roles for applications and consented notebooks/model-registry targets.

  • The described installer-owned module grants preserve intended cross-namespace Secret functionality without requiring the operator itself to hold cluster-wide Secret permissions.

  • The stated RBAC-focused scope advances the ticket without contradicting its broader resource-scoping and cache-coordination requirements; the description identifies rollout prerequisites and functionality verification.
  • TODO

    Findings

  • dashboard-operator/charts/dashboard/templates/module-secret-rbac.yaml:1: Do not install module Secret grants on XKS. XKS does not deploy the federated BFF modules, but this guard still renders all three grants. If a workload already uses odh-dashboard-notebooks in the XKS applications namespa...

  • dashboard-operator/internal/controller/namespaced_rbac_real_permissions_integration_test.go:179: Reconcile after grant creation can fail before the authorizer sees the grants. At namespaced_rbac_real_permissions_integration_test.go:179, reconcile(t, r) runs immediately after the target gran...
  • Judgement

  • A human must decide whether to approve: risk is critical. This changes the cluster's Secret authorization boundary: operator-wide Secret privileges become namespace grants, while three module identities retain installer-owned cross-namespace privileges. Incorrect subjects, scopes, or rollout sequen...
  • Nits

  • dashboard-operator/internal/controller/module_rbac_escalation_test.go:147: The new test function ends immediately before TestOperatorRoleDoesNotAllowImpersonation, without the blank line used to separate functions throughout this file.

  • dashboard-operator/config/rbac/namespaced_role_applications.yaml:25: Document cleanup of the old applications Secret grant when moving namespaces. When an existing install moves applications from opendatahub to dashboard-apps and keeps the operator in opendatahub, the applications wiring...

  • manifests/modules/autorag/cluster-role.yaml:20: The standalone AutoRAG package no longer grants the router CA Secret read it needs. manifests/modules/README.md describes each module directory as a complete, independently deployable kustomize package. The autorag ClusterRole no longer grants...
  • <details>
    <summary>🔍 <strong>Review details</strong> — 13 producer(s) ran, 1 skipped</summary>

    Producers

    | Producer | Type | Ran | Result |
    | --- | --- | --- | --- |
    | PR description | check | ✅ | pass — All three aspects contain substantive reviewer-facing information. |
    | Test impact | check | ✅ | pass — Durable render, controller, and API-server authorization tests adequately cover the Secret RBAC changes and their principal failure paths. |
    | Jira | context | ✅ | Context available. |
    | CodeRabbit | findings | ✅ | 4 findings: coderabbit |
    | Correctness | findings | ✅ | No findings. |
    | Cross-repo contracts | findings | ✅ | No findings. |
    | Docs currency | findings | ✅ | No findings. |
    | Intent coherence | findings | ✅ | No findings. |
    | RBAC | findings | ✅ | No findings. |
    | Security | findings | ✅ | 2 findings: permission-reduction, permission-expansion |
    | Style | findings | ➖ | not selected |
    | Style conventions | findings | ✅ | 1 finding: pattern-inconsistency |
    | Product ask | section | ✅ | product_ask aligned |
    | Rating | signal | ✅ | risk critical · confidence high |

    Challenger

    Adjudicated 7 findings; kept 3 (justified 1, downgraded 3).

    Evidence inspected

    1 finding the challenger kept is below the low` posting threshold and not shown.

    Signals

    +1358 / −64 · 37 files

    </details>

    openshift-ci[bot] openshift-ci[bot] commented on Dec 03, 2026 15:41 UTC
    Bot

    [APPROVALNOTIFIER] This PR is NOT APPROVED

    This pull-request has been approved by: <a href="https://github.com/opendatahub-io/odh-dashboard/pull/10887#pullrequestreview-6173086464" title="Approved">lucferbux</a>
    Once this PR has been reviewed and has the lgtm label, please assign chrjones-rh, paulovmr for approval. For more information see the Code Review Process.

    The full list of commands accepted by this bot can be found here.

    <details open>
    Needs approval from an approver in each of these files:

  • ~~OWNERS~~ [lucferbux]

  • ~~dashboard-operator/OWNERS~~ [lucferbux]

  • ~~manifests/OWNERS~~ [lucferbux]

  • manifests/modules/autorag/OWNERS

  • manifests/modules/gen-ai/OWNERS

  • manifests/modules/notebooks/OWNERS
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":["chrjones-rh","paulovmr"]} -->

    Reviewers
    Assignees
    liday-rh liday-rh
    Labels
    risk: low confidence: 89.6% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 94.7% (HIGH) · Higher = larger blast radius
    94.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 89.6% · Lower = rushed or shallow review
    89.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 9.9% · Safe to merge
    9.9%