Configure the IdP admin client on the dogfood and verify Users & access end to end #346
Closed
opened 2026-08-27 23:56:11 +00:00 by Cordy
·
6 comments
No Branch/Tag specified
main
b12v07
b11v07
b10v07
ci-rc-publish
fx15-s3dry
b9v07
b8v07
bench742
b7v07
legal-texts-v0.2
b6v07
b5v07
b4v07
b3v07
sx1139
st742
b2v07
ix1102
fu1098
zp1097
wd1099
tr1100
qf1077
nc1070
ci1
rp1072
lk1073
ab1071
fi1074
si1070
ra1054
wo1056
oc1057
tf1055
sv1063
fg1059
st1058
fs929
mu1039
ls1033
cf975
lf835
dx1023
ml896
a11y2
av1022
r913
r7
r6
r5
r45
r23
r1
b10
b9
fix-b5
fix-b4
fix-b3
fix-b2
fix-b1
fix-922
fix-923
fix-911
fix-343b
batch-a
v0.6.413
v0.6.412
v0.6.411
v0.6.410
v0.6.409
v0.6.408
v0.6.407
v0.6.406
v0.6.405
v0.6.404
v0.6.403
v0.6.402
v0.6.401
v0.6.400
v0.6.399
v0.6.398
v0.6.397
v0.6.396
v0.6.395
v0.6.394
v0.6.393
v0.6.392
v0.6.391
v0.6.390
v0.6.389
v0.6.388
v0.6.387
v0.6.386
v0.6.385
v0.6.384
v0.6.383
v0.6.382
v0.6.381
v0.6.380
v0.6.379
v0.6.378
v0.6.377
v0.6.376
v0.6.375
v0.6.374
v0.6.373
v0.6.372
v0.6.371
v0.6.370
v0.6.369
v0.6.368
v0.6.367
v0.6.366
v0.6.365
v0.6.364
v0.6.363
v0.6.362
v0.6.361
v0.6.360
v0.6.359
v0.6.358
v0.6.357
v0.6.356
v0.6.355
v0.6.354
v0.6.353
v0.6.352
v0.6.351
v0.6.350
v0.6.349
v0.6.348
v0.6.347
v0.6.346
v0.6.345
v0.6.344
v0.6.343
v0.6.342
v0.6.341
v0.6.340
v0.6.339
v0.6.338
v0.6.337
v0.6.336
v0.6.335
v0.6.334
v0.6.333
v0.6.332
v0.6.331
v0.6.330
v0.6.329
v0.6.328
v0.6.327
v0.6.326
v0.6.325
v0.6.324
v0.6.323
v0.6.322
v0.6.321
v0.6.320
v0.6.319
v0.6.318
v0.6.317
v0.6.316
v0.6.315
v0.6.314
v0.6.313
v0.6.312
v0.6.311
v0.6.310
v0.6.309
v0.6.308
v0.6.307
v0.6.306
v0.6.305
v0.6.304
v0.6.303
v0.6.302
v0.6.301
v0.6.300
v0.6.299
v0.6.298
v0.6.297
v0.6.296
v0.6.295
v0.6.294
v0.6.293
v0.6.292
v0.6.291
v0.6.290
v0.6.289
v0.6.288
v0.6.287
v0.6.286
v0.6.285
v0.6.284
v0.6.283
v0.6.282
v0.6.281
v0.6.280
v0.6.279
v0.6.278
v0.6.277
v0.6.276
v0.6.275
v0.6.274
v0.6.273
v0.6.272
v0.6.271
v0.6.270
v0.6.269
v0.6.268
v0.6.267
v0.6.266
v0.6.265
v0.6.264
v0.6.263
v0.6.262
v0.6.261
v0.6.260
v0.6.259
v0.6.258
v0.6.257
v0.6.256
v0.6.255
v0.6.254
v0.6.253
v0.6.252
v0.6.251
v0.6.250
v0.6.249
v0.6.248
v0.6.247
v0.6.246
v0.6.245
v0.6.244
v0.6.243
v0.6.242
v0.6.241
v0.6.240
v0.6.239
v0.6.238
v0.6.237
v0.6.236
v0.6.235
v0.6.234
v0.6.233
v0.6.232
v0.6.231
v0.6.230
v0.6.229
v0.6.228
v0.6.227
v0.6.226
v0.6.225
v0.6.224
v0.6.223
v0.6.222
v0.6.221
v0.6.220
v0.6.219
v0.6.218
v0.6.217
v0.6.216
v0.6.215
v0.6.214
v0.6.213
v0.6.212
v0.6.211
v0.6.210
v0.6.209
v0.6.208
v0.6.207
v0.6.206
v0.6.205
v0.6.204
v0.6.203
v0.6.202
v0.6.201
v0.6.200
v0.6.199
v0.6.198
v0.6.197
v0.6.196
v0.6.195
v0.6.194
v0.6.193
v0.6.192
v0.6.191
v0.6.190
v0.6.189
v0.6.188
v0.6.187
v0.6.186
v0.6.185
v0.6.184
v0.6.183
v0.6.182
v0.6.181
v0.6.180
v0.6.179
v0.6.178
v0.6.177
v0.6.176
v0.6.175
v0.6.174
v0.6.173
v0.6.172
v0.6.171
v0.6.170
v0.6.169
v0.6.168
v0.6.167
v0.6.166
v0.6.165
v0.6.164
v0.6.163
v0.6.162
v0.6.161
v0.6.160
v0.6.159
v0.6.158
v0.6.157
v0.6.156
v0.6.155
v0.6.154
v0.6.153
v0.6.152
v0.6.151
v0.6.150
v0.6.149
v0.6.148
v0.6.147
v0.6.146
v0.6.145
v0.6.144
v0.6.143
v0.6.142
v0.6.141
v0.6.140
v0.6.139
v0.6.138
v0.6.137
v0.6.136
v0.6.135
v0.6.134
v0.6.133
v0.6.132
v0.6.131
v0.6.130
v0.6.129
v0.6.128
v0.6.127
v0.6.126
v0.6.125
v0.6.124
v0.6.123
v0.6.122
v0.6.121
v0.6.120
v0.6.119
v0.6.118
v0.6.117
v0.6.116
v0.6.115
v0.6.114
v0.6.113
v0.6.112
v0.6.111
v0.6.110
v0.6.109
v0.6.108
v0.6.107
v0.6.106
v0.6.105
v0.6.104
v0.6.103
v0.6.102
v0.6.101
v0.6.100
v0.6.99
v0.6.98
v0.6.97
v0.6.96
v0.6.95
v0.6.94
v0.6.93
v0.6.92
v0.6.91
v0.6.90
v0.6.89
v0.6.88
v0.6.87
v0.6.86
v0.6.85
v0.6.84
v0.6.83
v0.6.82
v0.6.81
v0.6.80
v0.6.79
v0.6.78
v0.6.77
v0.6.76
v0.6.75
v0.6.74
v0.6.73
v0.6.72
v0.6.71
v0.6.70
v0.6.69
v0.6.68
v0.6.67
v0.6.66
v0.6.65
v0.6.64
v0.6.63
v0.6.62
v0.6.61
v0.6.60
v0.6.59
v0.6.58
v0.6.57
v0.6.56
v0.6.55
v0.6.54
v0.6.53
v0.6.52
v0.6.51
v0.6.50
v0.6.49
v0.6.48
v0.6.47
v0.6.46
v0.6.45
v0.6.44
v0.6.43
v0.6.42
v0.6.41
v0.6.40
v0.6.39
v0.6.38
v0.6.37
v0.6.36
v0.6.35
v0.6.34
v0.6.33
v0.6.32
v0.6.31
v0.6.30
v0.6.29
v0.6.28
v0.6.25
v0.6.24
v0.6.23
v0.6.22
v0.6.21
v0.6.20
v0.6.19
v0.6.18
v0.6.17
v0.6.16
v0.6.15
v0.6.14
v0.6.12
v0.6.11
v0.6.10
v0.6.9
v0.6.8
v0.6.7
v0.6.6
v0.6.5
v0.6.4
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.7
v0.5.6
v0.5.5
v0.5.4
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.12
v0.4.11
v0.4.10
v0.4.9
v0.4.8
v0.4.7
v0.4.6
v0.4.5
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.3.30
v0.3.29
v0.3.28
v0.3.27
v0.3.26
v0.3.25
v0.3.24
v0.3.23
v0.3.22
v0.3.21
v0.3.20
v0.3.19
v0.3.18
v0.3.17
v0.3.16
v0.3.15
v0.3.14
v0.3.13
v0.3.12
v0.3.11
v0.3.10
v0.3.9
v0.3.8
v0.3.7
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.7
v0.2.6
v0.2.5
v0.2.4
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.0.3
v0.0.2
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference: Cordy/Cairn#346
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #345, which built the Users & access page. The page is correct today but the dogfood only exercises its degraded half, so the interesting path has never actually run against a real directory.
Current state on
cairn-encauth.groups.keycloak*is not configured, sospacesMgris nil, soAdmin.GroupMembersis nil. The page therefore shows:OpenID Connect · <issuer>· ConnectedThat is the designed behaviour (a partial list would look authoritative), but it means the resolved path — member count, administrator rows, "You", "Signed in now" / "Last active" — has only ever been exercised by unit tests with a stubbed
GroupMembers.Work
1. Keycloak service account
Against the test IdP (192.168.10.248, realm
cordyceps):realm-managementclient rolesview-usersandquery-groups.manage-users. Reading a group to display it never writes to the directory.manage-usersis only forauth.groups.manage, the IdP-managed-spaces opt-in (ADR 0001), and is a materially higher-privilege credential.nikola-test, so the list is visibly more than "just me".2. Config
Into the untracked
cairn-enc-configsecret (not GitOps, so Argo will not revert it):Note the side effect worth watching for: with
auth.mode: oidcand this client present,main.goalso enables live group resolution (#96) — group and admin changes stop riding the session snapshot and re-resolve per request behind a 60s cache. That is a behaviour change beyond this page and should be observed deliberately rather than discovered.3. Verify
auth.adminsand the groupTestAdminNamesIncompleteOnResolveErrormakes in the abstract — confirm it holds against a real failing Keycloak.4. The two-source behaviour
Deliberately confirm across a redeploy, because it looks like a bug and is not:
internal/auth/session.go), Active today keeps its number (audit log survives)If this reads as broken to a fresh pair of eyes in the beta, the row labels are the thing to change, not the sources.
5. Docs
docs/handbook/users-access.mdexists (shipped in #345) but is not linked fromdocs/handbook/index.md— add it.Related
Premise correction + decisions (Nikola, 2026-09-04).
The degraded state this issue describes no longer exists on either dogfood:
auth.groups.*→ custody client becomes the admin client withmanageon). Power mode and live groups have been active for some time. This is blessed as deliberate: keycloak-profile custody independently requiresmanage-users(it writes each user's age identity into profile attributes — key minting proves the role is present), and OIDC-group-backed spaces are a wanted feature, which also requiresmanage-users(group CRUD + membership edits sit under it;view-users/query-groupsare enumeration only). Given that feature set, the current single client is minimal privilege. Follow-up niceness: setauth.groups.*explicitly in the secret so the config states the choice instead of inheriting it via adoption.custody=openbao, live groups on, and no power-mode line — i.e. an explicitauth.groups.*read client withmanageoff, app-owned spaces. That is the least-privilege configuration step 1 of this issue asked for; it already exists. Remaining check: confirm in Keycloak that its service account holds onlyview-users+query-groupsand is not a reuse of the enc custody client (if it is, mint a dedicated read-only client — zero feature loss on bao).Key blast-radius insight for the docs (shipping now): on a keycloak-profile custody realm, even the read tier (
view-users) can read every user's age identity from profile attributes — andmanage-userscan replace them, or grant admin in every group-trusting app. OpenBao custody separates the radii: the bao token (prefix-scoped KV policy) touches keys but never accounts; the Keycloak client stays read-only and never touches keys. This contrast goes into the handbook as the operator decision driver.Still open on this issue: the step-3 verification checklist (operator pass, possibly via browser automation) and the bao client-identity check above. Docs items ship in the next commit.
Step-3 verification pass, run via browser automation against both dogfoods (2026-09-05, v0.6.127). Existing SSO sessions reused; no credentials entered.
Verified on both
files-baoandfiles(#admin/users), identical healthy state:cairn-adminswith member-count chip (2 members), matching the rendered list exactlymanu-admin,nikola-test— visibly more than "just me"manu-admin): name alone, no empty second lineOpenID Connect · id.c0rdyceps.ch/realms/cordyceps· ConnectedNot verifiable autonomously (and why):
manu-adminto actually sign in; no credential entry by automation, ever.auth.groupsservice account holds onlyview-users+query-groups, and is a distinct client from the enc custody client — the admin console presents a login form; stopped there. Read-only inspection can be driven by automation the moment an operator session exists.kubectl edit secret+ restart; the code path is covered byTestAdminNamesIncompleteOnResolveError, so this stays a nice-to-have live confirmation.Docs items (§5) shipped 2026-09-04 (
users-access.md+ index row + role matrix + live-groups side effect + custody blast-radius comparison).Keycloak inspection completed (2026-09-05, operator signed in to the console, automation drove read-only):
cordycepshas three Cairn clients:cairn(public PKCE login),cairn-bao-groups,cairn-keycustody. Bao's groups client is NOT a reuse of the custody client.cairn-bao-groupsis exactly least-privilege: service-account roles arerealm-management view-users+realm-management query-groups(+ default-roles) — nomanage-users, nothing else. The bao side of this issue is fully as specified.cairn-adminsmembership matches: exactly 2 members in Keycloak (manu-admin/ Manuel Novak,nikola-test) — matches the Users & access chip and rendered list on both instances.⚠️ Finding —
cairn-keycustodyis over-privileged relative to the blessed minimum. Its service account holdsmanage-users,view-users,query-users,query-groupsplusmanage-realmandquery-realms. The blessed power-mode set (per the users-access.md role matrix) ismanage-users+view-users+query-groups;query-usersis redundant besideview-usersbut harmless.manage-realmis not — it allows changing realm configuration itself (auth flows, realm settings, events config), which nothing in Cairn's custody or IdP-managed-spaces path uses. Recommendation: unassignmanage-realm(andquery-realms) fromservice-account-cairn-keycustody. If anything unexpected breaks (space create/membership edit, key minting for a new user), re-assigning is one click — but per the documented model, nothing should.Remaining live checks now unblocked by the console session, pending explicit operator go (both are directory writes): the role trim above, and the checklist's group-removal round trip (remove
manu-adminfromcairn-admins→ confirm both instances drop him from Administrators within the 60s live-groups cache → re-add → confirm restored).Directory writes executed with operator approval (2026-09-05), both verified live:
cairn-keycustody✅ —manage-realmandquery-realmsunassigned; the service account now holds exactlymanage-users+view-users+query-users+query-groups(+ default-roles). Custody smoke-tested afterwards: encrypted file preview onfilesdecrypts fine — the trim broke nothing, as the role matrix predicted.manu-adminfromcairn-admins; within the 60s live-groups cache window both the chip (1 members) and the Administrators list updated (list showed onlynikola-test). Re-added; page restored to 2 members withmanu-adminback. Live group resolution (#96) demonstrated end to end against the real directory.New copy nit found during the round trip: the admin-group chip reads "1 members" — the member count bypasses
tn(). Singular form needed (×4 locales). Will ride along with the next UI batch.Checklist state after today: everything is ticked except (a) second-admin presence rows — needs
manu-adminto sign in once; (b) the broken-secret live confirmation — optional, unit-covered; (c) the §4 redeploy observation — deliberately at the next release rollout. Plus the config nicety of statingauth.groups.*explicitly incairn-enc-configinstead of inheriting via adoption (operator kubectl, no behaviour change).Final verification rounds (2026-09-05) — checklist complete.
Second-admin presence (§3):
manu-adminsigned in live. Observed from his perspective:manu-admin — You · Signed in now,nikola-test — Last active 59 minutes ago, tallies 1 signed in / 2 active today. Later, from Nikola's perspective after the test cycle: rows flipped correctly (nikola-test — You · Signed in now,manu-admin — Last active 8 minutes ago). Every presence presentation now seen live: You-marker tracking the viewer, Signed in now, Last active N ago, and bare name.Broken-secret failure mode (§3, run for real):
auth.groups.keycloakClientSecretdeliberately broken on bao (operator kubectl, sed-verified one-line diff), pod restarted. Result:TestAdminNamesIncompleteOnResolveErrorholds against a real failing Keycloak.Secret restored from backup, pod restarted, healthy state confirmed (chip, list, presence all back).
§4 two-source behaviour, observed deliberately across the same restarts: sessions died each rollout (Signed in now dropped to just the fresh viewer), Active today kept 2 people from the audit log throughout, and sign-ins recovered the counts. The labels read fine to these eyes — no relabel needed for the beta yet.
Remaining on this issue: only the config nicety — stating
auth.groups.*explicitly incairn-enc-config(withmanage: trueto preserve power mode) instead of inheriting via adoption. Zero behaviour change; commands handed to the operator. Closeable once that lands (or closeable now with the nicety tracked as ops hygiene).Closing — every item done (2026-09-05).
Final step landed:
auth.groups.*now stated explicitly incairn-enc-config(mirrored from the custody block via jq,manage: true), pod restarted. Boot log confirms identical behaviour to the adopted path:storage encryption enabled custody=keycloak-profile, the power-mode WARN (IdP-managed spaces enabled … requires manage-users, ADR 0001), andlive group resolution enabled (#96). The config now states the choice instead of inheriting it.Where this issue ended up versus where it started: it asked for a least-privilege read client and a first-ever exercise of the resolved path. It closes with — both dogfoods verified end to end on the resolved path (all presence states, member counts matching the directory, You-marker tracking the viewer); bao's read client confirmed exactly
view-users+query-groupsand distinct from custody; enc's custody client trimmed of an over-grant (manage-realm,query-realms) found during verification, with custody smoke-tested after; the group-removal round trip proving live groups against the real directory; the broken-secret failure mode confirmed fail-closed (with one UX gap filed as #426 item 3); §4's two-source behaviour observed deliberately across real restarts; docs shipped 2026-09-04; and two net-new findings cut to #426.Both instances end the day more locked down and better verified than the issue asked for.