Repository navigation
deploy/k8s ocp-combined: mount moca-oidc and the installer token, and read the token on the combined profile - #942
Merged
Conversation
…-oidc and reads the installer token ocp-combined restates the control plane's projected credentials list (the template-store component replaces it), and the restated list missed two sources ocp-sbx has: the optional moca-oidc Secret and moca-mu1's SH_INSTALLER_TOKEN item. So an SBX_IDENTITY_PROVIDER=oidc combined deployment had no SH_OIDC_CLIENT_SECRET file, and the installer bearer setup.sh generates on both profiles never reached the control plane. - ocp-combined/patch-control-plane.yaml: add both, as in ocp-sbx. - main.ts: the combined profile reads SH_INSTALLER_TOKEN as the sandbox profile does (installerTokenFromEnv, the same 32-character floor), and keeps it distinct from the host tokens; the members routes it admits are served on this profile too. - overlay-combined.test.sh: the combined control plane mounts the installer token and an optional moca-oidc, and every secret source and key ocp-sbx's control plane mounts (render of both overlays). - sandbox-config.test.ts: the combined profile reads the installer bearer. - docs/reference: the installer token is read on the sandbox and combined profiles. - docs/operate/day-2/upgrades.md (and the configuration row): an upgrade note that on combined the token setup.sh already generated becomes live. - docs/reference/security-model.md and the upgrade note: the installer token can grant the admin role, so treat it as admin-equivalent. Closes rossoctl#938 Assisted-By: Claude Code Signed-off-by: Rong Chang <[email protected]>
ingpaolodettori-dev
approved these changes
Nov 20, 2026
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Review — deploy/k8s ocp-combined: mount moca-oidc and the installer token, and read the token on the combined profile
Both halves of a real gap, and the guard against the next one is the best part of the diff.
- The overlay restates the combined credentials volume, and that restatement had drifted from ocp-sbx: no
SH_INSTALLER_TOKENitem and nomoca-oidcsource, so an OIDC combined deployment had no client-secret file and the bearer setup.sh generates on both profiles never arrived. Both are added,moca-oidcoptional: trueso a GitHub deployment renders as before. - The combined config now reads the token through the extracted
installerTokenFromEnv(same ≥32 check and message as the sandbox profile), adds it totemplateHosts' distinctness list so a host token cannot collide with it, and the combined config test pins read/short-refusal. - The test: rather than restating the expected keys by hand,
overlay-combined.test.shrenders ocp-sbx and asserts every control-plane credential source (name, optionality, every key) is present on combined. That is what would have caught this, and it will catch the next source added to one side only. - The security-model and users-and-roles updates are right to call the installer token admin-equivalent — it can grant the role — and the upgrade note's warning to rotate a possibly-shared token before the mount goes live (and to keep a key in place, since the item is not optional) is the correct operational instruction.
CI 18/18. Author: webchang (MEMBER — maintainer).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On the
combinedprofile, the control plane's credentials volume had nomoca-oidcsource and noSH_INSTALLER_TOKENitem, and the profile didn't read the installer token at all. So a combined deployment withSBX_IDENTITY_PROVIDER=oidchad no client-secret file, and the installer bearer thatdeploy/sbx/setup.shgenerates on both profiles never reached the control plane.What changes
deploy/k8s/overlays/ocp-combined/patch-control-plane.yaml: the restated credentials list (the template-store component replaces it) gains the two sourcesocp-sbxhas:moca-mu1'sSH_INSTALLER_TOKENitem and the optionalmoca-oidcSecret (SH_OIDC_CLIENT_SECRET). A GitHub deployment has nomoca-oidcSecret and renders as before.packages/control-plane/src/main.ts: the combined profile readsSH_INSTALLER_TOKENas the sandbox profile does, through oneinstallerTokenFromEnv(the same 32-character floor), and keeps it distinct from the host tokens. The members routes it admits are served on this profile too, and the router's installer check is profile-agnostic, so nothing else changes.docs/reference/configuration.md,users-and-roles.mdandsecurity-model.mdsay the token is read on thesandboxandcombinedprofiles. openapi'sinstallerTokenscheme still says "(sandbox members API)": that names the API, not the profile, so it's unchanged.docs/operate/day-2/upgrades.md, linked from the configuration row): on the combined profile, the tokensetup.shalready generated becomes live at this upgrade; rotate it first if it may have been shared. The note anddocs/reference/security-model.mdalso say the token can grant the admin role (PUT /v1/subjects/{subject}/roles/admin), so it reaches admin powers in one indirect step through that subject's own login: treat it as admin-equivalent. The mount needs the key present, so it shouldn't be deleted.Why keep it working on combined, rather than generate it only for
sandbox: the members routes are served on the combined profile too (routes.ts~702-710), andsetup.shalready generates the token there (:914-935), so the profile was meant to have it. Once this is rolled out, combined accepts the bearer: any combined deployment that already ran the generatingsetup.shgains a members-admin credential at the upgrade, which is what the upgrade note says.Tests
deploy/sbx/tests/overlay-combined.test.sh: renders both overlays and checks that the combined control plane mounts the installer token, an optionalmoca-oidc, and every secret source and key thatocp-sbx's control plane mounts, with the sameoptional. Before the fix it fails ("the control plane does not mount SH_INSTALLER_TOKEN"); with only the token added andmoca-oidcstill missing, the comparison alone fails ("ocp-sbx's control plane mounts Secret moca-oidc but the combined one does not"). After: passes;overlay.test.shstill passes.packages/control-plane/test/sandbox-config.test.ts: the combined profile reads the installer bearer and refuses a short one. Fails before (1 of 33), passes after; the control-plane suite passes (2,008, 3 skipped), andtsc --noEmitis clean.Closes #938
Assisted-By: Claude Code