← Back to Pull requests

fix(istio): preserve Registry UI cross-profile mTLS #3644

Open
Swayam-code opened this pull request with 179 lines diff across 9 files
View on GitHub
Swayam-code Swayam-code commented on Oct 18, 2026 16:00 UTC
Author

Summary of Changes

Add a workload-selected Sidecar exception for the shared Model Registry UI in kubeflow, with matching generated Helm payloads and the focused functional access test. The proposed Registry authorization rule trusts the exact shared UI service account.

Merge blocker: the destination-authorization finding in review5686416579 remains unresolved. This PR is draft and must not merge until the Hub client fix is available and the required two-profile isolation regression passes. Existing direct access checks do not establish redirect isolation.

Dependencies

CI/runtime, runner, SDK command checks, Katib diagnostics and KinD prerequisite changes are tracked separately in #3660. Hub security coordination and a safe consumable client release remain pending.

Related Issues

#3573

Validation

The focused test retains authorized model access, unauthorized-user rejection, unauthenticated gateway rejection and unrelated-workload rejection. The maintainer's removal of duplicate fixtures, rendering/parser tests and mutation machinery is preserved. No fresh cluster test has been run locally on the scope-only cleanup commit 6cb79b7a.

All contribution commits are signed off. Historical validation in earlier revisions does not prove this revision resolves the destination-authorization issue.

