#988 follow-up: directory-group spaces and group shares still match a bare group name at any depth #1002
Closed
opened 2026-10-25 19:20:09 +00:00 by Cordy
·
13 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#1002
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?
Found in the batch-6 final review (S4). Decision (Nikola, 2026-10-25): document in v0.6.354 and follow up here.
v0.6.354 applies the #988 rule (a bare name means a top-level group) to
oidcAllowedGroups,adminGroups, space operations (findGroup) and peering receiver groups.Not yet covered: access to directory-group spaces and group shares still matches a bare group name at any depth (
hasGroup,GrantsFor). Anyone who can create a subgroup named like a space can therefore gain access to it. This is the same class as #919 and #933.Without the Keycloak admin client, turning on Keycloak's "Full group path" (which the #988 upgrade note needs at sign-in) turns claim values into
/name, and directory-group spaces and group shares then stop matching.v0.6.354 docs:
Needs a design: compare paths for spaces and shares, plus a migration for existing spaces whose group is a subgroup. Research first (playbook).
Research (2026-10-26): how a group is bound to spaces, shares and keys
Primary sources were fetched in-session, and every claim is marked VERIFIED / INFERRED / UNVERIFIED. Files in
scratch/b7e/backlog/:research-1002-1-cairn.md(Cairn code, 14 places, 12 cases)research-1002-2-market.md(others, CVEs, operator voices)research-1002-3-standards.md(IdP identifiers, SCIM/NIST/ASVS)Cairn today (main
59bd3edb)adminGroups,oidcAllowedGroupsand the Keycloak space operations compare paths. These still match a leaf name at any depth:hasGroupscope.go:383 androleInmembership.go:185;Entitlesgrant.go:50, case-insensitive, and share creation accepts any group string (grants.go:139-179);CanReceivestill gets leaf names (main.go:2728, spaces.go:471). Only the opt-in receiver expansion follows the rule. VERIFIED. Correct in the next release.idand Cairn drops it (GroupRef, spaces.go:639). LDAP withoutldapGroupBaseDnreduces groups to their CN, even in AD (ldap.go:1583). VERIFIED.ldapGroupBaseDnswitches AD groups fromcntosAMAccountName, so spaces where the two differ lose their members.What others do (VERIFIED in docs/source)
_2suffix for a duplicatecn.g:<id>fromGRAPH_LDAP_GROUP_ID_ATTRIBUTE; refuses an ambiguous name./boundary (same family as #933).Identifiers and standards (VERIFIED)
objectGUID"never changes, even if the object is renamed or moved".entryUUID(RFC 4530).nsUniqueId.ipaUniqueID.id(UUID). Its mapper can emit only name or path, so the id comes from the admin API only.id"MUST be a stable, non-reassignable identifier";displayNameis a label.Recommendation (three stages)
ldapGroupBaseDn.-rohandled explicitly (#933).ldapGroupIdAttrdefaulted per directory type, Entra object id).Mockup needed for Admin › Spaces binding states and actions, and for the picker rows with path.
Decisions next.
Decisions (Nikola, 2026-10-26)
ldapGroupBaseDn. The CHANGELOG line on receivers gets corrected, and new-rospace names are refused until stage 2.ldapGroupIdAttr, defaulted per directory type: objectGUID / entryUUID / nsUniqueId / ipaUniqueID).-rotwin is only a suggestion at creation.Live tests: #1005 section G.
Stage 1 implementation decisions (Nikola, 2026-10-26)
Open, research first. Review finding S1 (
.superpowers/sdd/2026-10-26-batch7/review-b.md):financewould stop reaching app groupFinance.Research 4: case and Unicode in group names (research-1002-4-case.md)
Cairn today
Group names are compared five different ways: exact bytes, exact after NFC,
EqualFold,ToLowerkeys, and the directory's own rule. Go'sToLowerandEqualFolddisagree on İ (U+0130), ſ (U+017F) and the Kelvin sign. That gives 13 inconsistencies (file:line in the file); a probe confirmed several:WithAppGroupsdrops the app group's own spelling when the person has a directory group of another case, so even a share to the exact stored name misses (appgroups.go:33-43).İnfovs app groupinfo, or the ASCIIFinancevsfinance. Contrived, but it is the hole stage 1 closes.Zürichin both NFC and NFD as separate groups, and Cairn merges them. Live test.ldapAllowedGroupsignores case (the server matches it) whileadminGroupsand peering lists are exact.The directories
björn=bjorn). Cairn cannot copy it.caseIgnoreMatchwith RFC 4518 preparation._ciMariaDB.Others
Standards
Options
C. Mirror each directory's rule. Cannot be built for AD.
B. App groups case-insensitive, directory groups exact. Keeps two rules at every match site, and stage 2 discards it.
A, recommended for stage 1. One exact rule (
GroupMatches) for access, plus:WithAppGroupsalways adds the app group's own spelling.WithGroupPathsOnlydrops all bare values.Finance,ſales, Kelvin K, İ).About 2 days, no mockup.
D, for stage 2. References compare by source and id (UUIDs lowercased). Case matters only for search and display: a lookup must find exactly one group, else the candidates are listed. The picker shows the source spelling plus source and path, and lists variants and look-alikes side by side. About 1-2 days on top; the mockup needs variant rows.
#742: the canonical form is computed once at write and stored in shared state, and access compares bytes, so the result does not depend on each binary's Unicode tables.
Live tests are added to #1005 section G.
Decision (Nikola, 2026-10-26), after research 4
Stage 1 (v0.6.355): option A, one exact rule for access, plus:
WithAppGroupsalways adds the own spelling.WithGroupPathsOnlydrops all bare values.Stage 2: option D, tracked here as part of the stage 2+3 batch:
Stage 2 notes from the batch 7 final review (v0.6.355):
groupsand no admin client: bare values are not filtered and can match at any depth. v0.6.355 adds a start WARN. Stage 2 references resolve this.space-group-power-mode). Stage 2 must define how a bound space's member edits act on the bound group./xform stays on. A Keycloak role literally named/financewas judged too unlikely to need a check; revisit in stage 2.Stage 1 released in v0.6.355 (PR #1006), live on both dogfoods
Live checks (2026-10-26):
With the Keycloak admin client, Nikola's groups now arrive as full paths:
/Fall 3,/Test Ümlauf folderinö,/cairn-admins,/case-folder-1,/test. On files-bao the app grouptest5is also present, flat.All spaces are still listed on both instances: 5 on files, 12 on files-bao including the app-owned ones. WebDAV
PROPFIND /dav/answers 207.Start WARN fires as designed, one leftover QA space per instance:
01a149204e71… (Café-922)01a0e91449f0… (qa656)Both are earlier test spaces whose Keycloak group no longer exists at top level. They stay as they are (not our data to change); they can be bound with
PUT /api/v1/admin/spaces/{name}/groupor deleted by Nikola if wanted.No other WARN or ERROR in either pod's log besides the existing power-mode and emergency-access notices.
Still open on this issue: stages 2 and 3, as decided. Also see #1007 (registry temp name) and the stage 2 notes above.
Research for stages 2 and 3 (2026-10-26)
Files in
scratch/b7e/backlog/:research-1002-5-keys.md(stage 3) andresearch-1002-6-stage2.md(stage 2). Primary sources were fetched in-session, and every claim is marked VERIFIED, INFERRED or UNVERIFIED.Stage 2: binding record, lifecycle, admin UX
Model. One shared group reference per group, stored in a new
group-refs.jsonin shared state. Fields: source, directory id, path, own spelling, label and who set it, state, last verified, last seen at sign-in, candidates, history.Where the ids come from:
GroupRef, spaces.go:654-657). VERIFIED.Binding API.
PUT /api/v1/admin/spaces/{name}/groupstakes write and read references, as tokens from the admin group search (no free text), plus an audited re-link. The stage-1Grouppath is written alongside for one release, so a rollback to v0.6.355 still works.Lifecycle:
space-group-bindgains read/write.Finding on decision 2. If Keycloak access checks only the path, a group deleted and recreated at the same path keeps access until the next periodic check. With the admin client, Cairn already has each group's id on every request, so comparing ids closes the gap at no cost.
Market. Everyone stores an id, but admin screens show frozen old names (Nextcloud LDAP), raw GUIDs (Nextcloud user_oidc, GitLab) or stale entries (SharePoint). A recreated group loses everything with no guided re-link. None shows where a binding came from or when it was last verified. Cairn can do better: current name, source, path or OU, a verification line, and a side-by-side re-link card.
Picker (#928). Today every signed-in person can search every group by prefix (recipients.go:126-148), which is the leak #928 describes. Recommendation:
Upgrade (#742). References live in shared state, and one instance at a time runs the periodic check. On upgrade, each dogfood directory space resolves to exactly one group.
Café-922,qa656and any ambiguous case go to "Needs review" and grant nothing. Shares and peering lists resolve the same way. Files and keys are untouched.Mockups: 10 frames.
Size: 3-4 weeks including the mockup round, about 2 weeks of that backend.
Stage 3: key custody by space id (#965, #967)
Today (code reading, VERIFIED):
groups/<key name>.cairnAgeIdentityattribute on the top-level group whose name matches, case-insensitively (keycloak_group.go:116-146).view-users, or a delegated manager of that business group, can read the key.Others (VERIFIED):
Recommended:
spacekeys.jsonvalues.cairn/spaces/<space id>, created only if absent. The existing policy covers it.Upgrade.
Café-922shows "key missing, recovery only".Mockup: an Admin › Spaces key chip and detail panel, plus a migration summary.
Size: about 2.5-3.5 weeks.
Decisions are asked next.
Decisions for stages 2 and 3 (Nikola, 2026-10-26)
Stage 2
adminGroupsentry whose group was recreated waits for admin confirmation (no admin rights meanwhile).oidcAllowedGroupsentry follows the new group with a WARN.Stage 3 (#965, #967)
cairn/spaces/<space id>.Next: whole-page mockups (stage 2: 10 frames from research 6; stage 3: key chip, detail panel, migration summary), then the stage 2+3 batch.
Mockup decisions (Nikola, 2026-10-26): both mockups approved as drawn
Mockup files are in Nikola's design folder; notes are in
.superpowers/sdd/2026-10-26-1002/mockup-s2-notes.mdandmockup-s3-notes.md.Stage 2 (
1002-stage2-groups-mockup.html, 24 frames)Stage 3 (
1002-stage3-keys-mockup.html, 17 frames)Open wording: the mockup agents' proposals are accepted unless noted (both notes files list them).
Next: spec and plan for the stage 2+3 batch.
Plan decisions (Nikola, 2026-10-26)
The spec and plan are in
.superpowers/sdd/2026-10-26-batch9/(spec.md,plan.md).Two releases:
Entra: a new optional key
oidcSpaceGroupsClaim(for examplegroups) is read alongsideoidcGroupsClaim(for exampleroles).oidcGroupsClaim, so nothing changes for anyone else.LDAP without
ldapGroupBaseDn: Cairn reads the group's id attribute directly from the DN it already has, so renames and recreations are detected. A start WARN still recommends setting the group base.Smaller points:
ldapGroupIdAttrdefaults: ADobjectGUID, OpenLDAP and genericentryUUID, FreeIPAipaUniqueID(to confirm live, #1005).Technical choices as planned:
/cairn-keys.Stage 2 released in v0.6.357 (PR #1015), live on both dogfoods since 2026-10-26 17:54
Upgrade on first start
Café-922, whose group no longer exists.qa656(no group) andtest5(a directory space named like the Cairn grouptest5, decision D-H). The upgrade loggedorigin wins: app space test no longer grants to directory group /test (1 members), as decided in #919.Checked in the browser
Small UI inaccuracy filed as #1016: a D-H item says "No group has this name." instead of naming the Cairn group.
Next: stage 3 (v0.6.358, keys by space id, #965 and #967). #1002 stays open until stage 3 ships.
Stage 3 released in v0.6.358 (PR #1017, tag v0.6.358), live on both dogfoods.
What changed: space keys are now held by space id: OpenBao
spaces/<id>, Keycloak/cairn-keys/<id>(marked, hidden everywhere). Each space has a key reference with a pin and a generation. Old copies stay until an admin removes them after Check keys. Admins can rotate, keep a flagged key with a reason, check, remove old copies (gated), and see retired keys and destroy them. There are bell items, aspace-keyspreference, audit verbs, the admin UI and handbookencryption#space-keys.Controller decisions D-S1..D-S14 (from the K1/K2/K3/KU and final reviews) are in spec.md's D3/D3b addenda. In short:
new;Live check, 2026-10-26:
/cairn-keyswas created and marked.Follow-ups:
Still to run (need your go, they change state): rotate a test space, the pin-mismatch drill, Remove old copies, and purge plus destroy of a test space's key. These are tracked in #1005 section G.
Stages 1 to 3 are done, so I'm closing this. The remaining live tests stay in #1005.