Skip to content

Move the MU1 control plane into its own namespace — the harness SA can exec into it today #248

Closed as not planned

Description

@pdettori

MU1's control plane holds the Ed25519 session-signing key, the credential KEK and the shared exchange
token. It currently runs in namespace default, where the harness ServiceAccount holds unrestricted
pods/exec. That combination lets a process with code execution in the harness pod read all three
secrets, which defeats the mechanism behind the design's "the harness cannot mint a token" property.

Found by the whole-branch review of the MU1 branch. Documented honestly in spec §8.2 rather than left
implicit; this issue is the follow-up that closes it.

Why it is exploitable

Four facts compose:

Fact Where
Harness SA has pods/exec: ['create'] in default, no resourceNames deploy/knative/service.yaml:113-127
Control-plane Deployment also runs in default deploy/knative/control-plane.yaml:138
All three secrets are injected as env vars deploy/knative/control-plane.yaml:200-214
Harness egress to the API server on 443/6443 is deliberately allowed deploy/knative/harness-egress-policy.yaml:91-99

So: kubectl exec into deploy/sh-control-plane, read /proc/1/environ, mint an api-scoped token
for any subject, create a session as them, exchange it, and receive their real provider credential.
readOnlyRootFilesystem and runAsNonRoot do not help; both tiers run the same image, so a shell is
present.

The harness needs pods/exec — it is how agent code runs in sandbox pods — and the sandbox pool lives
in default, so the grant cannot be narrowed by namespace. The control plane is the thing that has to
move.

Why it is not urgent (but must land before the auth flip)

  • control-plane.yaml is not in the base kustomization, so no existing deployment gets the control
    plane at all. Pinned by a test.
  • SH_REQUIRE_AUTH defaults to false, so the authenticated path is not in use.
  • The exposure requires code execution in the harness pod specifically — the semi-trusted,
    model-influenced tier — not the sandbox tier where model code actually runs. It is not reachable
    directly from prompt injection.

It becomes real the moment a deployment turns SH_REQUIRE_AUTH=true in earnest. This should be
treated as a blocker on that flip, not on MU1's merge.

Proposed fix

Move the control-plane Deployment, Service and ServiceAccount into the sh-credentials namespace the
manifest already ships for its Secrets. Concretely, and this is deliberately a list rather than a
one-line change:

  1. control-plane.yaml — Deployment, Service and ServiceAccount namespaces.
  2. control-plane.yaml — both RoleBindings' subject namespaces follow the SA.
  3. control-plane.yaml — the pod-phase Role backing /resources must stay scoped to the workload
    namespace (default), so its RoleBinding becomes cross-namespace: Role in default, subject in
    sh-credentials. This is the part most likely to be got wrong.
  4. control-plane.yaml — the sh-control-plane-egress-from-harness NetworkPolicy breaks. A bare
    podSelector in an egress rule only matches pods in the policy's own namespace, so it needs a
    namespaceSelector for sh-credentials alongside the existing podSelector. That policy was added
    in the MU1 branch specifically to unblock this hop; moving the namespace without updating it
    re-breaks the exchange with a 503.
  5. service.yaml — SH_CONTROL_PLANE_URL becomes
    http://sh-control-plane.sh-credentials.svc:8080.
  6. demo-multiuser.sh — needs a second namespace variable, not a changed one. It currently uses
    $NS (default default, lib.sh:14) for 11 operations that would split across two namespaces: the
    three Secret creations, the teardown delete, rollout status and the port-forward move to the new
    namespace, while every ksvc operation stays in default.
  7. packages/knative-server/test/control-plane-manifest.test.ts — the namespace assertions and the
    NetworkPolicy composition cases.
  8. deploy/knative/SMOKE.md — any namespace-qualified commands.

Then create the Secrets in the new namespace, and confirm make demo-multiuser still passes end to end
on a live cluster — the manifest tests cannot catch a cross-namespace RBAC or NetworkPolicy mistake.

Guard already in place

The MU1 branch ships a CI tripwire so this cannot be forgotten, in
packages/knative-server/test/control-plane-manifest.test.ts (describe block
"SH_REQUIRE_AUTH=true must not ship while the control plane is collocated"):

  • a conjunction test that fails only when SH_REQUIRE_AUTH=true and the control-plane
    Deployment is still in default. Either half alone is legitimate — today ships 'false' + default,
    the end state is 'true' + sh-credentials — so only the combination is refused. Both halves are read
    from the manifests, not written as literals.
  • a canary test pinning the current shipped state, which fails if either half changes on its own. So
    a namespace move that forgot the flag, or a flag flip that forgot the namespace, both surface here.

Whoever flips the default gets a failing test whose message names the exposure, the fix, the
namespaceSelector trap in step 4 above, and spec §8.2 — instead of a silent regression.

When this issue is fixed, both cases need updating in the same change: the canary's expected
namespace, and the conjunction's notion of which namespace counts as collocated.

Alternatives considered

  • Narrow the harness Role's pods/exec with resourceNames — brittle: pool pod names are
    generated, so the list cannot be written ahead of time.
  • Mount the secrets as files instead of env vars — does not help. exec reads the filesystem too.
  • Leave it and rely on the tiering — rejected. The whole thesis of the design is moving the crown
    jewels out of the model-influenced pod, and this puts them one exec away.

Activity

  1. added
    enhancement
    on Sep 10, 2026
  2. pdettori commented on Sep 17, 2026

    @pdettori
    MemberAuthor

    Epic: rossoctl/rossoctl#2546 (Stream 1 — multi-tenancy/session isolation)

    Status update (2026-09-17)

    Still open. #249 (MU1 control plane) merged with the control
    plane deployed to the default namespace, which is what this issue flags. No PR against
    this issue has been opened yet — it remains a hardening follow-up on top of a merged,
    opt-in feature (SH_REQUIRE_AUTH=false by default), so it's not gating anything else in
    Stream 1.

    Assisted-By: Claude (Anthropic AI) [email protected]

  3. pdettori commented on Oct 15, 2026

    @pdettori
    MemberAuthor

    Status check, 2026-10-14. I propose closing this as not planned, with one caveat.

    Every fact in the table is about deploy/knative/ (service.yaml, control-plane.yaml, harness-egress-policy.yaml), which ADR-0041 deprecates (security and breakage fixes only, removal no earlier than the end of October 2026).

    On the first-class path the namespace split already exists. deploy/k8s/base/control-plane.yaml runs the control plane as moca-control-plane in namespace moca, with its credentials Secret in a separate moca-credentials namespace bound to that ServiceAccount. I have not checked whether the harness ServiceAccount there can still pods/exec into the control plane; a grep for pods/exec under deploy/k8s and deploy/vm found nothing.

    The caveat: docs/migrating-from-knative.md links this issue for people who run the control plane on the deprecated path during the migration window. If this is closed, the guide should state the exposure itself instead of pointing here.

    If anyone still on the Knative path wants the fix before removal, say so here or in #490.

  4. pdettori commented on Oct 15, 2026

    @pdettori
    MemberAuthor

    Closing as not planned. The exposure is specific to the deprecated deploy/knative/ path (ADR-0041) and will not be fixed there. #538 merged: the migration guide now states the exposure and the remedy (move the control plane out of the harness namespace, and the three things that move gets wrong) instead of pointing here.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions