#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
Owner

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:

  • Configure the admin client first.
  • Or keep "Full group path" off and accept that bare entries also match subgroup members at sign-in.

Needs a design: compare paths for spaces and shares, plus a migration for existing spaces whose group is a subgroup. Research first (playbook).

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:** - Configure the admin client first. - Or keep "Full group path" off and accept that bare entries also match subgroup members at sign-in. **Needs a design:** compare paths for spaces and shares, plus a migration for existing spaces whose group is a subgroup. Research first (playbook).
Author
Owner

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)

  • After #988, only adminGroups, oidcAllowedGroups and the Keycloak space operations compare paths. These still match a leaf name at any depth:
    • space roles: hasGroup scope.go:383 and roleIn membership.go:185;
    • group shares: Entitles grant.go:50, case-insensitive, and share creation accepts any group string (grants.go:139-179);
    • peering senders and receivers (registry.go:285, 325);
    • app-group exclusion (membership.go:131);
    • the Keycloak key holder (keycloak_group.go:141).
  • The live group refresh hands spaces and shares only leaf names (oidcgroups.go:158-172). VERIFIED.
  • CHANGELOG v0.6.354 overstates one point. It says peering receiver groups follow #988, but the permission check CanReceive still gets leaf names (main.go:2728, spaces.go:471). Only the opt-in receiver expansion follows the rule. VERIFIED. Correct in the next release.
  • No stable directory id is stored anywhere. Keycloak's admin API returns the group id and Cairn drops it (GroupRef, spaces.go:639). LDAP without ldapGroupBaseDn reduces groups to their CN, even in AD (ldap.go:1583). VERIFIED.
  • New findings (INFERRED from code; test sketches in the file):
    1. Under Keycloak custody, an app space whose name equals any top-level Keycloak group (case-insensitive) stores its key on that unrelated group. Whoever manages the group can read or delete the key. This is the other half of #967.
    2. An app group named like an LDAP group cuts that group out of its space, while shares to the name reach both sets of members.
    3. Renaming an app group leaves shares and space links on the old name, so a later group of that name inherits them (groups.go:431-471).
    4. Turning on ldapGroupBaseDn switches AD groups from cn to sAMAccountName, so spaces where the two differ lose their members.
    5. The Keycloak keyset cache has no TTL (keycloak_group.go:70), so a group that is deleted and recreated diverges between instances (#742).
  • Worst cases:
    • A subgroup, or a group in another OU, named like a space gets its role.
    • An IdP group created later with an app space's name gets write on it (#919), plus the key under Keycloak custody.
    • A group deleted and recreated under the same name inherits the space, its files and, under OpenBao custody, its key (#965).

What others do (VERIFIED in docs/source)

  • They store a stable id:
    • Nextcloud and ownCloud LDAP: their own id linked to the LDAP UUID, _2 suffix for a duplicate cn.
    • OpenCloud: g:<id> from GRAPH_LDAP_GROUP_ID_ATTRIBUTE; refuses an ambiguous name.
    • Seafile 8.0 and later: objectGUID. Earlier versions: a rename meant "the old group will be deleted and a new group will be created".
    • Google, Entra/M365, Box, Mattermost and Keycloak's own authorization policies bind to ids.
  • What broke where names were used:
    • Nextcloud user_oidc hashes the claim value, so an IdP rename creates a new group and drops access (#751).
    • The Azure display-name mode merges groups with the same name.
    • ownCloud docs: "Renaming of LDAP-Groups on the LDAP Server is not supported."
  • Advisories:
    • Keycloak CVE-2026-19608: bare names, fixed by top-level plus compare by id.
    • CVE-2026-18203: a child-group prefix check had no / boundary (same family as #933).
    • Grafana CVE-2023-3128: mutable email claim.
    • Microsoft sends display-name group claims only for groups assigned to the app, because otherwise "any user could create a group with duplicate name and gain access".
    • Argo CD warns that SSO group names can take a local user's roles, which is #919.
  • Operator complaints:
    • A frozen name shows the old label forever (Nextcloud #7267, #58088).
    • A rename becomes a new group with no access.
    • Entra groups show as GUIDs (user_oidc #1017).

Identifiers and standards (VERIFIED)

  • Stable ids by directory:
    • AD: objectGUID "never changes, even if the object is renamed or moved".
    • OpenLDAP: entryUUID (RFC 4530).
    • 389-ds: nsUniqueId.
    • FreeIPA: ipaUniqueID.
    • Keycloak: group id (UUID). Its mapper can emit only name or path, so the id comes from the admin API only.
    • Entra: the groups claim carries object ids by default.
  • Keycloak with LDAP federation matches groups by name, so an LDAP rename gives a new Keycloak id.
  • Standards:
    • SCIM (RFC 7643): a group id "MUST be a stable, non-reassignable identifier"; displayName is a label.
    • NIST SP 800-53 IA-4: "Preventing reuse of identifiers".
    • ASVS 5.0 10.5.2 / 10.3.3: identifiers that cannot be reassigned.
  • Delete and recreate always gives a new id. AD Recycle Bin and Entra restores within 30 days keep the old id.

Recommendation (three stages)

  1. S, next release.
    • Spaces, group shares and peering receivers compare the full path (the #988 rule: a bare name means top-level).
    • LDAP compares within the group base, with a WARN for LDAP group spaces without ldapGroupBaseDn.
    • -ro handled explicitly (#933).
    • Correct the CHANGELOG line.
  2. M.
    • Record the directory group id with each directory space and each group share (Keycloak id, objectGUID / entryUUID / nsUniqueId / ipaUniqueID via a new ldapGroupIdAttr defaulted per directory type, Entra object id).
    • Follow renames automatically and show the current name.
    • A deleted group grants nothing and is shown as "group not found". A recreated group is a new group and needs an audited admin re-link.
    • Only a space's own membership source grants it ("origin wins", #919).
    • State lives in the shared registry (#742).
  3. M-L. Key custody by space id and group id, together with #965 and #967.

Mockup needed for Admin › Spaces binding states and actions, and for the picker rows with path.

Decisions next.

## 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) - After #988, only `adminGroups`, `oidcAllowedGroups` and the Keycloak space operations compare paths. These still match a **leaf name at any depth**: - space roles: `hasGroup` scope.go:383 and `roleIn` membership.go:185; - group shares: `Entitles` grant.go:50, case-insensitive, and share creation accepts any group string (grants.go:139-179); - peering senders and receivers (registry.go:285, 325); - app-group exclusion (membership.go:131); - the Keycloak key holder (keycloak_group.go:141). - The live group refresh hands spaces and shares only leaf names (oidcgroups.go:158-172). VERIFIED. - **CHANGELOG v0.6.354 overstates one point.** It says peering receiver groups follow #988, but the permission check `CanReceive` still gets leaf names (main.go:2728, spaces.go:471). Only the opt-in receiver expansion follows the rule. VERIFIED. Correct in the next release. - **No stable directory id is stored anywhere.** Keycloak's admin API returns the group `id` and Cairn drops it (`GroupRef`, spaces.go:639). LDAP without `ldapGroupBaseDn` reduces groups to their CN, even in AD (ldap.go:1583). VERIFIED. - **New findings** (INFERRED from code; test sketches in the file): 1. Under Keycloak custody, an app space whose name equals any top-level Keycloak group (case-insensitive) **stores its key on that unrelated group**. Whoever manages the group can read or delete the key. This is the other half of #967. 2. An app group named like an LDAP group cuts that group out of its space, while shares to the name reach both sets of members. 3. Renaming an app group leaves shares and space links on the old name, so a later group of that name inherits them (groups.go:431-471). 4. Turning on `ldapGroupBaseDn` switches AD groups from `cn` to `sAMAccountName`, so spaces where the two differ lose their members. 5. The Keycloak keyset cache has no TTL (keycloak_group.go:70), so a group that is deleted and recreated diverges between instances (#742). - **Worst cases:** - A subgroup, or a group in another OU, named like a space gets its role. - An IdP group created later with an app space's name gets write on it (#919), plus the key under Keycloak custody. - A group deleted and recreated under the same name inherits the space, its files and, under OpenBao custody, its key (#965). ### What others do (VERIFIED in docs/source) - **They store a stable id:** - Nextcloud and ownCloud LDAP: their own id linked to the LDAP UUID, `_2` suffix for a duplicate `cn`. - OpenCloud: `g:<id>` from `GRAPH_LDAP_GROUP_ID_ATTRIBUTE`; refuses an ambiguous name. - Seafile 8.0 and later: objectGUID. Earlier versions: a rename meant "the old group will be deleted and a new group will be created". - Google, Entra/M365, Box, Mattermost and Keycloak's own authorization policies bind to ids. - **What broke where names were used:** - Nextcloud user_oidc hashes the claim value, so an IdP rename creates a new group and drops access (#751). - The Azure display-name mode merges groups with the same name. - ownCloud docs: "Renaming of LDAP-Groups on the LDAP Server is not supported." - **Advisories:** - Keycloak CVE-2026-19608: bare names, fixed by top-level plus compare by id. - CVE-2026-18203: a child-group prefix check had no `/` boundary (same family as #933). - Grafana CVE-2023-3128: mutable email claim. - Microsoft sends display-name group claims only for groups assigned to the app, because otherwise "any user could create a group with duplicate name and gain access". - Argo CD warns that SSO group names can take a local user's roles, which is #919. - **Operator complaints:** - A frozen name shows the old label forever (Nextcloud #7267, #58088). - A rename becomes a new group with no access. - Entra groups show as GUIDs (user_oidc #1017). ### Identifiers and standards (VERIFIED) - **Stable ids by directory:** - AD: `objectGUID` "never changes, even if the object is renamed or moved". - OpenLDAP: `entryUUID` (RFC 4530). - 389-ds: `nsUniqueId`. - FreeIPA: `ipaUniqueID`. - Keycloak: group `id` (UUID). Its mapper can emit only name or path, so the id comes from the admin API only. - Entra: the groups claim carries object ids by default. - **Keycloak with LDAP federation** matches groups by name, so an LDAP rename gives a new Keycloak id. - **Standards:** - SCIM (RFC 7643): a group `id` "MUST be a stable, non-reassignable identifier"; `displayName` is a label. - NIST SP 800-53 IA-4: "Preventing reuse of identifiers". - ASVS 5.0 10.5.2 / 10.3.3: identifiers that cannot be reassigned. - **Delete and recreate always gives a new id.** AD Recycle Bin and Entra restores within 30 days keep the old id. ### Recommendation (three stages) 1. **S, next release.** - Spaces, group shares and peering receivers compare the full path (the #988 rule: a bare name means top-level). - LDAP compares within the group base, with a WARN for LDAP group spaces without `ldapGroupBaseDn`. - `-ro` handled explicitly (#933). - Correct the CHANGELOG line. 2. **M.** - Record the directory group id with each directory space and each group share (Keycloak id, objectGUID / entryUUID / nsUniqueId / ipaUniqueID via a new `ldapGroupIdAttr` defaulted per directory type, Entra object id). - Follow renames automatically and show the current name. - A deleted group grants nothing and is shown as "group not found". A recreated group is a new group and needs an audited admin re-link. - Only a space's own membership source grants it ("origin wins", #919). - State lives in the shared registry (#742). 3. **M-L.** Key custody by space id and group id, together with #965 and #967. Mockup needed for Admin › Spaces binding states and actions, and for the picker rows with path. Decisions next.
Author
Owner

Decisions (Nikola, 2026-10-26)

  1. Staging.
    • Stage 1 ships in v0.6.355 together with #1003. Spaces, group shares and peering receivers compare the full path (the #988 rule: a bare name means top-level). LDAP compares within the group base and WARNs for LDAP group spaces without ldapGroupBaseDn. The CHANGELOG line on receivers gets corrected, and new -ro space names are refused until stage 2.
    • Stages 2 and 3 follow as one batch after a mockup.
  2. The strongest identifier per provider decides:
    • Entra: object id from the claim.
    • LDAP: the group id Cairn reads itself (new ldapGroupIdAttr, defaulted per directory type: objectGUID / entryUUID / nsUniqueId / ipaUniqueID).
    • Keycloak: access checks the exact full path, and the group id is recorded through the admin client for rename and recreate detection.
    • Bare names never decide.
  3. Lifecycle:
    • A rename is followed automatically, the current name is shown, and the change is audited.
    • A deleted group grants nothing and shows "group not found".
    • A group recreated under the same name is a new group and needs an audited admin re-link.
    • AD Recycle Bin and Entra restores keep the old id.
  4. Origin wins (#919). App spaces grant only through Cairn's groups, and directory spaces only through their bound directory group.
  5. #933: each space has an explicit binding (one group for write, one for read). The -ro twin is only a suggestion at creation.
  6. Keycloak without the admin client:
    • Directory spaces need "Full group path" on and match by exact path.
    • A start WARN and the Users & access facts say renames and recreated groups cannot be detected.
  7. Group shares (#928):
    • The share stores a group reference (source, id where available, path, label) resolved at creation, and ambiguous names are refused.
    • The picker shows the name plus path or OU when two groups share a name.
    • Free-text group names are no longer accepted.
  8. Key custody (#965, #967): keys are found by space id and recorded group id, never by name. App spaces get a Cairn-owned key holder, and a recreated group never inherits an old key. Research and design come first, inside the stage 2+3 batch.

Live tests: #1005 section G.

## Decisions (Nikola, 2026-10-26) 1. **Staging.** - **Stage 1 ships in v0.6.355 together with #1003.** Spaces, group shares and peering receivers compare the full path (the #988 rule: a bare name means top-level). LDAP compares within the group base and WARNs for LDAP group spaces without `ldapGroupBaseDn`. The CHANGELOG line on receivers gets corrected, and new `-ro` space names are refused until stage 2. - **Stages 2 and 3 follow as one batch** after a mockup. 2. **The strongest identifier per provider decides:** - Entra: object id from the claim. - LDAP: the group id Cairn reads itself (new `ldapGroupIdAttr`, defaulted per directory type: objectGUID / entryUUID / nsUniqueId / ipaUniqueID). - Keycloak: access checks the exact full path, and the group id is recorded through the admin client for rename and recreate detection. - Bare names never decide. 3. **Lifecycle:** - A rename is followed automatically, the current name is shown, and the change is audited. - A deleted group grants nothing and shows "group not found". - A group recreated under the same name is a new group and needs an audited admin re-link. - AD Recycle Bin and Entra restores keep the old id. 4. **Origin wins (#919).** App spaces grant only through Cairn's groups, and directory spaces only through their bound directory group. 5. **#933:** each space has an explicit binding (one group for write, one for read). The `-ro` twin is only a suggestion at creation. 6. **Keycloak without the admin client:** - Directory spaces need "Full group path" on and match by exact path. - A start WARN and the Users & access facts say renames and recreated groups cannot be detected. 7. **Group shares (#928):** - The share stores a group reference (source, id where available, path, label) resolved at creation, and ambiguous names are refused. - The picker shows the name plus path or OU when two groups share a name. - Free-text group names are no longer accepted. 8. **Key custody (#965, #967):** keys are found by space id and recorded group id, never by name. App spaces get a Cairn-owned key holder, and a recreated group never inherits an old key. Research and design come first, inside the stage 2+3 batch. Live tests: #1005 section G.
Author
Owner

Stage 1 implementation decisions (Nikola, 2026-10-26)

  • Binding a directory space to a group path: stage 1 ships the admin API plus exact handbook steps. The Admin › Spaces binding UI and the Users & access note ("renames cannot be detected without the admin client") come with the stage 2 mockup.

Open, research first. Review finding S1 (.superpowers/sdd/2026-10-26-batch7/review-b.md):

  • Stage 1 made group shares and peering lists case-sensitive.
  • App groups ignore case everywhere else (#550), so a share to finance would stop reaching app group Finance.
  • Nikola asked for deep research. Note from Nikola: the two dogfoods are the only instances, so no migration or customer impact needs to be considered.
## Stage 1 implementation decisions (Nikola, 2026-10-26) - **Binding a directory space to a group path:** stage 1 ships the admin API plus exact handbook steps. The Admin › Spaces binding UI and the Users & access note ("renames cannot be detected without the admin client") come with the stage 2 mockup. **Open, research first.** Review finding S1 (`.superpowers/sdd/2026-10-26-batch7/review-b.md`): - Stage 1 made group shares and peering lists case-sensitive. - App groups ignore case everywhere else (#550), so a share to `finance` would stop reaching app group `Finance`. - Nikola asked for deep research. Note from Nikola: the two dogfoods are the only instances, so no migration or customer impact needs to be considered.
Author
Owner

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, ToLower keys, and the directory's own rule. Go's ToLower and EqualFold disagree on İ (U+0130), ſ (U+017F) and the Kelvin sign. That gives 13 inconsistencies (file:line in the file); a probe confirmed several:

  • S1 is worse than the review said. WithAppGroups drops 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).
  • Two grant holes on b7-b. A bare Keycloak value from any depth survives when its lowercase equals one of the person's app groups (grouppaths.go:67-77): İnfo vs app group info, or the ASCII Finance vs finance. Contrived, but it is the hole stage 1 closes.
  • NFC twins. Keycloak on Postgres probably allows Zürich in both NFC and NFD as separate groups, and Cairn merges them. Live test.
  • The UI misstates access. The admin badge folds case while the grant is exact. "Used by" and peering counts fold. The picker and the Groups tab hide one of two case-variant groups.
  • LDAP config is split. ldapAllowedGroups ignores case (the server matches it) while adminGroups and peering lists are exact.

The directories

  • AD: case-insensitive, plus undocumented accent folding (Samba: björn = bjorn). Cairn cannot copy it.
  • OpenLDAP: caseIgnoreMatch with RFC 4518 preparation.
  • Keycloak: stores names as given. Uniqueness and lookups follow the database collation: exact on Postgres, case-insensitive on _ci MariaDB.
  • Entra: object id "immutable and unique"; display names are not unique.

Others

  • Grants by id have no case problem: Nextcloud, OpenCloud, Kubernetes (exact).
  • What broke with a second rule:
    • GitLab #288: a name in the wrong case "will not find any member".
    • Vault #12714 and HCSEC-2025-20 / CVE-2025-6013.
    • Spotify 2013: canonicalisation that is not idempotent led to account takeover.

Standards

  • RFC 8265: a case mapping is fine only if defined once and applied to both sides.
  • ASVS 5.0 1.1.1: canonicalise once.
  • UTS #39: confusable detection may refuse, never grant.

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:

    1. App-group addressees of shares and peering lists are stored in the app group's own spelling when saved.
    2. WithAppGroups always adds the app group's own spelling.
    3. WithGroupPathsOnly drops all bare values.
    4. The app-group exclusion compares exactly, and the name-collision refusal also catches look-alikes (Finance, ſales, Kelvin K, İ).
    5. Badge, counts and picker use the exact rule.
    6. A start WARN names config entries or shares that match only another case, with the correct spelling.
    7. NFC twins: warn and grant nothing.

    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.

## 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`, `ToLower` keys, and the directory's own rule. Go's `ToLower` and `EqualFold` disagree on İ (U+0130), ſ (U+017F) and the Kelvin sign. That gives 13 inconsistencies (file:line in the file); a probe confirmed several: - **S1 is worse than the review said.** `WithAppGroups` drops 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). - **Two grant holes on b7-b.** A bare Keycloak value from any depth survives when its lowercase equals one of the person's app groups (grouppaths.go:67-77): `İnfo` vs app group `info`, or the ASCII `Finance` vs `finance`. Contrived, but it is the hole stage 1 closes. - **NFC twins.** Keycloak on Postgres probably allows `Zürich` in both NFC and NFD as separate groups, and Cairn merges them. Live test. - **The UI misstates access.** The admin badge folds case while the grant is exact. "Used by" and peering counts fold. The picker and the Groups tab hide one of two case-variant groups. - **LDAP config is split.** `ldapAllowedGroups` ignores case (the server matches it) while `adminGroups` and peering lists are exact. ### The directories - **AD:** case-insensitive, plus undocumented accent folding (Samba: `björn` = `bjorn`). Cairn cannot copy it. - **OpenLDAP:** `caseIgnoreMatch` with RFC 4518 preparation. - **Keycloak:** stores names as given. Uniqueness and lookups follow the database collation: exact on Postgres, case-insensitive on `_ci` MariaDB. - **Entra:** object id "immutable and unique"; display names are not unique. ### Others - Grants by id have no case problem: Nextcloud, OpenCloud, Kubernetes (exact). - What broke with a second rule: - GitLab #288: a name in the wrong case "will not find any member". - Vault #12714 and HCSEC-2025-20 / CVE-2025-6013. - Spotify 2013: canonicalisation that is not idempotent led to account takeover. ### Standards - RFC 8265: a case mapping is fine only if defined once and applied to both sides. - ASVS 5.0 1.1.1: canonicalise once. - UTS #39: confusable detection may refuse, never grant. ### 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:** 1. App-group addressees of shares and peering lists are stored in the app group's own spelling when saved. 2. `WithAppGroups` always adds the app group's own spelling. 3. `WithGroupPathsOnly` drops all bare values. 4. The app-group exclusion compares exactly, and the name-collision refusal also catches look-alikes (`Finance`, `ſales`, Kelvin K, İ). 5. Badge, counts and picker use the exact rule. 6. A start WARN names config entries or shares that match only another case, with the correct spelling. 7. NFC twins: warn and grant nothing. 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.
Author
Owner

Decision (Nikola, 2026-10-26), after research 4

Stage 1 (v0.6.355): option A, one exact rule for access, plus:

  • App-group addressees of shares and peering lists are stored in the group's own spelling when saved.
  • WithAppGroups always adds the own spelling.
  • WithGroupPathsOnly drops all bare values.
  • The app-group exclusion compares exactly.
  • Look-alikes (İ, ſ, Kelvin K, fullwidth) are refused when an app group or space is created.
  • Badge, counts and picker use the exact rule.
  • A start WARN names entries that only match another case, with the correct spelling.
  • NFC twins warn and grant nothing.

Stage 2: option D, tracked here as part of the stage 2+3 batch:

  • 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 case variants, NFC twins and look-alikes side by side (mockup frames for the variant rows).
  • Config entries are resolved to references at start.
## Decision (Nikola, 2026-10-26), after research 4 **Stage 1 (v0.6.355): option A, one exact rule for access, plus:** - App-group addressees of shares and peering lists are stored in the group's own spelling when saved. - `WithAppGroups` always adds the own spelling. - `WithGroupPathsOnly` drops all bare values. - The app-group exclusion compares exactly. - Look-alikes (İ, ſ, Kelvin K, fullwidth) are refused when an app group or space is created. - Badge, counts and picker use the exact rule. - A start WARN names entries that only match another case, with the correct spelling. - NFC twins warn and grant nothing. **Stage 2: option D**, tracked here as part of the stage 2+3 batch: - 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 case variants, NFC twins and look-alikes side by side (mockup frames for the variant rows). - Config entries are resolved to references at start.
Cordy referenced this issue from a commit 2026-10-26 04:24:08 +00:00
Author
Owner

Stage 2 notes from the batch 7 final review (v0.6.355):

  • NFC twins are found by the start check and grant nothing. The set is per instance and is not refreshed after the first successful pass, so twins created later grant until the next start. Comparing by stable id (stage 2, option D) removes this.
  • Keycloak with a groups claim under a name other than groups and 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.
  • IdP power mode: binding a space to a group path is refused (space-group-power-mode). Stage 2 must define how a bound space's member edits act on the bound group.
  • Roles claim on a Keycloak issuer: the /x form stays on. A Keycloak role literally named /finance was judged too unlikely to need a check; revisit in stage 2.
  • Registry writes: the fixed temp name is filed separately as #1007.
Stage 2 notes from the batch 7 final review (v0.6.355): - **NFC twins** are found by the start check and grant nothing. The set is per instance and is not refreshed after the first successful pass, so twins created later grant until the next start. Comparing by stable id (stage 2, option D) removes this. - **Keycloak with a groups claim under a name other than `groups` and 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. - **IdP power mode:** binding a space to a group path is refused (`space-group-power-mode`). Stage 2 must define how a bound space's member edits act on the bound group. - **Roles claim on a Keycloak issuer:** the `/x` form stays on. A Keycloak role literally named `/finance` was judged too unlikely to need a check; revisit in stage 2. - **Registry writes:** the fixed temp name is filed separately as #1007.
Author
Owner

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 group test5 is 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:

    • files: 01a149204e71… (Café-922)
    • files-bao: 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}/group or 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.

## 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 group `test5` is 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: - files: `01a149204e71… (Café-922)` - files-bao: `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}/group` or 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.
Author
Owner

Research for stages 2 and 3 (2026-10-26)

Files in scratch/b7e/backlog/: research-1002-5-keys.md (stage 3) and research-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.json in shared state. Fields: source, directory id, path, own spelling, label and who set it, state, last verified, last seen at sign-in, candidates, history.

  • Spaces hold a write reference and a read reference.
  • Group shares, peering lists and config entries point at the same references.
  • A rename or re-link therefore updates everything at once, and admins see usage ("2 spaces, 14 shares").

Where the ids come from:

  • Keycloak: sends every group's id, but Cairn discards it (GroupRef, spaces.go:654-657). VERIFIED.
  • LDAP: the id attribute can be read in the existing group search (ldap.go:878-881). AD's objectGUID is binary and needs special handling, as OpenCloud does.
  • Entra without Graph: the claim carries ids or names, never both, so the admin types a label. That is the Nextcloud user_oidc #1017 complaint; Graph comes later. Microsoft advises against one app role per resource, so Entra spaces should bind to group object ids, and roles stay for sign-in and admin (needs a docs change).

Binding API. PUT /api/v1/admin/spaces/{name}/groups takes write and read references, as tokens from the admin group search (no free text), plus an audited re-link. The stage-1 Group path is written alongside for one release, so a rollback to v0.6.355 still works.

Lifecycle:

Source How Cairn learns of changes
Keycloak with admin client Rename or move within a minute of any member's request, plus a periodic check. Delete shows as not-found by id. A recreated group appears as the same path with a new id. Keycloak has no restore.
LDAP One search under the group base per check. An AD Recycle Bin restore keeps the id.
Entra and claim-only sources Sign-in only, and the UI says so.
  • States: active, not-found, needs-review, unverified. Only active and unverified grant access.
  • Not-found only after two clean checks miss the group.
  • Audit: one entry for group changes, one for admin re-links, and space-group-bind gains read/write.
  • Bell: admins are told about missing or recreated groups; a share owner is told when the group share no longer reaches anyone.

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:

  • by default people see only their own groups;
  • an admin setting can also allow exact full names, or all groups;
  • one row per group, with a source chip, the path or OU when two groups share a name, and a "looks like" marker;
  • the API refuses free text.

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, qa656 and 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):

  • One age key per space, found by name.
    • OpenBao: groups/<key name>.
    • Keycloak: the cairnAgeIdentity attribute on the top-level group whose name matches, case-insensitively (keycloak_group.go:116-146).
  • Members never hold the key. The server decrypts for anyone the access check lets in, so removing a member has nothing to rotate.
  • Nothing is ever deleted from custody, so a reused name finds the old key.
  • Group deleted and recreated:
    • OpenBao: the new group's space reuses the old key.
    • Keycloak: a new key is made, old files open only through recovery, and instances may disagree, because neither key cache expires (keycloak_group.go:70-79, openbao.go:159-167).
  • New findings:
    • Custody ignores the stage-1 path binding.
    • Keycloak key creation is read-then-write with no version check (two instances can lose a key).
    • No public half is pinned, so a replaced key is adopted silently.
    • Any Keycloak credential with view-users, or a delegated manager of that business group, can read the key.
    • The "User Attribute" token mapper also falls back to group attributes, so a misconfigured mapper puts space keys into tokens.

Others (VERIFIED):

  • Seafile binds keys to the library id, Cryptomator Hub to vault and authority ids, OpenBao policies to group ids.
  • Systems where members hold keys rotate on removal, but none re-encrypts old data (Keybase rotates "lazily", MLS starts a new epoch, Nextcloud E2EE makes a new metadata key).
  • Nextcloud server-side encryption, the closest match to Cairn, uses one server-held master key.
  • NIST SP 800-57: an old key is "Deactivated", meaning it decrypts but no longer encrypts.

Recommended:

  1. A key reference per space id: where the key is held, the holder id, a pinned public key, and a generation number. It goes in a new side file, because v0.6.355 would misread new spacekeys.json values.
  2. OpenBao: cairn/spaces/<space id>, created only if absent. The existing policy covers it.
  3. Keycloak: a Cairn-owned subgroup per space id under one parent group, found by group id. Keycloak refuses duplicate sibling names, which makes creation safe across instances. Delegated managers of business groups no longer see keys, and Cairn hides the subtree from every list and picker.
  4. The key follows the space, not the group. A recreated group gets nothing until an audited re-link, and a reused name is a new space id.
  5. No rotation on member removal. An admin "Rotate key" creates a new key for new files and keeps the old one for reading. Re-encryption comes later, for compromise only.
  6. Caches are keyed by space id and generation, with a 1-minute TTL.

Upgrade.

  • Existing keys are copied, unchanged, into the new holders. Nothing is re-encrypted and every file stays readable.
  • files moves 5 spaces, files-bao 12.
  • The old copies stay, so a rollback still reads everything.
  • Café-922 shows "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.

## Research for stages 2 and 3 (2026-10-26) Files in `scratch/b7e/backlog/`: `research-1002-5-keys.md` (stage 3) and `research-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.json` in shared state. Fields: source, directory id, path, own spelling, label and who set it, state, last verified, last seen at sign-in, candidates, history. - Spaces hold a write reference and a read reference. - Group shares, peering lists and config entries point at the same references. - A rename or re-link therefore updates everything at once, and admins see usage ("2 spaces, 14 shares"). **Where the ids come from:** - **Keycloak:** sends every group's id, but Cairn discards it (`GroupRef`, spaces.go:654-657). VERIFIED. - **LDAP:** the id attribute can be read in the existing group search (ldap.go:878-881). AD's objectGUID is binary and needs special handling, as OpenCloud does. - **Entra without Graph:** the claim carries ids or names, never both, so the admin types a label. That is the Nextcloud user_oidc #1017 complaint; Graph comes later. Microsoft advises against one app role per resource, so Entra spaces should bind to group object ids, and roles stay for sign-in and admin (needs a docs change). **Binding API.** `PUT /api/v1/admin/spaces/{name}/groups` takes write and read references, as tokens from the admin group search (no free text), plus an audited re-link. The stage-1 `Group` path is written alongside for one release, so a rollback to v0.6.355 still works. **Lifecycle:** | Source | How Cairn learns of changes | |---|---| | Keycloak with admin client | Rename or move within a minute of any member's request, plus a periodic check. Delete shows as not-found by id. A recreated group appears as the same path with a new id. Keycloak has no restore. | | LDAP | One search under the group base per check. An AD Recycle Bin restore keeps the id. | | Entra and claim-only sources | Sign-in only, and the UI says so. | - **States:** active, not-found, needs-review, unverified. Only active and unverified grant access. - **Not-found** only after two clean checks miss the group. - **Audit:** one entry for group changes, one for admin re-links, and `space-group-bind` gains read/write. - **Bell:** admins are told about missing or recreated groups; a share owner is told when the group share no longer reaches anyone. **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: - by default people see only their own groups; - an admin setting can also allow exact full names, or all groups; - one row per group, with a source chip, the path or OU when two groups share a name, and a "looks like" marker; - the API refuses free text. **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`, `qa656` and 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): - **One age key per space, found by name.** - OpenBao: `groups/<key name>`. - Keycloak: the `cairnAgeIdentity` attribute on the top-level group whose name matches, case-insensitively (keycloak_group.go:116-146). - **Members never hold the key.** The server decrypts for anyone the access check lets in, so removing a member has nothing to rotate. - **Nothing is ever deleted from custody**, so a reused name finds the old key. - **Group deleted and recreated:** - OpenBao: the new group's space reuses the old key. - Keycloak: a new key is made, old files open only through recovery, and instances may disagree, because neither key cache expires (keycloak_group.go:70-79, openbao.go:159-167). - **New findings:** - Custody ignores the stage-1 path binding. - Keycloak key creation is read-then-write with no version check (two instances can lose a key). - No public half is pinned, so a replaced key is adopted silently. - Any Keycloak credential with `view-users`, or a delegated manager of that business group, can read the key. - The "User Attribute" token mapper also falls back to group attributes, so a misconfigured mapper puts space keys into tokens. **Others** (VERIFIED): - Seafile binds keys to the library id, Cryptomator Hub to vault and authority ids, OpenBao policies to group ids. - Systems where members hold keys rotate on removal, but none re-encrypts old data (Keybase rotates "lazily", MLS starts a new epoch, Nextcloud E2EE makes a new metadata key). - Nextcloud server-side encryption, the closest match to Cairn, uses one server-held master key. - NIST SP 800-57: an old key is "Deactivated", meaning it decrypts but no longer encrypts. **Recommended:** 1. A key reference per space id: where the key is held, the holder id, a pinned public key, and a generation number. It goes in a new side file, because v0.6.355 would misread new `spacekeys.json` values. 2. OpenBao: `cairn/spaces/<space id>`, created only if absent. The existing policy covers it. 3. Keycloak: a Cairn-owned subgroup per space id under one parent group, found by group id. Keycloak refuses duplicate sibling names, which makes creation safe across instances. Delegated managers of business groups no longer see keys, and Cairn hides the subtree from every list and picker. 4. The key follows the space, not the group. A recreated group gets nothing until an audited re-link, and a reused name is a new space id. 5. No rotation on member removal. An admin "Rotate key" creates a new key for new files and keeps the old one for reading. Re-encryption comes later, for compromise only. 6. Caches are keyed by space id and generation, with a 1-minute TTL. **Upgrade.** - Existing keys are copied, unchanged, into the new holders. Nothing is re-encrypted and every file stays readable. - files moves 5 spaces, files-bao 12. - The old copies stay, so a rollback still reads everything. - `Café-922` shows "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.
Author
Owner

Decisions for stages 2 and 3 (Nikola, 2026-10-26)

Stage 2

  • Keycloak with the admin client compares the recorded group id. The path is the fallback only without the admin client. A recreated group is refused immediately. This revises decision 2 for Keycloak.
  • Config entries:
    • An adminGroups entry whose group was recreated waits for admin confirmation (no admin rights meanwhile).
    • An oidcAllowedGroups entry follows the new group with a WARN.
  • Entra:
    • Without Graph, the admin types the label when binding an Entra group id. Graph comes later.
    • Entra spaces bind to group object ids; app roles stay for sign-in and admin.
  • Group lifecycle:
    • A group is "not found" only after two clean checks miss it.
    • After upgrade, unresolvable shares and peering entries grant nothing and go to "Needs review".
    • A group may be the read group of several spaces.
  • Spaces:
    • Directory spaces keep auto-creation on first sight, except for Entra object ids.
    • Binding is allowed in power mode, with member edits by id.
  • Picker (#928): people see only their own groups by default, and an admin setting can widen this to exact full names or all groups. One row per group, with a source chip, the path or OU when two groups share a name, and a look-alike marker. The API refuses free text.

Stage 3 (#965, #967)

  • Cairn-owned key holder for every space.
    • Keycloak: a subgroup per space id under one parent, found by group id and hidden from all lists and pickers.
    • OpenBao: cairn/spaces/<space id>.
  • Rotation: none on member removal. An admin "Rotate key" creates a new key for new files and keeps the old one for reading. Re-encryption comes later, for compromise only.
  • Migration and integrity:
    • At migration, keys that were shared by name or held on the wrong group are flagged for the admin to rotate.
    • The public half is pinned; a mismatch refuses writes with a warning.
  • Old copies and purged keys:
    • Old key copies are removed by an admin after a verify step.
    • A purged space's key is marked retired and destroyed only by an explicit admin action.

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.

## Decisions for stages 2 and 3 (Nikola, 2026-10-26) ### Stage 2 - **Keycloak with the admin client compares the recorded group id.** The path is the fallback only without the admin client. A recreated group is refused immediately. This revises decision 2 for Keycloak. - **Config entries:** - An `adminGroups` entry whose group was recreated waits for admin confirmation (no admin rights meanwhile). - An `oidcAllowedGroups` entry follows the new group with a WARN. - **Entra:** - Without Graph, the admin types the label when binding an Entra group id. Graph comes later. - Entra spaces bind to group object ids; app roles stay for sign-in and admin. - **Group lifecycle:** - A group is "not found" only after two clean checks miss it. - After upgrade, unresolvable shares and peering entries grant nothing and go to "Needs review". - A group may be the read group of several spaces. - **Spaces:** - Directory spaces keep auto-creation on first sight, except for Entra object ids. - Binding is allowed in power mode, with member edits by id. - **Picker (#928):** people see only their own groups by default, and an admin setting can widen this to exact full names or all groups. One row per group, with a source chip, the path or OU when two groups share a name, and a look-alike marker. The API refuses free text. ### Stage 3 (#965, #967) - **Cairn-owned key holder for every space.** - Keycloak: a subgroup per space id under one parent, found by group id and hidden from all lists and pickers. - OpenBao: `cairn/spaces/<space id>`. - **Rotation:** none on member removal. An admin "Rotate key" creates a new key for new files and keeps the old one for reading. Re-encryption comes later, for compromise only. - **Migration and integrity:** - At migration, keys that were shared by name or held on the wrong group are flagged for the admin to rotate. - The public half is pinned; a mismatch refuses writes with a warning. - **Old copies and purged keys:** - Old key copies are removed by an admin after a verify step. - A purged space's key is marked retired and destroyed only by an explicit admin action. **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.
Author
Owner

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.md and mockup-s3-notes.md.

Stage 2 (1002-stage2-groups-mockup.html, 24 frames)

  • Space detail: a panel opens under the row and replaces the Details dialog.
  • Needs review: sits at the top of Users & access › Groups.
  • Re-link: lists every use of the old group (spaces, shares, peering lists) with checkboxes, all ticked by default. Everything ticked follows the new group in one audited step.
  • Someone else's share in Needs review: the admin may remove it (the owner gets a bell item) or pick a new group (audited, owner notified).
  • Entra spaces: "New directory space…" in Admin › Spaces, built from groups seen at sign-in plus an admin-typed name. Existing Entra spaces bound to app roles go to Needs review at the upgrade.
  • Picker setting: lives in Sharing › Policy. Users & access shows it as a read-only fact with a link.
  • Audit: keeps group paths. Entra gets a soft hint when a bound group has not been seen at sign-in for 90 days.
  • Bell: a new admin preference "Group changes" mutes missing, recreated and needs-review items. "Admin group recreated" can never be muted.
  • Members column: bound groups' member counts where the directory provides them, "-" for Entra.
  • Source and path: also shown in the share pane's existing-shares list and in the Groups tab, in this batch.

Stage 3 (1002-stage3-keys-mockup.html, 17 frames)

  • Flagged keys: rotate (recommended), or dismiss by an admin with a typed reason (audited).
  • Pin mismatch:
    • Resolved by putting the recorded key back and checking again, or by Rotate after a typed confirmation (new pinned key for new files).
    • Adopting the found key is never offered.
    • The mismatch bell cannot be muted; members see only an upload error.
  • No "Create key now": the first upload creates the key.
  • Retired keys: listed on the Purge log only. A legal hold blocks Destroy key.
  • Remove old copies: all at once, disabled while any instance still runs v0.6.355.
  • Deployment custody: the Key column is hidden.
  • Destroyed keys: listed for 90 days, then audit only.

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.

## 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.md` and `mockup-s3-notes.md`. ### Stage 2 (`1002-stage2-groups-mockup.html`, 24 frames) - **Space detail:** a panel opens under the row and replaces the Details dialog. - **Needs review:** sits at the top of Users & access › Groups. - **Re-link:** lists every use of the old group (spaces, shares, peering lists) with checkboxes, all ticked by default. Everything ticked follows the new group in one audited step. - **Someone else's share in Needs review:** the admin may remove it (the owner gets a bell item) or pick a new group (audited, owner notified). - **Entra spaces:** "New directory space…" in Admin › Spaces, built from groups seen at sign-in plus an admin-typed name. Existing Entra spaces bound to app roles go to Needs review at the upgrade. - **Picker setting:** lives in Sharing › Policy. Users & access shows it as a read-only fact with a link. - **Audit:** keeps group paths. Entra gets a soft hint when a bound group has not been seen at sign-in for 90 days. - **Bell:** a new admin preference "Group changes" mutes missing, recreated and needs-review items. "Admin group recreated" can never be muted. - **Members column:** bound groups' member counts where the directory provides them, "-" for Entra. - **Source and path:** also shown in the share pane's existing-shares list and in the Groups tab, in this batch. ### Stage 3 (`1002-stage3-keys-mockup.html`, 17 frames) - **Flagged keys:** rotate (recommended), or dismiss by an admin with a typed reason (audited). - **Pin mismatch:** - Resolved by putting the recorded key back and checking again, or by Rotate after a typed confirmation (new pinned key for new files). - Adopting the found key is never offered. - The mismatch bell cannot be muted; members see only an upload error. - **No "Create key now":** the first upload creates the key. - **Retired keys:** listed on the Purge log only. A legal hold blocks Destroy key. - **Remove old copies:** all at once, disabled while any instance still runs v0.6.355. - **Deployment custody:** the Key column is hidden. - **Destroyed keys:** listed for 90 days, then audit only. **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.
Author
Owner

Plan decisions (Nikola, 2026-10-26)

The spec and plan are in .superpowers/sdd/2026-10-26-batch9/ (spec.md, plan.md).

Two releases:

  • v0.6.357 = stage 2: group references, re-link, Needs review, picker. It also publishes each instance's version.
  • v0.6.358 = stage 3: keys by space id. The space panel's "Encryption key" section arrives then.

Entra: a new optional key oidcSpaceGroupsClaim (for example groups) is read alongside oidcGroupsClaim (for example roles).

  • Entra spaces bind to the group object ids from that claim, while roles stay for sign-in and admin.
  • Unset means the same as 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:

  • A re-link that moves someone else's share notifies the owner (bell).
  • A new admin bell preference "Space keys" mutes flagged-key items. A pin mismatch can never be muted.
  • ldapGroupIdAttr defaults: AD objectGUID, OpenLDAP and generic entryUUID, FreeIPA ipaUniqueID (to confirm live, #1005).

Technical choices as planned:

  • An advisory lease for the periodic check (compatible with #742).
  • Picks are re-checked by the server on every use (no signed token, no shared secret).
  • "Remove old copies" stays disabled while any instance is older than v0.6.358.
  • A group rename changes the label, not the space name.
  • Keycloak member counts are capped at "1000+".
  • The parent key group is fixed as /cairn-keys.
## Plan decisions (Nikola, 2026-10-26) The spec and plan are in `.superpowers/sdd/2026-10-26-batch9/` (`spec.md`, `plan.md`). **Two releases:** - **v0.6.357 = stage 2:** group references, re-link, Needs review, picker. It also publishes each instance's version. - **v0.6.358 = stage 3:** keys by space id. The space panel's "Encryption key" section arrives then. **Entra:** a new optional key `oidcSpaceGroupsClaim` (for example `groups`) is read alongside `oidcGroupsClaim` (for example `roles`). - Entra spaces bind to the group object ids from that claim, while roles stay for sign-in and admin. - Unset means the same as `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:** - A re-link that moves someone else's share notifies the owner (bell). - A new admin bell preference "Space keys" mutes flagged-key items. A pin mismatch can never be muted. - `ldapGroupIdAttr` defaults: AD `objectGUID`, OpenLDAP and generic `entryUUID`, FreeIPA `ipaUniqueID` (to confirm live, #1005). **Technical choices as planned:** - An advisory lease for the periodic check (compatible with #742). - Picks are re-checked by the server on every use (no signed token, no shared secret). - "Remove old copies" stays disabled while any instance is older than v0.6.358. - A group rename changes the label, not the space name. - Keycloak member counts are capped at "1000+". - The parent key group is fixed as `/cairn-keys`.
Author
Owner

Stage 2 released in v0.6.357 (PR #1015), live on both dogfoods since 2026-10-26 17:54

Upgrade on first start

  • files: every directory space was bound to its Keycloak group by id. Needs review holds 1 item: Café-922, whose group no longer exists.
  • files-bao: the directory spaces were bound. Needs review holds 2 items: qa656 (no group) and test5 (a directory space named like the Cairn group test5, decision D-H). The upgrade logged origin wins: app space test no longer grants to directory group /test (1 members), as decided in #919.
  • No ERROR in either log.

Checked in the browser

  • Admin › Spaces shows the Groups column, a "2 need attention" count and banner, the "Needs attention" filter and "New directory space…".
  • Users & access › Groups shows Needs review with "Choose group…" and "Leave unbound" (matches the approved mockup).
  • Nikola's groups arrive as full paths, and all his spaces are still listed.

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 2 released in v0.6.357 (PR #1015), live on both dogfoods since 2026-10-26 17:54 **Upgrade on first start** - **files:** every directory space was bound to its Keycloak group by id. Needs review holds 1 item: `Café-922`, whose group no longer exists. - **files-bao:** the directory spaces were bound. Needs review holds 2 items: `qa656` (no group) and `test5` (a directory space named like the Cairn group `test5`, decision D-H). The upgrade logged `origin wins: app space test no longer grants to directory group /test (1 members)`, as decided in #919. - No ERROR in either log. **Checked in the browser** - Admin › Spaces shows the Groups column, a "2 need attention" count and banner, the "Needs attention" filter and "New directory space…". - Users & access › Groups shows Needs review with "Choose group…" and "Leave unbound" (matches the approved mockup). - Nikola's groups arrive as full paths, and all his spaces are still listed. **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.
Cordy referenced this issue from a commit 2026-10-26 21:56:22 +00:00
Author
Owner

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, a space-keys preference, audit verbs, the admin UI and handbook encryption#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:

  • holders only gain keys, and the pin passes when the pinned key is anywhere in the holder;
  • a custody outage keeps the last good key for up to 1 h;
  • the crypto role confirms by-id handling;
  • a space created after the move is new;
  • Destroy also removes the space's own old copy when nobody else uses it.

Live check, 2026-10-26:

  • Move:
    • files-bao copied 5, found no key for 8 (all empty spaces).
    • files copied 4, found no key for 2 (Café-922, recovery-only since v0.6.356, and cairn-admins).
    • No WARN or ERROR. On files, /cairn-keys was created and marked.
  • Check keys: 5/5 on files-bao, 4/4 on files, no failures.
  • Every file in the visible spaces opens: files-bao Fall 3 22/22, app-owned-space 12/12 (trash included). The spaces on files hold no files.

Follow-ups:

  • #1018: empty spaces shown as missing instead of new.
  • #1019: split deployments, move and key admin to the crypto role.
  • #1020: the first-start move on files waited ~10 min for the old pod's lease.

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.

**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, a `space-keys` preference, audit verbs, the admin UI and handbook `encryption#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: - holders only gain keys, and the pin passes when the pinned key is anywhere in the holder; - a custody outage keeps the last good key for up to 1 h; - the crypto role confirms by-id handling; - a space created after the move is `new`; - Destroy also removes the space's own old copy when nobody else uses it. **Live check, 2026-10-26:** - **Move:** - files-bao copied 5, found no key for 8 (all empty spaces). - files copied 4, found no key for 2 (Café-922, recovery-only since v0.6.356, and cairn-admins). - No WARN or ERROR. On files, `/cairn-keys` was created and marked. - **Check keys:** 5/5 on files-bao, 4/4 on files, no failures. - **Every file in the visible spaces opens:** files-bao Fall 3 22/22, app-owned-space 12/12 (trash included). The spaces on files hold no files. **Follow-ups:** - #1018: empty spaces shown as missing instead of new. - #1019: split deployments, move and key admin to the crypto role. - #1020: the first-start move on files waited ~10 min for the old pod's lease. **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.
Cordy closed this issue 2026-10-26 22:56:02 +00:00
Sign in to join this conversation.
No labels
No project
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
No description provided.