Repository navigation
Description
Part of #14
What is wrong: The client cmapi-automation has the resource owner password grant on, and cmapi's own proof scripts and documents sign in with it. RFC 9700 (OAuth 2.0 Security Best Current Practice), section 2.4: "The resource owner password credentials grant [RFC6749] MUST NOT be used." The grant gives a person's password to the client, and it cannot do a second factor.
Where: on b83391c:
deploy/helm/cmapi/templates/keycloak-realm.yaml:169anddeploy/manifests/environments/crc/realm/10-realm-import.yaml:316:directAccessGrantsEnabled: trueforcmapi-automation.examples/cmapi-sso/realm/ephico2real.yaml:27has the same.deploy/crc-proof.sh:74and:85:grant_type=passwordforbot-userand for each LDAP test user.deploy/tests/realm-test.py:132and:162,docs/15-keycloak-integration.md:145,examples/local/INSTALL.md:509.
Realm cmapi is not on CRC yet (#157 stops the run), so the first import can still have the fix.
How to prove it: grep -n "directAccessGrantsEnabled: true" deploy/manifests/environments/crc/realm/10-realm-import.yaml deploy/helm/cmapi/templates/keycloak-realm.yaml prints two lines today. After the fix, a test of the realm files finds no client with the grant on, deploy/tests/realm-test.py gets 400 unauthorized_client for grant_type=password on each client of realm cmapi, and no script or document of cmapi has grant_type=password for realm cmapi.
Measured or inferred: Measured on 2026-11-13 by the grep above, by OB1 and by the coordinator (at 933274a). The contracts review of diagram-kit PR 64 found it.
Severity: High. A production realm made from these files accepts passwords on the token endpoint for a confidential client.
What must hold after the fix: No client of realm cmapi has directAccessGrantsEnabled: true. The bot signs in as a service account (client credentials). The proof of an LDAP person's token does not send that person's password to the token endpoint from a script.
Research: Mandate, before the code: (1) RFC 9700 section 2.4 and RFC 6749 section 4.4 for the bot. docs/02 says the automation account is bot-user with the role cmapi-onboarding and requireOnBehalfOf: find how cmapi's identity code reads a service-account token (preferred_username is service-account-cmapi-automation, with no employee_id), and what must change in core/identity. (2) How to prove that an LDAP-federated person gets a token with the right groups without the password grant: the authorization code flow with PKCE driven by a script (a form post to Keycloak's login page), a browser run with Playwright, the device authorization grant (RFC 8628), or token exchange and impersonation in Keycloak 26. State the choice and its sources in the pull request. (3) The local demo of examples/local uses the grant on a throwaway Keycloak: decide whether it changes too.
Solution (inline, not applied): Not written here.
Class: INV. The fix changes how the automation client signs in and adds a check that stops the grant from coming back.
Activity
oidc-login.py: the password goes only to an address under the issuer,…
SEC-06: the fixes of the second reader, and the record of the review
docs/01 and docs/02: the automation identity is a service client, and…
Merge main into no-password-grant, and move the citations of the real…
ephico2real2 commentedon Nov 13, 2026
In-QA: pull request #190 is ready, head
e62a79a. The realm test passed on a real Keycloak in GitHub'smanifestsjob (run 43511671215 onb3fb270): each of the 13 LDAP test users signs in by the login form,cmapi-automationsigns in with client credentials, each of the 14 clients refuses the password grant, and the sync brings an old realm to the new state. Codex's review is ruled indocs/reviews/2026-11-13-issue-181/README.md: five fixes accepted.docs/01anddocs/02are changed (live revisions 168 and 299). The checks run again one62a79a.Records at 22:15Z: #143, #179, #183, #178 merged; #181, #185, #186 in…
ephico2real2 commentedon Nov 13, 2026
Done: pull request #190 merged to
main. GitHub Actions run 43515015389 was green on the exact heade62a79a(six jobs). The realm test on a real Keycloak and OpenLDAP passed in themanifestsjob (realm cases failed: 0, first measured in run 43511671215): 13 LDAP test users sign in by the login form,cmapi-automationsigns in with client credentials, each of the 14 clients refuses the password grant, and the sync brings an old realm to the new state. Native on macOS: the service suite 562 passed,oidc-login-test.py20 cases. Review by Codexgpt-6.1-sol, ruled indocs/reviews/2026-11-13-issue-181/README.md. Not measured on CRC: realmcmapiis not there. #189 has the local demo.#841: realm-test sets up the state before #841 after the #181 sync, o…