Repository navigation
docs: state the deprecated path's control-plane exposure in the migration guide - #538
Conversation
…tion guide The guide pointed at rossoctl#248 for the control-plane namespace collocation on deploy/knative. That path is deprecated (ADR-0041) and the fix will not land there, so say what the exposure is and what to do about it instead of linking an issue we intend to close. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Thanks, this is a clearer statement than the #248 pointer. I checked the facts against main: the harness Role grants pods/exec: create in default with no resourceNames, the control plane is collocated with its three secrets as env vars, and deploy/k8s splits the control plane (moca) from credentials (moca-credentials) with no pods/exec grant. All accurate.
One blocker: the remediation tells operators to remove pods/exec from the harness Role. That breaks the Knative harness, which reaches sandbox pods through that grant (see inline). Two nits on precision.
Author: pdettori (MEMBER, maintainer) · Areas: Docs · .claude/.vscode: none · Commits: 1, signed-off · CI: passing
| can therefore `kubectl exec` into the control plane and read its Ed25519 session-signing key, the | ||
| credential KEK and the shared exchange token, which defeats the "the harness cannot mint a token" | ||
| property. It will not be fixed on this path. If you run the control plane there during the window, | ||
| move it to its own namespace and remove `pods/exec` from the harness Role yourself, or move to |
There was a problem hiding this comment.
must-fix: removing pods/exec from the harness Role breaks the deployment. The Knative harness runs agent code in the sandbox pool through pods/exec (KAGENTI_SANDBOX_POOL_SELECTOR in service.yaml, Role serverless-harness-sandbox), and the pool lives in default. As #248 says, the grant can't be narrowed, so the control plane is what has to move. Since the Role is namespace-scoped, moving the control plane out of default is enough on its own.
Please drop the pods/exec advice. Also name the parts a bare namespace move gets wrong, or link #248's list: the /resources pod Role stays in default and needs a cross-namespace RoleBinding, sh-control-plane-egress-from-harness needs a namespaceSelector (otherwise every exchange returns 503), and SH_CONTROL_PLANE_URL in service.yaml changes.
| in the same namespace (`default`) as the harness, and the harness ServiceAccount holds | ||
| `pods/exec: create` there with no `resourceNames`. A process with code execution in a harness pod | ||
| can therefore `kubectl exec` into the control plane and read its Ed25519 session-signing key, the | ||
| credential KEK and the shared exchange token, which defeats the "the harness cannot mint a token" |
There was a problem hiding this comment.
nit: the harness already holds the exchange token by design (service.yaml mounts SH_EXCHANGE_TOKEN into the harness from the same Secret), so exec doesn't newly expose it. What exec adds is the signing key and the KEK. Maybe: "…read its Ed25519 session-signing key and the credential KEK (the exchange token is already in the harness), which defeats…"
| - If you run the control plane on the deprecated K8s path during the window, #248's | ||
| namespace-collocation consideration still applies to it, unchanged by the deprecation. | ||
| - **Control-plane exposure on the deprecated K8s path.** `deploy/knative/` runs the control plane | ||
| in the same namespace (`default`) as the harness, and the harness ServiceAccount holds |
There was a problem hiding this comment.
nit: setup-k8s.sh --namespace rewrites namespace: default, so "the same namespace (default unless you passed --namespace)" is more exact. The collocation holds either way.
Drop the advice to remove pods/exec from the harness Role (the harness needs it to reach sandbox pods), say the control plane is what moves, list the three things a bare namespace move gets wrong, and correct the exposure list and the namespace wording. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
|
Thanks, all three addressed in 9ce51d8.
I confirmed the names above against |
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Thanks. 9ce51d8 addresses all three comments from the 240f9da round. I checked the new text against deploy/knative/ at this head:
- must-fix (drop the
pods/execremoval): fixed. The bullet now says the grant can't be narrowed and that the control plane is what moves. "The Role is namespace-scoped, so that alone closes the exec path" is right:serverless-harness-sandboxis aRolein the harness namespace (service.yaml:111-127), not a ClusterRole. The three names hold up:sh-control-plane-pods(control-plane.yaml:135),sh-control-plane-egress-from-harness(:316, a podSelector-onlytopeer), andSH_CONTROL_PLANE_URL(service.yaml:75). - nit (exchange token): fixed. service.yaml:81 does mount
SH_EXCHANGE_TOKENinto the harness. - nit (
--namespace): fixed. setup-k8s.sh:149 sedsnamespace: default.
One suggestion inline: the "three things" list is incomplete. That's partly on us, because our previous comment listed only those three. #248's checklist has more, and one of the missing items breaks every exchange.
Approving, since the suggestion is non-blocking.
| pods, so it cannot be narrowed; the control plane is what has to move. If you run it there during | ||
| the window, move it to its own namespace (the Role is namespace-scoped, so that alone closes the | ||
| exec path), or move to `deploy/k8s`, which keeps the control plane in `moca` and its credentials | ||
| in a separate `moca-credentials` namespace. A bare namespace move gets three things wrong: |
There was a problem hiding this comment.
suggestion: "three things" undercounts, and that's partly our fault, since our last comment named only these three. A bare move following this list still misses two things from #248's checklist:
- The credential-store RoleBinding subject.
sh-control-plane-credentialsinsh-credentialsbinds subjectsh-control-planein namespacedefault(control-plane.yaml:117-128). Once the SA moves, the control plane loses get/create on the per-user credential Secrets, so exchanges fail even with the NetworkPolicy fixed. Move the MU1 control plane into its own namespace — the harness SA can exec into it today #248 step 2: "both RoleBindings' subject namespaces follow the SA." - The Secrets.
secretKeyRefis same-namespace, sosh-session-token-key,sh-credential-kekandsh-exchange-token(control-plane.yaml:235-246) have to be created in the new namespace.sh-exchange-tokenalso has to stay in the harness namespace, because the harness mounts it from there (service.yaml:81).
Suggest rewording to "A bare namespace move also has to update:", listing these, and linking #248 for the full checklist (it also covers setup-k8s.sh and the manifest test). That keeps the guide from implying the list is exhaustive.
Summary
deploy/knative/the control plane shares namespacedefaultwith the harness, whose ServiceAccount holdspods/exec: createwith noresourceNames. Code execution in a harness pod can read the session-signing key, the credential KEK and the exchange token.pods/execfrom the harness Role, or move todeploy/k8s, which already keeps the control plane inmocaand its credentials inmoca-credentials.This lets #248 be closed as not planned: every fact in it is about
deploy/knative/(ADR-0041).Not verified
I did not inspect the
deploy/k8sRBAC beyond a grep forpods/execunderdeploy/k8sanddeploy/vm, which found nothing. The namespace split is read fromdeploy/k8s/base/control-plane.yaml.Follow-up
ADR-0041 and the RA1 spec still say "follow-up owed: #248". Both are historical records, so I left them. Say if you want them amended.
Refs #248.
🤖 Generated with Claude Code