Repository navigation
Conversation
clawgenti
left a comment
There was a problem hiding this comment.
Straightforward cleanup: removes the stale keycloak-admin-secret documentation section and the corresponding orphaned --set keycloak.adminUsername/adminPassword flags that were silently no-ops. All checks pass. Ready for human review.
Reviewed by clawgenti using github:pr-review
aec6c66 to
38747bf
Compare
|
This fix is a stepping stone toward #2174 — removing the credential-provisioning mechanism entirely in favor of SPIFFE-based Keycloak authentication. |
clawgenti
left a comment
There was a problem hiding this comment.
Straightforward doc and script cleanup — removes the stale keycloak-admin-secret section and the orphaned --set keycloak.adminUsername/adminPassword flags that were silently no-ops. All CI checks pass. Ready for human review.
Reviewed by clawgenti using github:pr-review
| ## Keycloak Admin Credentials for Agent Namespaces | ||
|
|
||
| The [AuthBridge](https://github.com/kagenti/kagenti-extensions/tree/main/authbridge) stack (separate sidecars or a single [combined `authbridge` container](authbridge-combined-sidecar.md)) needs Keycloak admin credentials for automatic OAuth2 client registration. These credentials are stored in a Kubernetes Secret called `keycloak-admin-secret` in each agent namespace. | ||
| The [AuthBridge](https://github.com/kagenti/kagenti-extensions/tree/main/authbridge) stack needs Keycloak admin credentials for automatic OAuth2 client registration. These credentials are provisioned automatically at install time by the `kagenti-agent-oauth-secret-job` Helm Job — no manual configuration is required. |
There was a problem hiding this comment.
The security note below says that admin credentials aren't needed and recommends a service account with limited permissions. Maybe say that instead of "needs admin account"?
Do we want the sidecar to have the power to do OAuth2 client registration? This seems scary from a security perspective -- can the Kagenti operator be tricked into giving Keycloak credentials to pods that aren't necessarily sidecars owned by the system? Id would prefer to never see any pods have Keycloak permissions that aren't under the management of a Kagenti service account.
mrsabath
left a comment
There was a problem hiding this comment.
Summary
The script change is correct and a genuine fix — but the docs rewrite is inaccurate and, as written, would make docs/install.md contradict docs/identity-guide.md in the same repo. Requesting changes on the docs half only.
✅ What's right
- Removing
--set keycloak.adminUsername/keycloak.adminPasswordfromscripts/ocp/setup-kagenti.sh— verified againstcharts/kagenti/values.yaml: those keys don't exist, so the flags were silently ignored on every run. Good cleanup. - The new
adminSecretName/adminUsernameKey/adminPasswordKeyvalues documented for the Job are real — they exist invalues.yaml(lines 261-263) and are wired intotemplates/agent-oauth-secret-job.yaml(envKEYCLOAK_ADMIN_SECRET_NAMEetc.). Accurate.
❌ What blocks (docs accuracy)
The rewrite's premise — that keycloak-admin-secret is a "no-longer-existing mechanism" — is not correct. That secret is still a live, security-relevant part of client registration; it moved, it wasn't removed (kagenti-operator#321):
docs/identity-guide.md(this PR doesn't touch it) still documents it as current: "the operator reads Keycloak admin credentials fromkeycloak-admin-secretin the operator namespace (kagenti-system)" (lines 264, 479, 628).- The operator's ClientRegistrationReconciler reads it, and the AuthBridge client-registration sidecar mounts it — see
.github/scripts/kagenti-operator/36-fix-keycloak-admin.shand.github/scripts/kind/91-run-authbridge-weather-e2e.sh("the client-registration sidecar … mounts this secret from the pod's namespace. Since operator#321 the secret lives only in kagenti-system").
Separately, the PR conflates two different secrets: keycloak-admin-secret is the admin credential the reconciler/sidecar authenticate with; the kagenti-agent-oauth-secret-job reads keycloak-initial-admin to provision the per-agent OAuth client secrets. Replacing the whole admin-credentials section with a description of the OAuth-client Job drops the mechanism identity-guide.md still relies on.
Suggested fix: rather than deleting the section, retarget it to the actual current state — keycloak-admin-secret is now operator-managed in kagenti-system (operator#321), and cross-link identity-guide.md. The orphaned---set-flags removal is independently correct and can stay.
Areas reviewed: Docs (accuracy/cross-consistency), Shell, Commit/PR conventions
Commits: 1 commit, signed-off (DCO passes)
CI status: green except Deploy & Test (pending)
Verdict: REQUEST_CHANGES — 1 must-fix docs-accuracy issue; script change approved.
| ## Keycloak Admin Credentials for Agent Namespaces | ||
|
|
||
| The [AuthBridge](https://github.com/kagenti/kagenti-extensions/tree/main/authbridge) stack (separate sidecars or a single [combined `authbridge` container](authbridge-combined-sidecar.md)) needs Keycloak admin credentials for automatic OAuth2 client registration. These credentials are stored in a Kubernetes Secret called `keycloak-admin-secret` in each agent namespace. | ||
| The [AuthBridge](https://github.com/kagenti/kagenti-extensions/tree/main/authbridge) stack needs Keycloak admin credentials for automatic OAuth2 client registration. These credentials are provisioned automatically at install time by the `kagenti-agent-oauth-secret-job` Helm Job — no manual configuration is required. |
There was a problem hiding this comment.
must-fix. This declares keycloak-admin-secret gone, but it's still live — it moved to kagenti-system (kagenti-operator#321), it wasn't removed. docs/identity-guide.md (lines 264/479/628) documents the operator's ClientRegistrationReconciler reading it from the operator namespace, and the AuthBridge client-registration sidecar mounts it (.github/scripts/kind/91-run-authbridge-weather-e2e.sh).
Also, the kagenti-agent-oauth-secret-job reads keycloak-initial-admin to create the per-agent OAuth client secrets — a different secret and purpose than the keycloak-admin-secret admin credential the reconciler/sidecar use. Please retarget this section to the real current state (operator-managed keycloak-admin-secret in kagenti-system) and cross-link identity-guide.md, rather than describing it as removed.
| --from-literal=KEYCLOAK_ADMIN_PASSWORD=admin \ | ||
| --dry-run=client -o yaml | kubectl apply -f - | ||
| ``` | ||
| ### Manual Sync (break-glass) |
There was a problem hiding this comment.
must-fix (internal contradiction). This break-glass snippet recreates keycloak-admin-secret — the very secret the top of the section calls "no-longer-existing" — and does so in the agent namespaces (team1/team2). Per operator#321 the operator now reads it from kagenti-system, so a manual sync into agent namespaces targets the wrong place. If a manual-sync path is kept, it should write to kagenti-system (or match wherever the sidecar mounts it), and the section shouldn't simultaneously claim the secret no longer exists.
esnible
left a comment
There was a problem hiding this comment.
Clean, well-scoped docs + script correction. I verified every removed and added value name against upstream/main:
- ✅
keycloak.adminUsername/keycloak.adminPassword/keycloak.adminExistingSecretand thekeycloak-admin-secretname are all gone fromcharts/kagenti/— the removed--setflags insetup-kagenti.shwere genuine no-ops. - ✅ The new documented values (
adminSecretName,adminUsernameKey,adminPasswordKey) exist incharts/kagenti/values.yaml. - ✅
kagenti-agent-oauth-secret-jobexists and readskeycloak-initial-adminat deploy time (RBAC scoped toadminSecretName), matching the new description. - ✅
KC_ADMIN_FLAGSremoved cleanly with no dangling references; thehelm upgradeblock is intact.
One suggestion inline about the break-glass snippet. Leaving as a comment (not an approval).
Author: Alan-Cha (MEMBER — maintainer) · Areas: Docs, Shell · Agent/IDE config: none · CI: passing (Deploy & Test still pending)
Assisted-By: Claude Code
| KC_PASS=$(kubectl get secret keycloak-initial-admin -n keycloak -o jsonpath='{.data.password}' | base64 -d) | ||
|
|
||
| for ns in team1 team2; do | ||
| kubectl create secret generic keycloak-admin-secret -n $ns \ |
There was a problem hiding this comment.
suggestion — This break-glass snippet manually creates a secret named keycloak-admin-secret, but this PR's whole thesis is that keycloak-admin-secret is no longer part of the mechanism. The Job (kagenti-agent-oauth-secret-job) reads keycloak-initial-admin and registers the OAuth clients directly — it never consumes a per-namespace keycloak-admin-secret. So this manual kubectl create secret recreates an obsolete secret that nothing reads, and likely has no effect.
The helm upgrade re-run documented just above is the correct break-glass path. Consider dropping this kubectl create secret alternative so the fix doesn't reintroduce the exact stale-secret confusion it's removing.
|
Thanks for the thorough review @mrsabath and @esnible. You're both right — I incorrectly described Fixed in the two new commits:
|
clawgenti
left a comment
There was a problem hiding this comment.
Docs and script fix looks correct at HEAD (f8e9dd25): keycloak-admin-secret is accurately described as living in kagenti-system, the two-secret table clearly separates admin creds from per-agent OAuth client secrets, the break-glass snippet targets the right namespace and key names, and the orphaned --set flags are cleanly removed from setup-kagenti.sh. All CI checks pass.
All checks pass. Ready for human review.
Reviewed by clawgenti using github:pr-review
mrsabath
left a comment
There was a problem hiding this comment.
Both must-fix items from my earlier review are resolved — verified against upstream/main:
keycloak-admin-secretaccuracy: the section no longer claims it was removed. The two-secret table correctly separates the operator-managed admin credential (keycloak-admin-secretinkagenti-system, per operator#321) from the per-agent OAuth client secrets, and cross-linksidentity-guide.md. Consistent withidentity-guide.mdlines 264/479/628.- Break-glass snippet: now targets
kagenti-systemwith the same secret name andKEYCLOAK_ADMIN_USERNAME/KEYCLOAK_ADMIN_PASSWORDkeys as the authoritative installer36-fix-keycloak-admin.sh. Correct.
The orphaned --set keycloak.adminUsername/adminPassword removal was independently correct — those keys don't exist in values.yaml, so the flags were silent no-ops.
All static CI checks pass. Verdict: APPROVE.
The kagenti-agent-oauth-secret-job already reads credentials from keycloak-initial-admin at deploy time — no Helm value overrides are needed. Remove the defunct adminUsername/adminPassword --set flags from setup-kagenti.sh and update install.md to describe the actual mechanism instead of the old hardcoded-credentials approach. Closes #1337 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Alan Cha <[email protected]>
… removed Correct the install.md rewrite per reviewer feedback: - keycloak-admin-secret is still live, it moved to kagenti-system (operator#321); it was not removed - Clarify the two distinct secrets: keycloak-admin-secret (admin creds in kagenti-system) vs per-agent OAuth client secrets (agent namespaces) - Fix break-glass snippet to target kagenti-system, not agent namespaces - Cross-link identity-guide.md for the full client-registration flow Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Alan Cha <[email protected]>
The keycloak-admin-secret uses KEYCLOAK_ADMIN_USERNAME and KEYCLOAK_ADMIN_PASSWORD as keys (matching 36-fix-keycloak-admin.sh), not the generic username/password keys from keycloak-initial-admin. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Alan Cha <[email protected]>
…ence - Rename section from 'Keycloak Admin Credentials for Agent Namespaces' to 'Keycloak Client Registration' to reflect the actual mechanism - Add mode comparison table: client secrets (default) vs SPIFFE auth (recommended) with link to spiffe-keycloak-auth.md - Remove stale reference to 'AuthBridge client-registration sidecar' (removed in #1422) - Replace generic security note with concrete SPIFFE recommendation Signed-off-by: Alan Cha <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Alan Cha <[email protected]>
25d250a to
110b780
Compare
…eycloak-auth.md Signed-off-by: Alan Cha <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Alan Cha <[email protected]>
|
Superseded by #2211 which consolidates the install.md fixes along with a full symmetric authentication guide. |
|
All four comments are addressed in the superseding PR #2211. The
|
…n.md
- Create docs/authentication.md covering both auth modes with equal depth:
- Client secrets (default): admin credential flow, provisioning,
break-glass sync, how-it-works diagram
- SPIFFE auth (recommended): JWT-SVID/Keycloak mechanics, operator
bootstrap job flow, agent flow, prerequisites, Helm values
- Shared sections: verification commands for both modes, troubleshooting
- Simplify docs/install.md: replace the verbose
'Keycloak Admin Credentials for Agent Namespaces' section with a
two-sentence summary that links to authentication.md
- scripts/ocp/setup-kagenti.sh: remove orphaned KC_ADMIN_FLAGS block
(keycloak.adminUsername / keycloak.adminPassword chart values do not
exist in templates; the bootstrap Job reads credentials directly from
the keycloak-initial-admin Secret)
Supersedes PR rossoctl#2155 and PR rossoctl#2208.
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Alan Cha <[email protected]>
Summary
docs/install.mdthat described a no-longer-existing mechanism (keycloak-admin-secret,keycloak.adminUsername,keycloak.adminPassword,keycloak.adminExistingSecret)kagenti-agent-oauth-secret-jobreadskeycloak-initial-adminat deploy time--set keycloak.adminUsername/--set keycloak.adminPasswordflags fromscripts/ocp/setup-kagenti.sh— these values don't exist in any chart template, so they were silently ignored on every upgradeRoot cause
The chart was already fixed (credentials are provisioned by a Job that reads
keycloak-initial-admindirectly), but the docs and the OCP setup script were never updated to match.Test plan
helm templatestill renders without errorsetup-kagenti.shcompletes without referencing removed flagsCloses #1337
Assisted-By: Claude Code