Diff: 179 lines (+179 / -0) across 9 files Reviewer: christian-heusel Review duration: 66718m
All Vouch review confidence checks passed
Residual risk 0.09 = Change Risk (0.76) × (1 − Review Confidence (0.88)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.76 · 179 lines diff across 9 files
0.76
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.93 · 5 substantive comment(s)
0.93
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
87%
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.311
Sensitive Paths sensitive_paths
0.076
Real PR Conversation Timeline
33 items
google-oss-prow[bot] google-oss-prow[bot] commented on Oct 18, 2026 16:00 UTC
Bot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign juliusvonkohout for approval. For more information see the Kubernetes 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
  • 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":["juliusvonkohout"]} -->

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Oct 18, 2026 16:00 UTC
    Reviewer

    Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

    github-actions[bot] github-actions[bot] commented on Oct 18, 2026 16:00 UTC
    Bot

    Welcome to the Kubeflow Community Distribution Repository

    Thanks for opening your first PR. Your contribution means a lot to the Kubeflow community.

    Before making more PRs:
    Please ensure your PR follows our Contributing Guide.
    Please also be aware that many components are synchronized from upstream via the scripts in /scripts.
    So in some cases you have to fix the problem in the upstream repositories first, but you can use a PR against kubeflow/community-distribution to test the platform integration.

    Community Resources:

  • CNCF Slack channels: https://www.kubeflow.org/docs/about/community/#kubeflow-slack-channels

  • Community meetings: https://www.kubeflow.org/docs/about/community/
  • Thanks again for helping to improve Kubeflow.

    Swayam-code Swayam-code commented on Oct 18, 2026 17:43 UTC
    Author

    Could a maintainer please approve the CI runs for this PR? They currently show action_required.

    christian-heusel christian-heusel commented on Oct 18, 2026 17:50 UTC
    Reviewer

    /ok-to-test

    Copilot Copilot commented on code on Oct 18, 2026 20:54 UTC
    Code Review
    tests/istio_helm_chart_test.py:1
    @@ -85,6 +85,45 @@ def test_kubeflow_aggregated_role_leaves_rules_to_the_controller(self):
                     for name in ["kubeflow-istio-edit", "kubeflow-istio-view"]:
                         self.assertTrue(roles[name]["rules"])
     
    +    def test_registry_ui_has_workload_scoped_cross_namespace_egress(self):
    +        ui_deployment = yaml.safe_load(
    +            (
    +                REPOSITORY_ROOT
    +                / "applications/hub/upstream/options/ui/base/model-registry-ui-deployment.yaml"
    +            ).read_text()
    +        )
    +        ui_labels = ui_deployment["spec"]["template"]["metadata"]["labels"]
    +        for profile in ["base", "oauth2-proxy", "gke"]:
    +            source = "base" if profile == "base" else f"overlays/{profile}"
    +            kustomize = subprocess.run(
    +                ["kustomize", "build", str(REPOSITORY_ROOT / "common/istio/istio-install" / source)],
    +                capture_output=True,
    +                text=True,
    +                check=True,
    +            )
    +            helm = self.render_chart(values=CHART_DIRECTORY / f"ci/values-{profile}.yaml")
    +            self.assertEqual(helm.returncode, 0, helm.stderr)
    +            for renderer, output in [("kustomize", kustomize.stdout), ("helm", helm.stdout)]:
    +                with self.subTest(profile=profile, renderer=renderer):
    +                    sidecars = {
    +                        resource["metadata"]["name"]: resource
    +                        for resource in yaml.safe_load_all(output)
    +                        if resource and resource.get("kind") == "Sidecar"
    +                    }
    +                    exception = sidecars["model-registry-ui-exception"]
    +                    self.assertEqual(exception["metadata"]["namespace"], "kubeflow")
    +                    selector = exception["spec"]["workloadSelector"]["labels"]
    +                    self.assertEqual(selector, {"app": "model-registry-ui"})
    +                    self.assertTrue(selector.items() <= ui_labels.items())
    +                    self.assertEqual(exception["spec"]["egress"], [{"hosts": ["*/*"]}])
    +                    default = sidecars["default"]
    +                    self.assertEqual(default["metadata"]["namespace"], "istio-system")
    +                    self.assertNotIn("workloadSelector", default["spec"])
    +                    self.assertEqual(
    +                        default["spec"]["egress"],
    +                        [{"hosts": ["./*", "kubeflow/*", "kubeflow-system/*", "knative-serving/*", "knative-eventing/*", "istio-system/*"]}],

    The new method contains expressions that Black requires to be wrapped, including this host list and the expressions on lines 99 and 106. The formatting workflow checks ./tests with Black (.github/workflows/linting_bash_python_yaml_files.yaml:29–34), so these additions fail that check. Run python -m black tests/istio_helm_chart_test.py to format the method without changing the assertions.

    Copilot Copilot commented on code on Oct 18, 2026 20:54 UTC
    Code Review
    tests/model_registry_egress_test.sh:1
    @@ -0,0 +1,72 @@
    +#!/bin/bash
    +set -euo pipefail
    +
    +profile_namespace=${1:-kubeflow-user-example-com}
    +registry_endpoint="http://model-registry-service.${profile_namespace}.svc.cluster.local:8080/api/model_registry/v1alpha3/registered_models"
    +probe_suffix="${RANDOM}"
    +ui_probe="registry-ui-egress-${probe_suffix}"
    +control_probe="registry-egress-control-${probe_suffix}"
    +
    +cleanup() {
    +    kubectl -n kubeflow delete pod "$ui_probe" "$control_probe" --ignore-not-found --wait=false
    +}
    +trap cleanup EXIT
    +
    +for probe_name in "$ui_probe" "$control_probe"; do
    +    application_label=registry-egress-control
    +    if [[ "$probe_name" == "$ui_probe" ]]; then
    +        application_label=model-registry-ui
    +    fi
    +    kubectl apply -f - <<EOF
    +apiVersion: v1
    +kind: Pod
    +metadata:
    +  name: ${probe_name}
    +  namespace: kubeflow
    +  labels:
    +    app: ${application_label}
    +spec:
    +  restartPolicy: Never
    +  automountServiceAccountToken: false
    +  securityContext:
    +    runAsNonRoot: true
    +    runAsUser: 1000
    +    seccompProfile:
    +      type: RuntimeDefault
    +  containers:
    +  - name: registry-egress-probe
    +    image: busybox:1.37.0
    +    command: ["sleep", "600"]
    +    resources:
    +      requests:
    +        cpu: 10m
    +        memory: 16Mi
    +      limits:
    +        memory: 64Mi
    +    securityContext:
    +      allowPrivilegeEscalation: false
    +      capabilities:
    +        drop: ["ALL"]
    +EOF
    +done
    +kubectl -n kubeflow wait --for=condition=Ready "pod/$ui_probe" "pod/$control_probe" --timeout=180s

    When the shared UI is installed in kubeflow, the UI probe also matches model-registry-ui-service, whose selector is only app: model-registry-ui (applications/hub/upstream/options/ui/base/model-registry-ui-service.yaml:9–15). Once Ready, the probe can receive real UI requests, but its sleep container has no listener on port 8080. Keep the probes out of ready Service endpoints with an unsatisfied readiness gate, and wait for ContainersReady before executing the checks.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Oct 18, 2026 20:54 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟡 Changes recommended

    The runtime probe can disrupt live UI traffic, and the Python additions need formatting to pass continuous integration.

    <details open>
    <summary><strong>2 open issues</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> New test method fails Black formatting checks · New

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> UI probe can receive traffic without a listening port · New

  • </details>

    <sub>Review effort: Balanced</sub>

    Swayam-code Swayam-code commented on code on Oct 19, 2026 03:51 UTC
    Code Review
    tests/istio_helm_chart_test.py:1
    @@ -85,6 +85,45 @@ def test_kubeflow_aggregated_role_leaves_rules_to_the_controller(self):
                     for name in ["kubeflow-istio-edit", "kubeflow-istio-view"]:
                         self.assertTrue(roles[name]["rules"])
     
    +    def test_registry_ui_has_workload_scoped_cross_namespace_egress(self):
    +        ui_deployment = yaml.safe_load(
    +            (
    +                REPOSITORY_ROOT
    +                / "applications/hub/upstream/options/ui/base/model-registry-ui-deployment.yaml"
    +            ).read_text()
    +        )
    +        ui_labels = ui_deployment["spec"]["template"]["metadata"]["labels"]
    +        for profile in ["base", "oauth2-proxy", "gke"]:
    +            source = "base" if profile == "base" else f"overlays/{profile}"
    +            kustomize = subprocess.run(
    +                ["kustomize", "build", str(REPOSITORY_ROOT / "common/istio/istio-install" / source)],
    +                capture_output=True,
    +                text=True,
    +                check=True,
    +            )
    +            helm = self.render_chart(values=CHART_DIRECTORY / f"ci/values-{profile}.yaml")
    +            self.assertEqual(helm.returncode, 0, helm.stderr)
    +            for renderer, output in [("kustomize", kustomize.stdout), ("helm", helm.stdout)]:
    +                with self.subTest(profile=profile, renderer=renderer):
    +                    sidecars = {
    +                        resource["metadata"]["name"]: resource
    +                        for resource in yaml.safe_load_all(output)
    +                        if resource and resource.get("kind") == "Sidecar"
    +                    }
    +                    exception = sidecars["model-registry-ui-exception"]
    +                    self.assertEqual(exception["metadata"]["namespace"], "kubeflow")
    +                    selector = exception["spec"]["workloadSelector"]["labels"]
    +                    self.assertEqual(selector, {"app": "model-registry-ui"})
    +                    self.assertTrue(selector.items() <= ui_labels.items())
    +                    self.assertEqual(exception["spec"]["egress"], [{"hosts": ["*/*"]}])
    +                    default = sidecars["default"]
    +                    self.assertEqual(default["metadata"]["namespace"], "istio-system")
    +                    self.assertNotIn("workloadSelector", default["spec"])
    +                    self.assertEqual(
    +                        default["spec"]["egress"],
    +                        [{"hosts": ["./*", "kubeflow/*", "kubeflow-system/*", "knative-serving/*", "knative-eventing/*", "istio-system/*"]}],

    Fixed in f39ee2c4: formatted the test with Black 26.10.1 without changing its assertions.

    Swayam-code Swayam-code commented on code on Oct 19, 2026 03:51 UTC
    Code Review
    tests/model_registry_egress_test.sh:1
    @@ -0,0 +1,72 @@
    +#!/bin/bash
    +set -euo pipefail
    +
    +profile_namespace=${1:-kubeflow-user-example-com}
    +registry_endpoint="http://model-registry-service.${profile_namespace}.svc.cluster.local:8080/api/model_registry/v1alpha3/registered_models"
    +probe_suffix="${RANDOM}"
    +ui_probe="registry-ui-egress-${probe_suffix}"
    +control_probe="registry-egress-control-${probe_suffix}"
    +
    +cleanup() {
    +    kubectl -n kubeflow delete pod "$ui_probe" "$control_probe" --ignore-not-found --wait=false
    +}
    +trap cleanup EXIT
    +
    +for probe_name in "$ui_probe" "$control_probe"; do
    +    application_label=registry-egress-control
    +    if [[ "$probe_name" == "$ui_probe" ]]; then
    +        application_label=model-registry-ui
    +    fi
    +    kubectl apply -f - <<EOF
    +apiVersion: v1
    +kind: Pod
    +metadata:
    +  name: ${probe_name}
    +  namespace: kubeflow
    +  labels:
    +    app: ${application_label}
    +spec:
    +  restartPolicy: Never
    +  automountServiceAccountToken: false
    +  securityContext:
    +    runAsNonRoot: true
    +    runAsUser: 1000
    +    seccompProfile:
    +      type: RuntimeDefault
    +  containers:
    +  - name: registry-egress-probe
    +    image: busybox:1.37.0
    +    command: ["sleep", "600"]
    +    resources:
    +      requests:
    +        cpu: 10m
    +        memory: 16Mi
    +      limits:
    +        memory: 64Mi
    +    securityContext:
    +      allowPrivilegeEscalation: false
    +      capabilities:
    +        drop: ["ALL"]
    +EOF
    +done
    +kubectl -n kubeflow wait --for=condition=Ready "pod/$ui_probe" "pod/$control_probe" --timeout=180s

    Fixed in f39ee2c4: added an unsatisfied readiness gate, waited for ContainersReady, and asserted Ready=False so the probes cannot become ready UI Service endpoints.

    juliusvonkohout juliusvonkohout commented on Oct 19, 2026 08:53 UTC
    Contributor

    Please do a proper Rebase to master instead of merge tfrom master to fix the commit history.
    /ok-to-test

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Oct 19, 2026 10:12 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟢 Approval recommended

    The targeted exception preserves existing restrictions, includes regression coverage, and has no identified blocking issues.

    No open issues 🎉

    <details>
    <summary><strong>2 resolved since last review</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> New test method fails Black formatting checks

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> UI probe can receive traffic without a listening port

  • </details>

    <sub>Review effort: Balanced</sub>

    juliusvonkohout juliusvonkohout commented on Oct 20, 2026 14:56 UTC
    Reviewer

    AI-Assisted Review

    Prepared with GitHub Copilot. Reviewed commit: 7641154bbe70d5c93f5e7c45ad95a84555457e88.

    The workload-selected Sidecar exception is appropriately scoped, and the earlier formatting and ready-Service-endpoint findings are addressed. One actionable coverage finding remains: the successful synthetic probe uses a token that the deployed UI's default authentication mode does not send. The mesh check therefore does not demonstrate that the reported default UI failure is resolved.

    Suggested Repair

    Keep the Sidecar exception and make the Registry authorization contract compatible with the real default UI. For the existing internal authentication design, consider an additional Registry server authorization rule that trusts only the shared UI's mTLS service-account identity, while preserving the existing gateway and controller rules:

    - from:
      - source:
          principals:
          - cluster.local/ns/kubeflow/sa/model-registry-ui
    

    This is a proposed trust-boundary adjustment, not a live-validated patch. The UI must retain its ingress restriction and per-user Kubernetes authorization checks; do not replace the exact principal with a namespace-wide exception. Make the policy change in the upstream Hub source or a maintained overlay, rather than editing the synchronized upstream snapshot directly, and regenerate the affected Helm payloads.

    The regression fixture should run the real UI in kubeflow under service account model-registry-ui, retain the deployed default authentication mode, and target a Registry server in a profile namespace. Verify authorized access through the normal gateway, rejection of unauthorized users and unrelated workloads, failure when the Sidecar exception is omitted, and recovery when the exception is restored. The existing workflow's UI and Registry server both run in the profile namespace, so its UI cannot establish the required cross-namespace topology.

    The repair requires policy and fixture changes; it is not suitable for an automatic replacement of the single shell assertion.

    Verification

  • Reviewed all eight changed files and the existing discussion.

  • All 12 Istio Helm regression tests passed.

  • All seven Helm/Kustomize comparison scenarios passed.

  • Black 26.10.1 and Bash syntax checks passed.

  • No live mesh, browser, or full-platform validation was performed. The authentication conclusion is grounded in the deployed Hub UI v0.3.17 source and rendered manifests, not a claimed live reproduction.
  • juliusvonkohout juliusvonkohout commented on code on Oct 20, 2026 14:56 UTC
    Code Review
    tests/model_registry_egress_test.sh:1
    @@ -0,0 +1,76 @@
    +#!/bin/bash
    +set -euo pipefail
    +
    +profile_namespace=${1:-kubeflow-user-example-com}
    +registry_endpoint="http://model-registry-service.${profile_namespace}.svc.cluster.local:8080/api/model_registry/v1alpha3/registered_models"
    +probe_suffix="${RANDOM}"
    +ui_probe="registry-ui-egress-${probe_suffix}"
    +control_probe="registry-egress-control-${probe_suffix}"
    +
    +cleanup() {
    +    kubectl -n kubeflow delete pod "$ui_probe" "$control_probe" --ignore-not-found --wait=false
    +}
    +trap cleanup EXIT
    +
    +for probe_name in "$ui_probe" "$control_probe"; do
    +    application_label=registry-egress-control
    +    if [[ "$probe_name" == "$ui_probe" ]]; then
    +        application_label=model-registry-ui
    +    fi
    +    kubectl apply -f - <<EOF
    +apiVersion: v1
    +kind: Pod
    +metadata:
    +  name: ${probe_name}
    +  namespace: kubeflow
    +  labels:
    +    app: ${application_label}
    +spec:
    +  restartPolicy: Never
    +  automountServiceAccountToken: false
    +  # Keep probe Pods out of the shared UI Service endpoints.
    +  readinessGates:
    +  - conditionType: tests.kubeflow.org/egress-probe
    +  securityContext:
    +    runAsNonRoot: true
    +    runAsUser: 1000
    +    seccompProfile:
    +      type: RuntimeDefault
    +  containers:
    +  - name: registry-egress-probe
    +    image: busybox:1.37.0
    +    command: ["sleep", "600"]
    +    resources:
    +      requests:
    +        cpu: 10m
    +        memory: 16Mi
    +      limits:
    +        memory: 64Mi
    +    securityContext:
    +      allowPrivilegeEscalation: false
    +      capabilities:
    +        drop: ["ALL"]
    +EOF
    +done
    +kubectl -n kubeflow wait --for=condition=ContainersReady "pod/$ui_probe" "pod/$control_probe" --timeout=180s
    +kubectl -n kubeflow wait --for=condition=Ready=false "pod/$ui_probe" "pod/$control_probe" --timeout=10s
    +profile_token=$(kubectl -n "$profile_namespace" create token default-editor --duration=10m)
    +
    +assert_response() {
    +    local probe_name=$1
    +    local expected_status=$2
    +    shift 2
    +    local response
    +    response=$(kubectl -n kubeflow exec "$probe_name" -c registry-egress-probe -- \
    +        wget -S -O /dev/null -T 20 "$@" "$registry_endpoint" 2>&1) || true
    +    if ! grep -Eq "HTTP/1[.][01] ${expected_status} " <<< "$response"; then
    +        printf 'FAIL: %s expected HTTP %s\n%s\n' "$probe_name" "$expected_status" "$response" >&2
    +        return 1
    +    fi
    +    printf 'PASS: %s returned HTTP %s\n' "$probe_name" "$expected_status"
    +}
    +
    +assert_response "$ui_probe" 200 --header="Authorization: Bearer $profile_token"

    [P2] Regression test bypasses the deployed UI authentication path

    The deployed Hub UI defaults to --auth-method=internal, with no manifest override. Its Registry client adds Authorization only in user_token mode. The actual default UI therefore sends the headerless request that this test expects to reject, while the successful probe supplies a token the UI does not send. This test can pass while the reported UI failure persists. Could we exercise the deployed UI backend and verify the intended authentication configuration?

    Evidence: authentication default, outgoing Registry headers.

    Swayam-code Swayam-code commented on code on Oct 21, 2026 13:13 UTC
    Code Review
    tests/model_registry_egress_test.sh:1
    @@ -0,0 +1,76 @@
    +#!/bin/bash
    +set -euo pipefail
    +
    +profile_namespace=${1:-kubeflow-user-example-com}
    +registry_endpoint="http://model-registry-service.${profile_namespace}.svc.cluster.local:8080/api/model_registry/v1alpha3/registered_models"
    +probe_suffix="${RANDOM}"
    +ui_probe="registry-ui-egress-${probe_suffix}"
    +control_probe="registry-egress-control-${probe_suffix}"
    +
    +cleanup() {
    +    kubectl -n kubeflow delete pod "$ui_probe" "$control_probe" --ignore-not-found --wait=false
    +}
    +trap cleanup EXIT
    +
    +for probe_name in "$ui_probe" "$control_probe"; do
    +    application_label=registry-egress-control
    +    if [[ "$probe_name" == "$ui_probe" ]]; then
    +        application_label=model-registry-ui
    +    fi
    +    kubectl apply -f - <<EOF
    +apiVersion: v1
    +kind: Pod
    +metadata:
    +  name: ${probe_name}
    +  namespace: kubeflow
    +  labels:
    +    app: ${application_label}
    +spec:
    +  restartPolicy: Never
    +  automountServiceAccountToken: false
    +  # Keep probe Pods out of the shared UI Service endpoints.
    +  readinessGates:
    +  - conditionType: tests.kubeflow.org/egress-probe
    +  securityContext:
    +    runAsNonRoot: true
    +    runAsUser: 1000
    +    seccompProfile:
    +      type: RuntimeDefault
    +  containers:
    +  - name: registry-egress-probe
    +    image: busybox:1.37.0
    +    command: ["sleep", "600"]
    +    resources:
    +      requests:
    +        cpu: 10m
    +        memory: 16Mi
    +      limits:
    +        memory: 64Mi
    +    securityContext:
    +      allowPrivilegeEscalation: false
    +      capabilities:
    +        drop: ["ALL"]
    +EOF
    +done
    +kubectl -n kubeflow wait --for=condition=ContainersReady "pod/$ui_probe" "pod/$control_probe" --timeout=180s
    +kubectl -n kubeflow wait --for=condition=Ready=false "pod/$ui_probe" "pod/$control_probe" --timeout=10s
    +profile_token=$(kubectl -n "$profile_namespace" create token default-editor --duration=10m)
    +
    +assert_response() {
    +    local probe_name=$1
    +    local expected_status=$2
    +    shift 2
    +    local response
    +    response=$(kubectl -n kubeflow exec "$probe_name" -c registry-egress-probe -- \
    +        wget -S -O /dev/null -T 20 "$@" "$registry_endpoint" 2>&1) || true
    +    if ! grep -Eq "HTTP/1[.][01] ${expected_status} " <<< "$response"; then
    +        printf 'FAIL: %s expected HTTP %s\n%s\n' "$probe_name" "$expected_status" "$response" >&2
    +        return 1
    +    fi
    +    printf 'PASS: %s returned HTTP %s\n' "$probe_name" "$expected_status"
    +}
    +
    +assert_response "$ui_probe" 200 --header="Authorization: Bearer $profile_token"

    Fixed in 3340a831: added cluster.local/ns/kubeflow/sa/model-registry-ui through a maintained overlay and regenerated Helm.

    The real shared UI, using default internal authentication, passed cross-namespace gateway access and negative user/workload checks. Removing either the new Registry rule or Sidecar exception reproduced a backend 403; restoring each recovered UI access. Browser login and the full-platform suite were not run.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Oct 23, 2026 09:10 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🔵 Needs a closer look

    The security-sensitive cross-profile trust change warrants human confirmation of tenant isolation despite the targeted regression coverage and reported runtime validation.

    No open issues 🎉

    <sub>Review effort: Balanced</sub>

    Swayam-code Swayam-code commented on code on Oct 24, 2026 09:41 UTC
    Code Review
    tests/model_registry_egress_test.sh:1
    @@ -0,0 +1,76 @@
    +#!/bin/bash
    +set -euo pipefail
    +
    +profile_namespace=${1:-kubeflow-user-example-com}
    +registry_endpoint="http://model-registry-service.${profile_namespace}.svc.cluster.local:8080/api/model_registry/v1alpha3/registered_models"
    +probe_suffix="${RANDOM}"
    +ui_probe="registry-ui-egress-${probe_suffix}"
    +control_probe="registry-egress-control-${probe_suffix}"
    +
    +cleanup() {
    +    kubectl -n kubeflow delete pod "$ui_probe" "$control_probe" --ignore-not-found --wait=false
    +}
    +trap cleanup EXIT
    +
    +for probe_name in "$ui_probe" "$control_probe"; do
    +    application_label=registry-egress-control
    +    if [[ "$probe_name" == "$ui_probe" ]]; then
    +        application_label=model-registry-ui
    +    fi
    +    kubectl apply -f - <<EOF
    +apiVersion: v1
    +kind: Pod
    +metadata:
    +  name: ${probe_name}
    +  namespace: kubeflow
    +  labels:
    +    app: ${application_label}
    +spec:
    +  restartPolicy: Never
    +  automountServiceAccountToken: false
    +  # Keep probe Pods out of the shared UI Service endpoints.
    +  readinessGates:
    +  - conditionType: tests.kubeflow.org/egress-probe
    +  securityContext:
    +    runAsNonRoot: true
    +    runAsUser: 1000
    +    seccompProfile:
    +      type: RuntimeDefault
    +  containers:
    +  - name: registry-egress-probe
    +    image: busybox:1.37.0
    +    command: ["sleep", "600"]
    +    resources:
    +      requests:
    +        cpu: 10m
    +        memory: 16Mi
    +      limits:
    +        memory: 64Mi
    +    securityContext:
    +      allowPrivilegeEscalation: false
    +      capabilities:
    +        drop: ["ALL"]
    +EOF
    +done
    +kubectl -n kubeflow wait --for=condition=ContainersReady "pod/$ui_probe" "pod/$control_probe" --timeout=180s
    +kubectl -n kubeflow wait --for=condition=Ready=false "pod/$ui_probe" "pod/$control_probe" --timeout=10s
    +profile_token=$(kubectl -n "$profile_namespace" create token default-editor --duration=10m)
    +
    +assert_response() {
    +    local probe_name=$1
    +    local expected_status=$2
    +    shift 2
    +    local response
    +    response=$(kubectl -n kubeflow exec "$probe_name" -c registry-egress-probe -- \
    +        wget -S -O /dev/null -T 20 "$@" "$registry_endpoint" 2>&1) || true
    +    if ! grep -Eq "HTTP/1[.][01] ${expected_status} " <<< "$response"; then
    +        printf 'FAIL: %s expected HTTP %s\n%s\n' "$probe_name" "$expected_status" "$response" >&2
    +        return 1
    +    fi
    +    printf 'PASS: %s returned HTTP %s\n' "$probe_name" "$expected_status"
    +}
    +
    +assert_response "$ui_probe" 200 --header="Authorization: Bearer $profile_token"

    Fixed the stale image assertion in b3eda59d: the expected image now comes from the intended rendered fixture, with exact tag/digest comparison. The authentication, identity and authorization checks are unchanged.

    The original guard fails the version-update regression; all five corrected mocked tests (15 cases), Black, Bash syntax, actionlint and the scoped secret scan passed locally. ShellCheck was unavailable locally. A new live mesh run on v0.3.18 has not been performed.

    juliusvonkohout juliusvonkohout commented on code on Oct 26, 2026 18:39 UTC
    Code Review
    tests/model_registry_egress_test.sh:1
    @@ -0,0 +1,188 @@
    +#!/bin/bash
    +set -euo pipefail
    +
    +# This fixture deliberately changes routing and mesh policies in an ephemeral
    +# KinD test cluster. Never run it against a shared installation.
    +[[ $(kubectl config current-context) == kind-* ]] || {
    +    echo 'ERROR: the shared UI regression requires an isolated KinD test cluster.' >&2
    +    exit 1
    +}
    +profile_namespace=${1:-kubeflow-user-example-com}
    +gateway_endpoint=${GATEWAY_ENDPOINT:-http://localhost:8080}
    +registry_endpoint="http://model-registry-service.${profile_namespace}.svc.cluster.local:8080/api/model_registry/v1alpha3/registered_models"
    +ui_route="${gateway_endpoint}/model-registry/api/v1/model_registry/model-registry-service/registered_models?namespace=${profile_namespace}"
    +response_directory=$(mktemp -d)
    +control_probe="registry-egress-control-${RANDOM}"
    +policy_modified=false
    +sidecar_modified=false
    +
    +cleanup() {
    +    local result=$?
    +    trap - EXIT
    +    if [[ $policy_modified == true ]]; then
    +        kubectl apply -f "$response_directory/registry-policy.json" || result=1
    +    fi
    +    if [[ $sidecar_modified == true ]]; then
    +        kubectl apply -f "$response_directory/sidecar.json" || result=1
    +    fi
    +    kubectl -n kubeflow delete pod "$control_probe" --ignore-not-found --wait=false || result=1
    +    rm -rf "$response_directory"
    +    exit "$result"
    +}
    +trap cleanup EXIT
    +
    +# Remove server-managed fields so backups can also recreate deleted objects.
    +save_resource() {
    +    kubectl -n "$1" get "$2" "$3" -o json | python -c '
    +import json, sys
    +resource = json.load(sys.stdin)
    +resource.pop("status", None)
    +for field in ("resourceVersion", "uid", "creationTimestamp", "managedFields"):
    +    resource["metadata"].pop(field, None)
    +resource["metadata"].get("annotations", {}).pop("kubectl.kubernetes.io/last-applied-configuration", None)
    +json.dump(resource, sys.stdout)
    +' > "$4"
    +}
    +save_resource "$profile_namespace" authorizationpolicy model-registry-service "$response_directory/registry-policy.json"
    +save_resource kubeflow sidecar model-registry-ui-exception "$response_directory/sidecar.json"
    +
    +# Replace the profile-local UI route with the real shared application. The
    +# existing gateway, identity propagation and per-user access reviews remain.
    +shared_ui_manifest="$response_directory/shared-ui.yaml"
    +kustomize build tests/model_registry_shared_ui > "$shared_ui_manifest"
    +expected_ui_image=$(kubectl create --dry-run=client --validate=false -f "$shared_ui_manifest" -o json | python -c '

    expected_ui_image=$(kubectl create --dry-run=client --validate=false -f "$shared_ui_manifest" -o json | jq -s '{items: .}' | python -c '
    

    juliusvonkohout juliusvonkohout commented on code on Oct 26, 2026 18:39 UTC
    Code Review
    tests/model_registry_egress_test.py:1
    @@ -0,0 +1,196 @@
    +#!/usr/bin/env python3
    +"""Exercise the shared UI fixture guard without a Kubernetes cluster."""
    +
    +import copy
    +import json
    +import os
    +import subprocess
    +import sys
    +import tempfile
    +import unittest
    +from pathlib import Path
    +
    +ROOT = Path(__file__).resolve().parents[1]
    +SCRIPT = Path(
    +    os.environ.get(
    +        "MODEL_REGISTRY_EGRESS_SCRIPT", ROOT / "tests/model_registry_egress_test.sh"
    +    )
    +)
    +BASH = os.environ.get("BASH_BINARY", "bash")
    +IMAGE = "ghcr.io/kubeflow/hub/ui:v0.3.18"
    +DEPLOYMENT = {
    +    "apiVersion": "apps/v1",
    +    "kind": "Deployment",
    +    "metadata": {"name": "model-registry-ui", "namespace": "kubeflow"},
    +    "spec": {
    +        "template": {
    +            "spec": {
    +                "serviceAccountName": "model-registry-ui",
    +                "containers": [
    +                    {
    +                        "name": "model-registry-ui",
    +                        "image": IMAGE,
    +                        "args": ["--deployment-mode=kubeflow", "--port=8080"],
    +                    }
    +                ],
    +            }
    +        }
    +    },
    +}
    +
    +
    +class SharedRegistryImageTest(unittest.TestCase):
    +    def run_guard(
    +        self, expected_image=IMAGE, actual_image=None, change=None, fixture_change=None
    +    ):
    +        with tempfile.TemporaryDirectory(prefix="registry-image-test-") as directory:
    +            directory = Path(directory)
    +            intended = copy.deepcopy(DEPLOYMENT)
    +            intended["spec"]["template"]["spec"]["containers"][0][
    +                "image"
    +            ] = expected_image
    +            deployed = copy.deepcopy(intended)
    +            deployed["spec"]["template"]["spec"]["containers"][0]["image"] = (
    +                actual_image or expected_image
    +            )
    +            if change:
    +                change(deployed["spec"]["template"]["spec"])
    +            # A List with an unrelated first object prevents accidental reliance
    +            # on the renderer's resource ordering.
    +            fixture = {
    +                "apiVersion": "v1",
    +                "kind": "List",
    +                "items": [
    +                    {
    +                        "apiVersion": "v1",
    +                        "kind": "ServiceAccount",
    +                        "metadata": {"name": "model-registry-ui"},
    +                    },
    +                    intended,
    +                ],
    +            }
    +            if fixture_change:
    +                fixture_change(fixture)
    +            (directory / "fixture.json").write_text(json.dumps(fixture))
    +            (directory / "deployed.json").write_text(json.dumps(deployed))
    +            programs = {
    +                "kustomize": """import os
    +from pathlib import Path
    +print((Path(os.environ['IMAGE_TEST_DIRECTORY']) / 'fixture.json').read_text())
    +""",
    +                "kubectl": """import json, os, sys
    +from pathlib import Path
    +directory = Path(os.environ['IMAGE_TEST_DIRECTORY'])
    +arguments = sys.argv[1:]
    +if arguments == ['config', 'current-context']:
    +    print('kind-registry-image-test')
    +elif arguments[0] == 'create':
    +    assert '--dry-run=client' in arguments
    +    print(Path(arguments[arguments.index('-f') + 1]).read_text())

        fixture = json.loads(Path(arguments[arguments.index('-f') + 1]).read_text())
        for resource in fixture['items']:
            print(json.dumps(resource))
    

    Swayam-code Swayam-code commented on code on Oct 26, 2026 18:41 UTC
    Code Review
    tests/model_registry_egress_test.sh:1
    @@ -0,0 +1,76 @@
    +#!/bin/bash
    +set -euo pipefail
    +
    +profile_namespace=${1:-kubeflow-user-example-com}
    +registry_endpoint="http://model-registry-service.${profile_namespace}.svc.cluster.local:8080/api/model_registry/v1alpha3/registered_models"
    +probe_suffix="${RANDOM}"
    +ui_probe="registry-ui-egress-${probe_suffix}"
    +control_probe="registry-egress-control-${probe_suffix}"
    +
    +cleanup() {
    +    kubectl -n kubeflow delete pod "$ui_probe" "$control_probe" --ignore-not-found --wait=false
    +}
    +trap cleanup EXIT
    +
    +for probe_name in "$ui_probe" "$control_probe"; do
    +    application_label=registry-egress-control
    +    if [[ "$probe_name" == "$ui_probe" ]]; then
    +        application_label=model-registry-ui
    +    fi
    +    kubectl apply -f - <<EOF
    +apiVersion: v1
    +kind: Pod
    +metadata:
    +  name: ${probe_name}
    +  namespace: kubeflow
    +  labels:
    +    app: ${application_label}
    +spec:
    +  restartPolicy: Never
    +  automountServiceAccountToken: false
    +  # Keep probe Pods out of the shared UI Service endpoints.
    +  readinessGates:
    +  - conditionType: tests.kubeflow.org/egress-probe
    +  securityContext:
    +    runAsNonRoot: true
    +    runAsUser: 1000
    +    seccompProfile:
    +      type: RuntimeDefault
    +  containers:
    +  - name: registry-egress-probe
    +    image: busybox:1.37.0
    +    command: ["sleep", "600"]
    +    resources:
    +      requests:
    +        cpu: 10m
    +        memory: 16Mi
    +      limits:
    +        memory: 64Mi
    +    securityContext:
    +      allowPrivilegeEscalation: false
    +      capabilities:
    +        drop: ["ALL"]
    +EOF
    +done
    +kubectl -n kubeflow wait --for=condition=ContainersReady "pod/$ui_probe" "pod/$control_probe" --timeout=180s
    +kubectl -n kubeflow wait --for=condition=Ready=false "pod/$ui_probe" "pod/$control_probe" --timeout=10s
    +profile_token=$(kubectl -n "$profile_namespace" create token default-editor --duration=10m)
    +
    +assert_response() {
    +    local probe_name=$1
    +    local expected_status=$2
    +    shift 2
    +    local response
    +    response=$(kubectl -n kubeflow exec "$probe_name" -c registry-egress-probe -- \
    +        wget -S -O /dev/null -T 20 "$@" "$registry_endpoint" 2>&1) || true
    +    if ! grep -Eq "HTTP/1[.][01] ${expected_status} " <<< "$response"; then
    +        printf 'FAIL: %s expected HTTP %s\n%s\n' "$probe_name" "$expected_status" "$response" >&2
    +        return 1
    +    fi
    +    printf 'PASS: %s returned HTTP %s\n' "$probe_name" "$expected_status"
    +}
    +
    +assert_response "$ui_probe" 200 --header="Authorization: Bearer $profile_token"

    Fixed in 443ba97e: the guard now reads kubectl's JSON object stream, and the mock emits that format. All 23 focused cases and a real kubectl dry-run check passed; live mesh checks were not rerun.

    Swayam-code Swayam-code commented on code on Oct 26, 2026 18:50 UTC
    Code Review
    tests/model_registry_egress_test.sh:1
    @@ -0,0 +1,188 @@
    +#!/bin/bash
    +set -euo pipefail
    +
    +# This fixture deliberately changes routing and mesh policies in an ephemeral
    +# KinD test cluster. Never run it against a shared installation.
    +[[ $(kubectl config current-context) == kind-* ]] || {
    +    echo 'ERROR: the shared UI regression requires an isolated KinD test cluster.' >&2
    +    exit 1
    +}
    +profile_namespace=${1:-kubeflow-user-example-com}
    +gateway_endpoint=${GATEWAY_ENDPOINT:-http://localhost:8080}
    +registry_endpoint="http://model-registry-service.${profile_namespace}.svc.cluster.local:8080/api/model_registry/v1alpha3/registered_models"
    +ui_route="${gateway_endpoint}/model-registry/api/v1/model_registry/model-registry-service/registered_models?namespace=${profile_namespace}"
    +response_directory=$(mktemp -d)
    +control_probe="registry-egress-control-${RANDOM}"
    +policy_modified=false
    +sidecar_modified=false
    +
    +cleanup() {
    +    local result=$?
    +    trap - EXIT
    +    if [[ $policy_modified == true ]]; then
    +        kubectl apply -f "$response_directory/registry-policy.json" || result=1
    +    fi
    +    if [[ $sidecar_modified == true ]]; then
    +        kubectl apply -f "$response_directory/sidecar.json" || result=1
    +    fi
    +    kubectl -n kubeflow delete pod "$control_probe" --ignore-not-found --wait=false || result=1
    +    rm -rf "$response_directory"
    +    exit "$result"
    +}
    +trap cleanup EXIT
    +
    +# Remove server-managed fields so backups can also recreate deleted objects.
    +save_resource() {
    +    kubectl -n "$1" get "$2" "$3" -o json | python -c '
    +import json, sys
    +resource = json.load(sys.stdin)
    +resource.pop("status", None)
    +for field in ("resourceVersion", "uid", "creationTimestamp", "managedFields"):
    +    resource["metadata"].pop(field, None)
    +resource["metadata"].get("annotations", {}).pop("kubectl.kubernetes.io/last-applied-configuration", None)
    +json.dump(resource, sys.stdout)
    +' > "$4"
    +}
    +save_resource "$profile_namespace" authorizationpolicy model-registry-service "$response_directory/registry-policy.json"
    +save_resource kubeflow sidecar model-registry-ui-exception "$response_directory/sidecar.json"
    +
    +# Replace the profile-local UI route with the real shared application. The
    +# existing gateway, identity propagation and per-user access reviews remain.
    +shared_ui_manifest="$response_directory/shared-ui.yaml"
    +kustomize build tests/model_registry_shared_ui > "$shared_ui_manifest"
    +expected_ui_image=$(kubectl create --dry-run=client --validate=false -f "$shared_ui_manifest" -o json | python -c '

    Already addressed in 443ba97e: the Python guard decodes each JSON object directly, so it no longer expects a List or needs jq. The real kubectl output check and all 23 focused cases passed.

    Swayam-code Swayam-code commented on code on Oct 26, 2026 18:50 UTC
    Code Review
    tests/model_registry_egress_test.py:1
    @@ -0,0 +1,196 @@
    +#!/usr/bin/env python3
    +"""Exercise the shared UI fixture guard without a Kubernetes cluster."""
    +
    +import copy
    +import json
    +import os
    +import subprocess
    +import sys
    +import tempfile
    +import unittest
    +from pathlib import Path
    +
    +ROOT = Path(__file__).resolve().parents[1]
    +SCRIPT = Path(
    +    os.environ.get(
    +        "MODEL_REGISTRY_EGRESS_SCRIPT", ROOT / "tests/model_registry_egress_test.sh"
    +    )
    +)
    +BASH = os.environ.get("BASH_BINARY", "bash")
    +IMAGE = "ghcr.io/kubeflow/hub/ui:v0.3.18"
    +DEPLOYMENT = {
    +    "apiVersion": "apps/v1",
    +    "kind": "Deployment",
    +    "metadata": {"name": "model-registry-ui", "namespace": "kubeflow"},
    +    "spec": {
    +        "template": {
    +            "spec": {
    +                "serviceAccountName": "model-registry-ui",
    +                "containers": [
    +                    {
    +                        "name": "model-registry-ui",
    +                        "image": IMAGE,
    +                        "args": ["--deployment-mode=kubeflow", "--port=8080"],
    +                    }
    +                ],
    +            }
    +        }
    +    },
    +}
    +
    +
    +class SharedRegistryImageTest(unittest.TestCase):
    +    def run_guard(
    +        self, expected_image=IMAGE, actual_image=None, change=None, fixture_change=None
    +    ):
    +        with tempfile.TemporaryDirectory(prefix="registry-image-test-") as directory:
    +            directory = Path(directory)
    +            intended = copy.deepcopy(DEPLOYMENT)
    +            intended["spec"]["template"]["spec"]["containers"][0][
    +                "image"
    +            ] = expected_image
    +            deployed = copy.deepcopy(intended)
    +            deployed["spec"]["template"]["spec"]["containers"][0]["image"] = (
    +                actual_image or expected_image
    +            )
    +            if change:
    +                change(deployed["spec"]["template"]["spec"])
    +            # A List with an unrelated first object prevents accidental reliance
    +            # on the renderer's resource ordering.
    +            fixture = {
    +                "apiVersion": "v1",
    +                "kind": "List",
    +                "items": [
    +                    {
    +                        "apiVersion": "v1",
    +                        "kind": "ServiceAccount",
    +                        "metadata": {"name": "model-registry-ui"},
    +                    },
    +                    intended,
    +                ],
    +            }
    +            if fixture_change:
    +                fixture_change(fixture)
    +            (directory / "fixture.json").write_text(json.dumps(fixture))
    +            (directory / "deployed.json").write_text(json.dumps(deployed))
    +            programs = {
    +                "kustomize": """import os
    +from pathlib import Path
    +print((Path(os.environ['IMAGE_TEST_DIRECTORY']) / 'fixture.json').read_text())
    +""",
    +                "kubectl": """import json, os, sys
    +from pathlib import Path
    +directory = Path(os.environ['IMAGE_TEST_DIRECTORY'])
    +arguments = sys.argv[1:]
    +if arguments == ['config', 'current-context']:
    +    print('kind-registry-image-test')
    +elif arguments[0] == 'create':
    +    assert '--dry-run=client' in arguments
    +    print(Path(arguments[arguments.index('-f') + 1]).read_text())

    Already addressed in 443ba97e: the mock now prints each resource as a separate JSON object, with indentation matching real kubectl output. All 23 focused cases passed.

    Swayam-code Swayam-code commented on Oct 26, 2026 23:00 UTC
    Author

    @juliusvonkohout, could you please approve the fresh CI runs for 9d2add00? They currently show action_required. Thank you.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Oct 27, 2026 14:37 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🔵 Needs a closer look

    The cross-profile authorization change needs final human security review, with full-platform and Kubernetes 1.35 validation still outstanding.

    No open issues 🎉

    <sub>Review effort: Balanced</sub>

    christian-heusel christian-heusel commented on Oct 27, 2026 16:15 UTC
    Contributor

    /retest

    Swayam-code Swayam-code commented on Oct 27, 2026 20:54 UTC
    Author

    @juliusvonkohout, could you please approve the fresh CI runs for c55373d6? The Katib fix passed validation on Ubuntu 26.04. Thank you.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Oct 28, 2026 14:47 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🔵 Needs a closer look

    The tokenless Registry trust rule delegates cross-profile authorization to shared UI code outside this checkout, requiring security-owner confirmation of read and write isolation.

    No open issues 🎉

    <sub>Review effort: Balanced</sub>

    juliusvonkohout juliusvonkohout commented on Oct 28, 2026 16:40 UTC
    Contributor

    Thank you for the PR. I had to remove a lot of unecessary, inconsistent and duplicated stuff from the PR. Every line of code costs maintenance, so please be careful with what you add.

    juliusvonkohout juliusvonkohout commented on Oct 28, 2026 16:49 UTC
    Reviewer

    AI-assisted review

    Merge blocker: the unconditional shared UI trust introduces the source-supported cross-profile authorization bypass described in the inline finding.

    Required scope split

    This pull request must be split into mtwo PRs:

    1. The Model Registry UI cross-profile mTLS and authorization changes, their generated manifests, and the focused Model Registry regression test.
    2. Everything else: the Pipelines Python 3.12 runtime selection, runner change, SDK installation-command regression-test adjustment, and Katib diagnostics. Move these unrelated changes into separate pull requests.

    The Model Registry changes must not merge until the destination-authorization issue is resolved. Could we split the unrelated changes out and address the inline security finding before proceeding?

    Inotify prerequisites

    Please establish whether both documented limits are required:

  • sudo sysctl fs.inotify.max_user_instances=2280

  • sudo sysctl fs.inotify.max_user_watches=1255360
  • If needed, the KinD setup script must handle the required limits before cluster creation for both GitHub Actions and local execution, not only inside a GitHub Actions-specific condition. Raise only values below the necessary minima and preserve higher existing values. This setup change belongs with the separate CI/setup changes, not the Model Registry authorization fix. Could we justify the required limits and ensure consistent behavior in both execution paths?

    Validation: source inspection only; no live exploit reproduction or local CI execution.

    juliusvonkohout juliusvonkohout commented on code on Oct 28, 2026 16:49 UTC
    Code Review
    applications/hub/overlays/model-registry/shared-ui-authorization-policy.yaml:1
    @@ -0,0 +1,9 @@
    +# The shared UI uses internal authentication and authorizes each user through
    +# Kubernetes SubjectAccessReview before calling the Registry without a token.
    +- op: add
    +  path: /spec/rules/-
    +  value:
    +    from:
    +    - source:
    +        principals:
    +        - cluster.local/ns/kubeflow/sa/model-registry-ui

    [P1] Shared UI trust permits cross-profile redirect bypass

    This rule accepts tokenless requests from the shared UI identity without checking the originating user's permission at the destination Registry. Hub v0.3.18 checks access to the original namespace and Service, but its registered-model GET uses an ordinary HTTP client that follows redirects. A profile editor able to deploy a backend and Service in his own namespace can return a redirect to another profile's Registry. The follow-up request carries the trusted shared UI mTLS identity without another user access review, allowing cross-profile metadata disclosure.

    Source: client construction and GET, registered-model GET. This is source-supported, not a live exploit reproduction. The direct unauthorized-user and unrelated-workload checks do not cover redirected access.

    Could we withhold this unconditional grant until unsafe redirects are rejected and destination isolation is enforced, with a two-profile regression proving that an authorized request cannot be redirected into a Registry the user cannot access?

    juliusvonkohout juliusvonkohout commented on code on Oct 28, 2026 16:51 UTC
    Code Review
    applications/hub/overlays/model-registry/shared-ui-authorization-policy.yaml:1
    @@ -0,0 +1,9 @@
    +# The shared UI uses internal authentication and authorizes each user through
    +# Kubernetes SubjectAccessReview before calling the Registry without a token.
    +- op: add
    +  path: /spec/rules/-
    +  value:
    +    from:
    +    - source:
    +        principals:
    +        - cluster.local/ns/kubeflow/sa/model-registry-ui

    CC @tarilabs @ederign @pboyd

    Swayam-code Swayam-code commented on code on Oct 28, 2026 17:37 UTC
    Code Review
    applications/hub/overlays/model-registry/shared-ui-authorization-policy.yaml:1
    @@ -0,0 +1,9 @@
    +# The shared UI uses internal authentication and authorizes each user through
    +# Kubernetes SubjectAccessReview before calling the Registry without a token.
    +- op: add
    +  path: /spec/rules/-
    +  value:
    +    from:
    +    - source:
    +        principals:
    +        - cluster.local/ns/kubeflow/sa/model-registry-ui

    The unrelated CI/setup changes are now in #3660; scope cleanup is in 6cb79b7a. I have kept this PR in draft: the destination-authorization finding remains a merge blocker while I prepare the Hub fix for private security coordination.

    Assignees
    Swayam-code Swayam-code
    Labels
    risk: low confidence: 87.7% 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: 76.0% (HIGH) · Higher = larger blast radius
    76.0%
    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: 87.7% · Lower = rushed or shallow review
    87.7%
    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.3% · Safe to merge
    9.3%