App passwords for local and LDAP instances (research first: market, users, operators, standards) #895

Closed
opened 2026-10-13 21:11:34 +00:00 by Cordy · 10 comments
Owner

Found on 2026-10-13 while live-checking #890.

Today

  • App passwords are only set up in oidc mode (cmd/cairnd/main.go ~783). Local and LDAP instances have none: WebDAV and sync clients sign in with the account's main password over Basic.
  • #890 (v0.6.338) stops Basic credentials from using admin rights. But on a local or LDAP instance, the main password stored in Finder, rclone, Explorer or a mobile app still signs in through the browser form, and for an admin account that means full admin.
  • App passwords would close that gap: a per-device secret that works only for sync, can be revoked one device at a time, and can never open a browser session.

Research first (before any spec or mockup)

  1. Market: how comparable products handle this:
    • Nextcloud, ownCloud (classic and Infinite Scale), OpenCloud, Seafile;
    • plus others with app passwords or device tokens: Google, Microsoft, Apple ID, Fastmail, Proton, GitHub/GitLab/Gitea/Forgejo PATs, Synology, TrueNAS, Pydio Cells, FileCloud, Box, Dropbox.
    • Per product: available in which auth modes? Can the admin require it? Can the main password be blocked for WebDAV/sync? Scopes, expiry, last-used, revocation, naming, login flow v2 / device flow, QR onboarding.
  2. Users: what end users expect or complain about (forums, GitHub issues, Reddit), for example sync client setup friction, lost app passwords, expiry surprises, mobile apps.
  3. Operators: what admins want, for example enforcement ("app passwords only for WebDAV"), audit, bulk revoke, per-user limits, policy for admin accounts, migrations.
  4. Standards and legal:
    • ISO/IEC 27001:2022 and 27002 (5.17 authentication information, 8.5 secure authentication), NIST SP 800-63B (memorized secrets vs. look-up secrets, rev 4), NIST 800-53 (IA-2, IA-5, AC-6(2));
    • BSI IT-Grundschutz (ORP.4, APP.3.x, CON.x) and Grundschutz++ where available;
    • CIS Controls v8 (5, 6), OWASP ASVS v5 (V6/V7 authentication);
    • GDPR Art. 32 and Swiss revDSG / DSV (security of processing);
    • NIS2 Art. 21 (MFA), and Microsoft's and Google's deprecation of app passwords in favour of OAuth device flows (a counter-signal).
  5. Implications for Cairn:
    • turning app passwords on in local and LDAP mode;
    • an optional "WebDAV only with app passwords" setting (main password = browser only);
    • admin accounts, break-glass accounts (#880, they must stay Basic-capable for recovery?);
    • OAuth device or login flow as an alternative;
    • how this fits #890 and #887.

Not in scope: migrating existing sync clients. The two dogfoods are the only instances and have no app passwords in active use, only leftover test ones.

Research goes in a comment here. Decisions and a mockup (if any UI changes) come after Nikola has read it.

Found on 2026-10-13 while live-checking #890. ## Today - App passwords are only set up in `oidc` mode (`cmd/cairnd/main.go` ~783). Local and LDAP instances have none: WebDAV and sync clients sign in with the account's **main password** over Basic. - #890 (v0.6.338) stops Basic credentials from using admin rights. But on a local or LDAP instance, the main password stored in Finder, rclone, Explorer or a mobile app still signs in through the browser form, and for an admin account that means full admin. - App passwords would close that gap: a per-device secret that works only for sync, can be revoked one device at a time, and can never open a browser session. ## Research first (before any spec or mockup) 1. **Market:** how comparable products handle this: - Nextcloud, ownCloud (classic and Infinite Scale), OpenCloud, Seafile; - plus others with app passwords or device tokens: Google, Microsoft, Apple ID, Fastmail, Proton, GitHub/GitLab/Gitea/Forgejo PATs, Synology, TrueNAS, Pydio Cells, FileCloud, Box, Dropbox. - Per product: available in which auth modes? Can the admin require it? Can the main password be blocked for WebDAV/sync? Scopes, expiry, last-used, revocation, naming, login flow v2 / device flow, QR onboarding. 2. **Users:** what end users expect or complain about (forums, GitHub issues, Reddit), for example sync client setup friction, lost app passwords, expiry surprises, mobile apps. 3. **Operators:** what admins want, for example enforcement ("app passwords only for WebDAV"), audit, bulk revoke, per-user limits, policy for admin accounts, migrations. 4. **Standards and legal:** - ISO/IEC 27001:2022 and 27002 (5.17 authentication information, 8.5 secure authentication), NIST SP 800-63B (memorized secrets vs. look-up secrets, rev 4), NIST 800-53 (IA-2, IA-5, AC-6(2)); - BSI IT-Grundschutz (ORP.4, APP.3.x, CON.x) and Grundschutz++ where available; - CIS Controls v8 (5, 6), OWASP ASVS v5 (V6/V7 authentication); - GDPR Art. 32 and Swiss revDSG / DSV (security of processing); - NIS2 Art. 21 (MFA), and Microsoft's and Google's deprecation of app passwords in favour of OAuth device flows (a counter-signal). 5. **Implications for Cairn:** - turning app passwords on in local and LDAP mode; - an optional "WebDAV only with app passwords" setting (main password = browser only); - admin accounts, break-glass accounts (#880, they must stay Basic-capable for recovery?); - OAuth device or login flow as an alternative; - how this fits #890 and #887. Not in scope: migrating existing sync clients. The two dogfoods are the only instances and have no app passwords in active use, only leftover test ones. Research goes in a comment here. Decisions and a mockup (if any UI changes) come after Nikola has read it.
Author
Owner

Research (2026-10-13)

The full file with all sources is scratch/b7e/895-research.md. Labels: [D] official documentation, [F] forum, issue or blog voice, [K] background knowledge not verified in this run.

0. Cairn today

  • App passwords are wired only in oidc mode. In local and ldap mode, WebDAV and sync use the account password over Basic.
  • Exists (oidc):
    • per-device name;
    • optional or admin-required expiry (#751);
    • shown once, verifier only;
    • admin revoke with count, plus a reset checkbox (#851);
    • IdP lifecycle (#848);
    • #887 audit;
    • #890 no admin rights over Basic.
  • Missing:
    • last used and address;
    • scopes;
    • browser-approved device flow;
    • creation notification;
    • per-user limit;
    • MFA for local accounts.
  • The gap: on local and LDAP instances, a leaked sync password signs in in the browser, and for an admin that means full admin. Revoking one device means changing the password everywhere.

1. Market

Product Modes Main password over WebDAV/sync Admin enforcement Lifecycle Onboarding
Nextcloud All; required with 2FA [D] Allowed by default token_auth_enforced (default false): "blocks requests using the user password" [D] Name from user agent, per-token filesystem toggle, remote wipe, auto clean-up after 365 days unused (NC 30+) [D]; password change doesn't revoke them [F] Login Flow v2: browser sign-in mints a per-device app password; poll token 20 min [D]; DAVx5 uses it [D]
ownCloud 10 All; required with 2FA [F] Allowed unless 2FA Same flag, unclear in practice [F] Bug reports (one-time use, migration) [F] OAuth2 app (browser) [D]
oCIS auth-app started by hand, "because generating access tokens is security relevant" [D] Password Basic off by default, called test/dev only [D] Off by default Expiry at creation, labels (7.3) [D] OIDC for its own clients
OpenCloud auth-app on by default (7.2) [D] Password or token [D] PROXY_ENABLE_APP_AUTH=false [D] Expiry required, label, shown once, admin impersonation for migrations. Gap: tokens survive disabling the user in an external IdP [D] (Cairn closed this in #848) Web UI "App Tokens" [D]
Seafile One "WebDAV password" (ENABLE_WEBDAV_SECRET), aimed at SSO users [D] Both work, independently (staff answer) [F] None; staff advice: "disable WebDAV to enforce 2FA" [F] One per user, not per device Manual
FileRun All [D] Refused, always, "whatever your account settings are" [D] Built in; default expiry 2 years [D] Connected-apps list with date and creating IP; re-auth (incl. 2FA) before creation; password change keeps them, reset revokes all; none for guests [D] Browser approval (Nextcloud-compatible) mints them; manual creation shows user, password, WebDAV URL, QR code [D]
Pydio Cells Personal access tokens replace the password for WebDAV/SFTP [D] – – Hard or sliding expiry [D] Admin or CLI
Synology DSM None [F] Yes; WebDAV "does not support 2FA" [D/F] – Only "change the account password" [F] –
FileCloud None; WebDAV ended in 23.241 [D] – – – –
Gitea/Forgejo Scoped tokens ENABLE_BASIC_AUTHENTICATION switch; with MFA, password Basic stops [D] Admin switch Docs: a token "sidesteps the security benefits of MFA… last resort" [D] Manual
GitHub/GitLab PATs – Max lifetime (GitHub default 366 days; GitLab 365 days, non-expiring removed in 16.0) [D] Scopes, expiry required [D] Manual
Fastmail App passwords required for all third-party apps [D] Refused Built in Scoped: mail/contacts/calendars vs Files (WebDAV) [D] Manual; OAuth for app makers [D]
Apple ID App-specific, 2FA required [D] Refused Built in Max 25; revoke one or all [D] Manual
Google / Microsoft Google: legacy passwords off since 14 Mar 2025, app passwords are the one exception [D]. Microsoft: SMTP Basic off by default end of Dec 2026 [D] Refused – – Counter-signal: OAuth flows preferred

Patterns:

  1. Every serious sync product with SSO has app passwords. The modern ones (FileRun, Fastmail, Apple, oCIS) refuse the main password for non-browser clients by default; Nextcloud makes it an admin switch.
  2. Products without app passwords (Synology; Seafile for non-SSO users) are called weak by their own communities.
  3. The best onboarding is a browser-approved flow that mints a per-device password: Nextcloud Login Flow v2, which FileRun reuses so Nextcloud clients and DAVx5 work. A QR code helps for mobile, and manual creation stays as the fallback.
  4. The lifecycle features that keep recurring are these:
    • expiry and a default lifetime;
    • unused clean-up;
    • last used and IP;
    • re-auth before creation;
    • revoke-all on password reset;
    • IdP and directory lifecycle.
  5. Scopes appear where products serve several protocols. For a files-only product, read-only vs read-write is the only split that clearly fits.

2. Users

  • Setup friction is the top complaint: find the settings, create, copy once, paste. DAVx5 and Nextcloud solved it with the browser flow. [F]
  • Password-change surprises in both directions: Nextcloud keeps app passwords after a password change, which users don't expect; with LDAP, tokens broke after a directory password change. [F] The behaviour must be stated in the UI.
  • 2FA and WebDAV confusion: "WebDAV doesn't work with TOTP", "2FA not required for device sessions?" [F]
  • "Which device is this?": without last-used information, nobody cleans up. [F]

3. Operators

  • They want an enforcement switch. Nextcloud's token_auth_enforced is poorly documented and behaves oddly with LDAP [F]. Seafile has no switch at all [F].
  • They want an admin overview; Nextcloud said no [F]. Cairn's #851 count and revoke already goes further.
  • Offboarding: "cycle through active sessions and invalidate all of them" [F]. Operators want one action that kills every credential. #848 and #865 do this; it must also hold for local and LDAP app passwords.
  • Posture: oCIS keeps app auth off by default for security [D]; OpenCloud turns it on. Regulated operators want it off-able.
Source Relevant part Meaning for #895
NIST SP 800-63B-4 (final, July 2025) [D] Single-factor passwords ≥15 characters, max ≥64, blocklist, ≤100 failed attempts. Post-enrollment binding: re-authenticate first, and the CSP SHALL notify the subscriber via a mechanism independent of the binding (SHOULD in drafts) Creating an app password is binding an authenticator, so: re-auth before creation, and notify on creation (bell; email where mail exists). Generated secrets easily exceed the length rules
NIST SP 800-53 r5 [D/K] IA-2(1)/(2) MFA; IA-5(1); AC-6(2) #890 did half of AC-6(2). App passwords complete it: the sync credential is not the account credential
ISO/IEC 27002:2022 [D summary] 5.17 allocate, manage and protect authentication information; 8.5 secure authentication incl. MFA Per-device allocation and revocation (5.17). Paywalled; wording "helps meet"
BSI IT-Grundschutz (Ed. 2023, verified in #880) ORP.4.A8 change a password that may have become known; A10 (S) MFA for wide-rights accounts; A13 (S) delay and lockout; A22/A23 quality Per-device revoke makes A8 practical without changing the account password. A10 stays a gap for local admins without MFA
CIS v8 [D] 6.3 MFA for external apps (IG1); 6.5 MFA for admin WebDAV can't do MFA. The accepted pattern is "MFA in the browser, app password for the client", which becomes meaningful once local accounts have MFA
NIS2 Art. 21(2)(j) + CIR 2024/2690 §11.7 [D via secondary] MFA or continuous authentication "where appropriate" Same as CIS
GDPR Art. 32 / revDSG Art. 8 + DSV Art. 3 [D summary] Appropriate TOMs; DSV access and user control (no use of systems by unauthorised persons via data-transmission facilities) Revocable per-device credentials are a concrete user-control measure. Wording "supports"
OWASP ASVS 5.0 [D partial] V6 authentication: factor lifecycle and recovery Revoke and reset behaviour. IDs not verified in this run
Google / Microsoft [D] Legacy password protocols retired, OAuth preferred, app passwords kept as the exception WebDAV clients (Finder, Explorer, rclone, Cyberduck) can't do OAuth, so app passwords stay needed. A browser-approved flow gives OAuth-like UX where clients support it

5. Implications (input, not decisions)

  1. App passwords in all modes (local, ldap, oidc). This is the market norm, and the store and verifier already exist.
  2. Main password over Basic: (a) allow; (b) admin switch; or (c) refuse always (FileRun, Fastmail, Apple, oCIS default). With no installed base, (c) or "(b) default on" is possible now at no migration cost. (a) keeps the leaked-sync-password-equals-browser-sign-in gap.
  3. Break-glass and config accounts (#880): recovery is through the browser form, so refusing Basic for them costs recovery nothing. Decide whether they may hold app passwords at all.
  4. LDAP: app passwords must follow the directory account like #848 does for OIDC. This avoids OpenCloud's gap.
  5. Lifecycle, by market weight:
    • last used and address;
    • re-auth before creation;
    • creation notification (NIST SHALL);
    • unused clean-up;
    • revoke-all on admin reset (FileRun; Cairn has an unticked checkbox today);
    • per-user limit.
  6. Onboarding: a browser-approved device flow (Nextcloud Login Flow v2-compatible would make Nextcloud clients and DAVx5 work) plus a QR code for cairn-ios/android. This is the biggest piece and could be a follow-up.
  7. Scope: optional read-only app passwords (backup or mirror clients).
  8. #890 and #887: app passwords never carry admin rights (already true). Creating and revoking them should be audited (check the existing verbs). Break-glass stays browser-first.

6. Open questions for Nikola

  1. Main password over WebDAV in local and LDAP mode: (a) allow, (b) admin switch, or (c) refuse always? If (b), which default?
  2. Should config-file and break-glass accounts get app passwords?
  3. Is the device flow (browser approval and QR) part of this issue or a follow-up?
  4. Which of these are in scope: last used and address, re-auth before creation, creation notification, unused clean-up?
  5. Do we want a read-only scope?
  6. On an admin password reset, should revoking all app passwords be ticked by default, always happen, or stay unticked?

Sources (all of them are in the file):

## Research (2026-10-13) The full file with all sources is `scratch/b7e/895-research.md`. Labels: [D] official documentation, [F] forum, issue or blog voice, [K] background knowledge not verified in this run. ### 0. Cairn today - App passwords are wired only in `oidc` mode. In `local` and `ldap` mode, WebDAV and sync use the **account password** over Basic. - **Exists (oidc):** - per-device name; - optional or admin-required expiry (#751); - shown once, verifier only; - admin revoke with count, plus a reset checkbox (#851); - IdP lifecycle (#848); - #887 audit; - #890 no admin rights over Basic. - **Missing:** - last used and address; - scopes; - browser-approved device flow; - creation notification; - per-user limit; - MFA for local accounts. - **The gap:** on local and LDAP instances, a leaked sync password signs in in the browser, and for an admin that means full admin. Revoking one device means changing the password everywhere. ### 1. Market | Product | Modes | Main password over WebDAV/sync | Admin enforcement | Lifecycle | Onboarding | |---|---|---|---|---|---| | **Nextcloud** | All; required with 2FA [D] | Allowed by default | `token_auth_enforced` (default false): "blocks requests using the user password" [D] | Name from user agent, per-token filesystem toggle, remote wipe, auto clean-up after 365 days unused (NC 30+) [D]; password change doesn't revoke them [F] | **Login Flow v2**: browser sign-in mints a per-device app password; poll token 20 min [D]; DAVx5 uses it [D] | | **ownCloud 10** | All; required with 2FA [F] | Allowed unless 2FA | Same flag, unclear in practice [F] | Bug reports (one-time use, migration) [F] | OAuth2 app (browser) [D] | | **oCIS** | `auth-app` **started by hand**, "because generating access tokens is security relevant" [D] | Password Basic **off by default**, called test/dev only [D] | Off by default | Expiry at creation, labels (7.3) [D] | OIDC for its own clients | | **OpenCloud** | `auth-app` **on by default** (7.2) [D] | Password or token [D] | `PROXY_ENABLE_APP_AUTH=false` [D] | Expiry required, label, shown once, admin impersonation for migrations. **Gap:** tokens survive disabling the user in an external IdP [D] (Cairn closed this in #848) | Web UI "App Tokens" [D] | | **Seafile** | One "WebDAV password" (`ENABLE_WEBDAV_SECRET`), aimed at SSO users [D] | Both work, independently (staff answer) [F] | None; staff advice: "disable WebDAV to enforce 2FA" [F] | One per user, not per device | Manual | | **FileRun** | All [D] | **Refused, always**, "whatever your account settings are" [D] | Built in; default expiry 2 years [D] | Connected-apps list with date and creating IP; **re-auth (incl. 2FA) before creation**; password change keeps them, **reset revokes all**; none for guests [D] | Browser approval (Nextcloud-compatible) mints them; manual creation shows user, password, WebDAV URL, **QR code** [D] | | **Pydio Cells** | Personal access tokens replace the password for WebDAV/SFTP [D] | – | – | Hard or sliding expiry [D] | Admin or CLI | | **Synology DSM** | **None** [F] | Yes; WebDAV "does not support 2FA" [D/F] | – | Only "change the account password" [F] | – | | **FileCloud** | None; WebDAV ended in 23.241 [D] | – | – | – | – | | **Gitea/Forgejo** | Scoped tokens | `ENABLE_BASIC_AUTHENTICATION` switch; with MFA, password Basic stops [D] | Admin switch | Docs: a token "sidesteps the security benefits of MFA… last resort" [D] | Manual | | **GitHub/GitLab** | PATs | – | Max lifetime (GitHub default 366 days; GitLab 365 days, non-expiring removed in 16.0) [D] | Scopes, expiry required [D] | Manual | | **Fastmail** | App passwords required for all third-party apps [D] | Refused | Built in | **Scoped**: mail/contacts/calendars vs **Files (WebDAV)** [D] | Manual; OAuth for app makers [D] | | **Apple ID** | App-specific, 2FA required [D] | Refused | Built in | Max 25; revoke one or all [D] | Manual | | **Google / Microsoft** | Google: legacy passwords off since 14 Mar 2025, **app passwords are the one exception** [D]. Microsoft: SMTP Basic off by default end of Dec 2026 [D] | Refused | – | – | **Counter-signal:** OAuth flows preferred | **Patterns:** 1. Every serious sync product with SSO has app passwords. The modern ones (FileRun, Fastmail, Apple, oCIS) **refuse the main password for non-browser clients by default**; Nextcloud makes it an admin switch. 2. Products without app passwords (Synology; Seafile for non-SSO users) are called weak by their own communities. 3. The best onboarding is a **browser-approved flow** that mints a per-device password: Nextcloud Login Flow v2, which FileRun reuses so Nextcloud clients and DAVx5 work. A QR code helps for mobile, and manual creation stays as the fallback. 4. The lifecycle features that keep recurring are these: - expiry and a default lifetime; - unused clean-up; - last used and IP; - re-auth before creation; - revoke-all on password reset; - IdP and directory lifecycle. 5. Scopes appear where products serve several protocols. For a files-only product, **read-only vs read-write** is the only split that clearly fits. ### 2. Users - **Setup friction** is the top complaint: find the settings, create, copy once, paste. DAVx5 and Nextcloud solved it with the browser flow. [F] - **Password-change surprises in both directions:** Nextcloud keeps app passwords after a password change, which users don't expect; with LDAP, tokens broke after a directory password change. [F] The behaviour must be stated in the UI. - **2FA and WebDAV confusion:** "WebDAV doesn't work with TOTP", "2FA not required for device sessions?" [F] - **"Which device is this?":** without last-used information, nobody cleans up. [F] ### 3. Operators - They want an **enforcement switch**. Nextcloud's `token_auth_enforced` is poorly documented and behaves oddly with LDAP [F]. Seafile has no switch at all [F]. - They want an **admin overview**; Nextcloud said no [F]. Cairn's #851 count and revoke already goes further. - **Offboarding:** "cycle through active sessions and invalidate all of them" [F]. Operators want one action that kills every credential. #848 and #865 do this; it must also hold for local and LDAP app passwords. - **Posture:** oCIS keeps app auth off by default for security [D]; OpenCloud turns it on. Regulated operators want it off-able. ### 4. Standards and legal | Source | Relevant part | Meaning for #895 | |---|---|---| | **NIST SP 800-63B-4** (final, July 2025) [D] | Single-factor passwords ≥15 characters, max ≥64, blocklist, ≤100 failed attempts. **Post-enrollment binding:** re-authenticate first, and the CSP **SHALL notify the subscriber** via a mechanism independent of the binding (SHOULD in drafts) | Creating an app password is **binding an authenticator**, so: re-auth before creation, and notify on creation (bell; email where mail exists). Generated secrets easily exceed the length rules | | **NIST SP 800-53 r5** [D/K] | IA-2(1)/(2) MFA; IA-5(1); **AC-6(2)** | #890 did half of AC-6(2). App passwords complete it: the sync credential is not the account credential | | **ISO/IEC 27002:2022** [D summary] | **5.17** allocate, manage and protect authentication information; **8.5** secure authentication incl. MFA | Per-device allocation and revocation (5.17). Paywalled; wording "helps meet" | | **BSI IT-Grundschutz** (Ed. 2023, verified in #880) | ORP.4.A8 change a password that may have become known; A10 (S) MFA for wide-rights accounts; A13 (S) delay and lockout; A22/A23 quality | Per-device revoke makes A8 practical without changing the account password. A10 stays a gap for local admins without MFA | | **CIS v8** [D] | 6.3 MFA for external apps (IG1); 6.5 MFA for admin | WebDAV can't do MFA. The accepted pattern is "MFA in the browser, app password for the client", which becomes meaningful once local accounts have MFA | | **NIS2 Art. 21(2)(j)** + CIR 2024/2690 §11.7 [D via secondary] | MFA or continuous authentication "where appropriate" | Same as CIS | | **GDPR Art. 32 / revDSG Art. 8 + DSV Art. 3** [D summary] | Appropriate TOMs; DSV access and **user control** (no use of systems by unauthorised persons via data-transmission facilities) | Revocable per-device credentials are a concrete user-control measure. Wording "supports" | | **OWASP ASVS 5.0** [D partial] | V6 authentication: factor lifecycle and recovery | Revoke and reset behaviour. IDs not verified in this run | | **Google / Microsoft** [D] | Legacy password protocols retired, OAuth preferred, app passwords kept as the exception | WebDAV clients (Finder, Explorer, rclone, Cyberduck) can't do OAuth, so app passwords stay needed. A browser-approved flow gives OAuth-like UX where clients support it | ### 5. Implications (input, not decisions) 1. **App passwords in all modes** (local, ldap, oidc). This is the market norm, and the store and verifier already exist. 2. **Main password over Basic:** (a) allow; (b) admin switch; or (c) refuse always (FileRun, Fastmail, Apple, oCIS default). With no installed base, (c) or "(b) default on" is possible now at no migration cost. (a) keeps the leaked-sync-password-equals-browser-sign-in gap. 3. **Break-glass and config accounts (#880):** recovery is through the **browser form**, so refusing Basic for them costs recovery nothing. Decide whether they may hold app passwords at all. 4. **LDAP:** app passwords must follow the directory account like #848 does for OIDC. This avoids OpenCloud's gap. 5. **Lifecycle, by market weight:** - last used and address; - re-auth before creation; - creation notification (NIST SHALL); - unused clean-up; - revoke-all on admin **reset** (FileRun; Cairn has an unticked checkbox today); - per-user limit. 6. **Onboarding:** a browser-approved device flow (Nextcloud Login Flow v2-compatible would make Nextcloud clients and DAVx5 work) plus a QR code for cairn-ios/android. This is the biggest piece and could be a follow-up. 7. **Scope:** optional read-only app passwords (backup or mirror clients). 8. **#890 and #887:** app passwords never carry admin rights (already true). Creating and revoking them should be audited (check the existing verbs). Break-glass stays browser-first. ### 6. Open questions for Nikola 1. Main password over WebDAV in local and LDAP mode: (a) allow, (b) admin switch, or (c) refuse always? If (b), which default? 2. Should config-file and break-glass accounts get app passwords? 3. Is the device flow (browser approval and QR) part of this issue or a follow-up? 4. Which of these are in scope: last used and address, re-auth before creation, creation notification, unused clean-up? 5. Do we want a read-only scope? 6. On an admin password reset, should revoking all app passwords be ticked by default, always happen, or stay unticked? **Sources** (all of them are in the file): - Nextcloud: [authentication](https://docs.nextcloud.com/server/stable/admin_manual/configuration_user/authentication.html), [config](https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html), [Login Flow](https://docs.nextcloud.com/server/stable/developer_manual/client_apis/LoginFlow/index.html) - oCIS: [auth-app](https://doc.owncloud.com/ocis/8.2/admin/deployment/services/s-list/auth-app.html), [auth-basic](https://doc.owncloud.com/ocis/8.2/admin/deployment/services/s-list/auth-basic.html) - OpenCloud: [auth-app](https://docs.opencloud.eu/docs/dev/server/services/auth-app/information), [app tokens](https://docs.opencloud.eu/docs/user/admin/app-tokens) - Seafile: [WebDAV](https://manual.seafile.com/latest/extension/webdav/), [forum](https://forum.seafile.com/t/seafdav-password-in-seafile-pro-13/24054) - Others: [FileRun](https://docs.filerun.com/app_passwords), [Pydio](https://docs.pydio.com/latest/admin-guide/connect-your-users/additional-apis/personal-access-tokens/), [Fastmail](https://www.fastmail.help/hc/en-us/articles/360058752854), [Apple](https://support.apple.com/102654), [Google](https://knowledge.workspace.google.com/admin/sync/transition-from-less-secure-apps-to-oauth), [GitHub](https://docs.github.com/en/organizations/managing-programmatic-access-to-your-organization/setting-a-personal-access-token-policy-for-your-organization), [GitLab](https://docs.gitlab.com/user/profile/personal_access_tokens/) - Standards: [NIST 800-63B-4](https://pages.nist.gov/800-63-4/sp800-63b.html), [CIS 6](https://cas.docs.cisecurity.org/en/latest/source/Controls6/), [NIS2 21(2)(j)](https://myctrl.tools/frameworks/nis2/article-21-2-j)
Author
Owner

Decisions (Nikola, 2026-10-13)

  1. The main password over WebDAV/sync is an admin switch, off by default. It needs thorough documentation: what it does, who is affected, how to check that before switching it on, and how to roll it back.
  2. No app passwords for config-file / break-glass accounts. They are emergency administrator accounts that are not used day to day, so a sync credential has no purpose there. Recovery uses the browser sign-in form.
  3. Device flow (browser approval, QR code): I'll make a mockup with a fuller explanation and user flows first.
  4. Last used and address, re-authentication before creating one, a creation notification, unused clean-up: same as 3, mockup and user flows first.
  5. Read-only scope: I'll research first whether the community wants it.
  6. Revoke all app passwords on an admin password reset: the checkbox stays unticked by default, so nobody revokes them by accident. It is prominent enough not to be missed. This is how #851 already works.

Goal (Nikola): do better than Nextcloud on the two top complaints, setup friction and surprises when a password changes. User and operator experience is what sells the product.

## Decisions (Nikola, 2026-10-13) 1. **The main password over WebDAV/sync is an admin switch, off by default.** It needs thorough documentation: what it does, who is affected, how to check that before switching it on, and how to roll it back. 2. **No app passwords for config-file / break-glass accounts.** They are emergency administrator accounts that are not used day to day, so a sync credential has no purpose there. Recovery uses the browser sign-in form. 3. **Device flow (browser approval, QR code):** I'll make a mockup with a fuller explanation and user flows first. 4. **Last used and address, re-authentication before creating one, a creation notification, unused clean-up:** same as 3, mockup and user flows first. 5. **Read-only scope:** I'll research first whether the community wants it. 6. **Revoke all app passwords on an admin password reset:** the checkbox stays **unticked by default**, so nobody revokes them by accident. It is prominent enough not to be missed. This is how #851 already works. **Goal (Nikola):** do better than Nextcloud on the two top complaints, setup friction and surprises when a password changes. User and operator experience is what sells the product.
Author
Owner

Question 5: do people want read-only app passwords? Research

Yes, and it is a long-standing request. The strongest form of it is "limit an app password to one folder"; read-only comes second.

  • Nextcloud server #2866, "Allow to restrict app password data access", opened 2017 on Nextcloud 10 and still open. Users keep asking with the same examples: read-only calendar, contacts read/write, files upload-only. Typical comments:
    • "this feature is desperately needed";
    • "It is a pity such a great feature is not given proper priority";
    • "one HUGE step forward would already be … to scope an app password to a folder which basically becomes the new root folder";
    • "I strongly prefer the principle of least privilege… backup/sync apps".
  • Use cases that come up again and again:
    • a password manager (KeePass, Keepassium, Keepass2Android) that should only see its one database file;
    • backup tools that should only write into one backup folder;
    • website or automatic backups;
    • research and HPC projects in multi-user setups.
  • Related Nextcloud issues: #6030 "Granular Permissions on App Passwords" (merged into #6376, app-specific restrictions), #3228, #17339, #35262 and #26233 (scoped OAuth). Nextcloud only ever shipped one "filesystem access" toggle per token (PR #719).
  • Forum threads: "App-Specific Passwords: Folder/File Permissions", "Limiting access of external apps to a folder", and "Make user with readonly rights for download".
  • Workarounds people use today, and why they fail:
    • Public share links over public.php/webdav: "using Basic Auth with different apps triggers the bruteforce protection very quickly".
    • A separate user per app: "not possible in large corporate installations".
  • Other products: Fastmail scopes by service (mail vs files). SOGo/mailcow scopes per protocol. GitHub and Asana communities asked for read-only scopes too.

What this means for Cairn. Cairn is files-only, so scopes reduce to two meaningful axes:

  1. Read-only vs read-write: cheap, since Cairn already enforces read-only for shares.
  2. Folder-limited: the device sees one folder as its root. This is the most-wanted variant and something Nextcloud has never shipped.

Both work with every WebDAV client unchanged. This is a real differentiator for password-manager, backup and NAS users.

Recommendation: keep #895 to the base, and open a follow-up issue "Connected devices limited to one folder and/or read-only". Its mockup would add one step to "Connect a device": Access: all files / only this folder [pick] · can change files / read only.

Questions 3 and 4: mockup and user flows

The file is ~/Downloads/design-direction-decision-needed/895-app-passwords-mockup.html. It contains a comparison table "Where Cairn can do better than Nextcloud", three user flows, and frames A to G:

  • A. Account › Connected devices (renamed from "App passwords"):
    • a plain-language box: "What happens when you change your password";
    • columns for last used and address, with Never used and Unused for 5 months markers.
  • B. Connect a device: pick the app (Finder, Explorer, rclone, Cyberduck, Cairn app, other), then confirm it's you (password, or sign in again at the IdP; skipped within 10 minutes of a sign-in).
  • C. Ready: server, user and password with copy buttons; instructions for the chosen app (Finder steps, an rclone command with the password already obscured, ...); a QR code; a CAIRN-AP1. prefix so secret scanners can recognise the password.
  • D. Browser approval for Cairn's own apps, with a warning against approving someone else's code. Proposed as a follow-up together with the iOS and Android apps, because Finder, Explorer and rclone can't use a browser flow.
  • E. Notifications:
    • "New device connected" (cannot be muted);
    • "Finder tried to sign in with your account password" (only while the switch is on, at most once per app per day);
    • "Your devices were disconnected".
    • Cairn sends no e-mail today, so the independent channel NIST asks for would need a mail server setting.
  • F. Changing your own password: lists the devices and offers "Also disconnect my 3 devices", unticked. The admin reset dialog is unchanged (decision 6).
  • G. Admin: the switch "Sync apps need app passwords" (off), with a readiness list of accounts that still sync with their account password, a Tell them button, "Remove devices unused for 12 months", and the existing required expiry setting.

Open points (listed at the end of the mockup):

  1. Rename to "Connected devices".
  2. Re-confirm always, or skip within 10 minutes?
  3. Default for removing unused devices.
  4. D as a follow-up.
  5. The "tried your account password" bell item.
  6. E-mail: a separate issue, or the bell only for now?
## Question 5: do people want read-only app passwords? Research **Yes, and it is a long-standing request.** The strongest form of it is **"limit an app password to one folder"**; read-only comes second. - **Nextcloud server #2866**, "Allow to restrict app password data access", opened 2017 on Nextcloud 10 and still open. Users keep asking with the same examples: read-only calendar, contacts read/write, files upload-only. Typical comments: - "this feature is desperately needed"; - "It is a pity such a great feature is not given proper priority"; - "one HUGE step forward would already be … to scope an app password to a folder which basically becomes the new root folder"; - "I strongly prefer the principle of least privilege… backup/sync apps". - **Use cases** that come up again and again: - a password manager (KeePass, Keepassium, Keepass2Android) that should only see its one database file; - backup tools that should only write into one backup folder; - website or automatic backups; - research and HPC projects in multi-user setups. - **Related Nextcloud issues:** #6030 "Granular Permissions on App Passwords" (merged into #6376, app-specific restrictions), #3228, #17339, #35262 and #26233 (scoped OAuth). Nextcloud only ever shipped one "filesystem access" toggle per token (PR #719). - **Forum threads:** "App-Specific Passwords: Folder/File Permissions", "Limiting access of external apps to a folder", and "Make user with readonly rights for download". - **Workarounds people use today, and why they fail:** - **Public share links over `public.php/webdav`:** "using Basic Auth with different apps triggers the bruteforce protection very quickly". - **A separate user per app:** "not possible in large corporate installations". - **Other products:** Fastmail scopes by service (mail vs files). SOGo/mailcow scopes per protocol. GitHub and Asana communities asked for read-only scopes too. **What this means for Cairn.** Cairn is files-only, so scopes reduce to two meaningful axes: 1. **Read-only vs read-write**: cheap, since Cairn already enforces read-only for shares. 2. **Folder-limited**: the device sees one folder as its root. This is the most-wanted variant and something Nextcloud has never shipped. Both work with every WebDAV client unchanged. This is a real differentiator for password-manager, backup and NAS users. **Recommendation:** keep #895 to the base, and open a follow-up issue "Connected devices limited to one folder and/or read-only". Its mockup would add one step to "Connect a device": **Access: all files / only this folder [pick] · can change files / read only**. ## Questions 3 and 4: mockup and user flows The file is `~/Downloads/design-direction-decision-needed/895-app-passwords-mockup.html`. It contains a comparison table "Where Cairn can do better than Nextcloud", three user flows, and frames A to G: - **A. Account › Connected devices** (renamed from "App passwords"): - a plain-language box: "What happens when you change your password"; - columns for last used and address, with *Never used* and *Unused for 5 months* markers. - **B. Connect a device:** pick the app (Finder, Explorer, rclone, Cyberduck, Cairn app, other), then confirm it's you (password, or sign in again at the IdP; skipped within 10 minutes of a sign-in). - **C. Ready:** server, user and password with copy buttons; instructions for the chosen app (Finder steps, an rclone command with the password already obscured, ...); a QR code; a `CAIRN-AP1.` prefix so secret scanners can recognise the password. - **D. Browser approval for Cairn's own apps**, with a warning against approving someone else's code. Proposed as a follow-up together with the iOS and Android apps, because Finder, Explorer and rclone can't use a browser flow. - **E. Notifications:** - "New device connected" (cannot be muted); - "Finder tried to sign in with your account password" (only while the switch is on, at most once per app per day); - "Your devices were disconnected". - Cairn sends **no e-mail** today, so the independent channel NIST asks for would need a mail server setting. - **F. Changing your own password:** lists the devices and offers "Also disconnect my 3 devices", unticked. The admin reset dialog is unchanged (decision 6). - **G. Admin:** the switch "Sync apps need app passwords" (off), with a **readiness list** of accounts that still sync with their account password, a **Tell them** button, "Remove devices unused for 12 months", and the existing required expiry setting. **Open points (listed at the end of the mockup):** 1. Rename to "Connected devices". 2. Re-confirm always, or skip within 10 minutes? 3. Default for removing unused devices. 4. D as a follow-up. 5. The "tried your account password" bell item. 6. E-mail: a separate issue, or the bell only for now?
Author
Owner

Decisions (Nikola, 2026-10-13, round 2)

  • Frame D (approve in the browser) is a follow-up with the Cairn apps. The iOS, Android and desktop apps don't exist yet; they are the first three things to build once Cairn goes live and moves from development to active maintenance. Not part of #895.
  • E-mail: a separate issue, #896, "Connect a mail server". It adds a new admin dashboard section; NIST SP 800-63B-4 is the reason.
  • The open points from the mockup are still open; Nikola will answer them in the next round.

Code check: which sign-ins Cairn records today

Record Who Which sign-ins Granularity Where it shows
lastSignIn in local-users.json (LocalStore.NoteSignIn, auth.go:199/225, setup.go:195) Every local account, admin or not Form sign-in and Basic/WebDAV Written at most once per 15 min Accounts › Local accounts "Last sign-in"; Access "active today"
admin-signins.json (#887 LastSignIns) Accounts that are or can be administrators (incl. config accounts) All paths, plus whether the role was held and through which admin groups At most once per minute Admin review (#888), emergency access, admin rows
License seat lastSeen (license.Manager.Admit) Every account that makes a request (directory accounts included) Any authenticated request Refreshed only once per 24 h (seatRefresh) Accounts › Directory accounts "Last sign-in" (falls back to it), seats
Audit log Administrators only (auth-admin-signin, auth-breakglass-signin) All paths, with source= and the address Basic/app password folded per 10 min Audit log
#864 address watch Every account Address + account pairs 24 h window Client-address detection only

The exact difference, as Nikola asked:

  • Ordinary users do have a last sign-in:
    • local accounts precisely (15 min);
    • directory accounts only via the seat record, which is up to 24 h old, even though the column says "Last sign-in". That is a small inaccuracy worth fixing, ideally within #895's "last used" work.
  • What no record holds for ordinary users is how they signed in (form vs. Basic vs. app password) and with which app. Ordinary sign-ins are also not in the audit log; that is #887's scope, since BSI OPS.1.1.2.A5 is about administrator logins.
  • The admin readiness list in Frame G ("who still syncs with their account password, with which app") needs exactly that missing piece. That means one small new record per account: the last Basic sign-in with the account password, plus the client name, kept 30 days.
## Decisions (Nikola, 2026-10-13, round 2) - **Frame D (approve in the browser) is a follow-up** with the Cairn apps. The iOS, Android and desktop apps don't exist yet; they are the first three things to build once Cairn goes live and moves from development to active maintenance. Not part of #895. - **E-mail:** a separate issue, #896, "Connect a mail server". It adds a new admin dashboard section; NIST SP 800-63B-4 is the reason. - The open points from the mockup are still open; Nikola will answer them in the next round. ## Code check: which sign-ins Cairn records today | Record | Who | Which sign-ins | Granularity | Where it shows | |---|---|---|---|---| | `lastSignIn` in `local-users.json` (`LocalStore.NoteSignIn`, `auth.go:199/225`, `setup.go:195`) | **Every local account**, admin or not | Form sign-in **and** Basic/WebDAV | Written at most once per 15 min | Accounts › Local accounts "Last sign-in"; Access "active today" | | `admin-signins.json` (#887 `LastSignIns`) | Accounts that **are or can be administrators** (incl. config accounts) | All paths, plus whether the role was held and through which admin groups | At most once per minute | Admin review (#888), emergency access, admin rows | | License seat `lastSeen` (`license.Manager.Admit`) | **Every account** that makes a request (directory accounts included) | Any authenticated request | Refreshed only **once per 24 h** (`seatRefresh`) | Accounts › Directory accounts "Last sign-in" (falls back to it), seats | | Audit log | **Administrators only** (`auth-admin-signin`, `auth-breakglass-signin`) | All paths, with `source=` and the address | Basic/app password folded per 10 min | Audit log | | #864 address watch | Every account | Address + account pairs | 24 h window | Client-address detection only | **The exact difference, as Nikola asked:** - Ordinary users **do** have a last sign-in: - local accounts precisely (15 min); - directory accounts only via the seat record, which is **up to 24 h old**, even though the column says "Last sign-in". That is a small inaccuracy worth fixing, ideally within #895's "last used" work. - What **no record holds for ordinary users** is **how** they signed in (form vs. Basic vs. app password) and **with which app**. Ordinary sign-ins are also not in the audit log; that is #887's scope, since BSI OPS.1.1.2.A5 is about administrator logins. - The admin readiness list in Frame G ("who still syncs with their account password, with which app") needs exactly that missing piece. That means one small new record per account: the last Basic sign-in with the account password, plus the client name, kept 30 days.
Author
Owner

Audit log and the new sign-in record (Nikola: "do those go to the audit log?")

The audit log is already the instance-wide log, with two tiers (#842):

  • admin tier, always recorded: accounts, roles, settings, keys, administrator sign-ins (#887);
  • access tier, follows the runtime toggle: users acting on content (file reads and writes, WebDAV, own shares).

retainMonths prunes both tiers.

Proposal: two places, each for its own job.

  1. Audit log, new verb auth-signin, access tier. It covers sign-ins of ordinary accounts, with source=form|oidc|ldap|basic|apppassword, the app name and the address (#864 audit.ip mode). Like #887 it is folded per account, path and app to one event per 10 minutes, so sync clients don't flood it. Administrators keep their admin-tier verbs, so nothing changes there.
  2. Readiness record, 30 days. One entry per account and app for "last Basic sign-in with the account password", dropped after 30 days, used only by the Frame G list. It is separate from the log because:
    • the readiness list must work even when the access toggle is off;
    • the append-only audit log can't expire entries after 30 days;
    • data minimisation, since this record is a working list, not evidence.

Gap found while checking: creating and deleting your own app password is not audited at all today. Only an admin's bulk revoke is (app-passwords-revoked-by-admin, #851). #895 adds two admin-tier verbs, because these concern credentials, not content:

  • app-password-created (name, app, address);
  • app-password-revoked (by whom: the owner, an admin, unused clean-up, account disabled).

It also adds app-password-required-changed for the admin switch.

Docs: data-protection-operators.md gets ordinary sign-ins as personal data in the access tier, in the same wording as the #864 address section.

## Audit log and the new sign-in record (Nikola: "do those go to the audit log?") The audit log is already the instance-wide log, with two tiers (#842): - **admin tier, always recorded:** accounts, roles, settings, keys, administrator sign-ins (#887); - **access tier, follows the runtime toggle:** users acting on content (file reads and writes, WebDAV, own shares). `retainMonths` prunes both tiers. **Proposal: two places, each for its own job.** 1. **Audit log, new verb `auth-signin`, access tier.** It covers sign-ins of ordinary accounts, with `source=form|oidc|ldap|basic|apppassword`, the app name and the address (#864 `audit.ip` mode). Like #887 it is folded per account, path and app to one event per 10 minutes, so sync clients don't flood it. Administrators keep their admin-tier verbs, so nothing changes there. 2. **Readiness record, 30 days.** One entry per account and app for "last Basic sign-in with the account password", dropped after 30 days, used only by the Frame G list. It is separate from the log because: - the readiness list must work even when the access toggle is off; - the append-only audit log can't expire entries after 30 days; - data minimisation, since this record is a working list, not evidence. **Gap found while checking:** creating and deleting your **own** app password is **not audited at all** today. Only an admin's bulk revoke is (`app-passwords-revoked-by-admin`, #851). #895 adds two admin-tier verbs, because these concern credentials, not content: - `app-password-created` (name, app, address); - `app-password-revoked` (by whom: the owner, an admin, unused clean-up, account disabled). It also adds `app-password-required-changed` for the admin switch. **Docs:** data-protection-operators.md gets ordinary sign-ins as personal data in the access tier, in the same wording as the #864 address section.
Author
Owner

Decisions (Nikola, 2026-10-13, round 3) and mockup revision 2

Approved: the separate 30-day readiness record. It is used only by the "Sync apps need app passwords" readiness list.

Open points answered:

  1. The UI says "Connected devices". The docs say "Connected devices (app passwords)" wherever it matters (account.md, users-access.md, deployment.md, the settings reference, the API notes), so an admin searching for "app passwords" finds it.
  2. Confirm-it's-you is skipped within 10 minutes of a sign-in.
  3. Remove devices unused for: default 12 months, choices Never · 3 · 6 · 12 · 24 months.
  4. The server side of the browser approval is built now; the apps come after launch. The iOS, Android and desktop apps follow after Swisscairn and Cairn launch.
  5. The "Finder tried to sign in with your account password" bell item: yes.
  6. Bell now, plus e-mail once a mail server can be connected (#896).

Mockup changes (895-app-passwords-mockup.html):

  • Frame C shows only the setup for the app picked in Frame B. The "Picked rclone instead?" line is gone.
  • Frame D now has two lanes, both on the same server endpoints:
    • D1, on the device itself (the usual case). On a phone, the app opens Cairn in a browser sheet over the app (iOS ASWebAuthenticationSession, Android Custom Tabs). On a computer it uses the default browser. If that browser isn't signed in, Cairn's normal sign-in comes first, including the IdP and its two-factor. Then the approval page, then straight back into the app. This is how Nextcloud does it. No code and no warning box are needed, because request and approval are on the same screen.
    • D2, approve on another device. For a computer without a browser session, a NAS, a TV or a CLI tool: the app shows a code and a QR code, and you scan it with your phone or open /connect wherever you're signed in. This is the OAuth device authorization flow (RFC 8628). The approval page shows where the request comes from and asks you to compare the code.
  • Server scope now, for D:
    • the /connect page;
    • the request and poll endpoints;
    • 10-minute expiry and rate limits;
    • the audit event app-password-created source=approval;
    • the bell item.
    • It can be tested with a small test client or curl. The final split (inside #895, or a sibling issue) is decided when the plan is written.
## Decisions (Nikola, 2026-10-13, round 3) and mockup revision 2 **Approved:** the separate 30-day readiness record. It is used only by the "Sync apps need app passwords" readiness list. **Open points answered:** 1. **The UI says "Connected devices".** The docs say "Connected devices (app passwords)" wherever it matters (account.md, users-access.md, deployment.md, the settings reference, the API notes), so an admin searching for "app passwords" finds it. 2. **Confirm-it's-you is skipped within 10 minutes of a sign-in.** 3. **Remove devices unused for: default 12 months**, choices Never · 3 · 6 · 12 · 24 months. 4. **The server side of the browser approval is built now; the apps come after launch.** The iOS, Android and desktop apps follow after Swisscairn and Cairn launch. 5. **The "Finder tried to sign in with your account password" bell item: yes.** 6. **Bell now, plus e-mail once a mail server can be connected (#896).** **Mockup changes (`895-app-passwords-mockup.html`):** - **Frame C** shows only the setup for the app picked in Frame B. The "Picked rclone instead?" line is gone. - **Frame D now has two lanes, both on the same server endpoints:** - **D1, on the device itself (the usual case).** On a phone, the app opens Cairn in a browser sheet over the app (iOS ASWebAuthenticationSession, Android Custom Tabs). On a computer it uses the default browser. If that browser isn't signed in, Cairn's normal sign-in comes first, including the IdP and its two-factor. Then the approval page, then straight back into the app. This is how Nextcloud does it. No code and no warning box are needed, because request and approval are on the same screen. - **D2, approve on another device.** For a computer without a browser session, a NAS, a TV or a CLI tool: the app shows a code and a QR code, and you scan it with your phone or open `/connect` wherever you're signed in. This is the OAuth device authorization flow (RFC 8628). The approval page shows where the request comes from and asks you to compare the code. - **Server scope now, for D:** - the `/connect` page; - the request and poll endpoints; - 10-minute expiry and rate limits; - the audit event `app-password-created source=approval`; - the bell item. - It can be tested with a small test client or curl. The final split (inside #895, or a sibling issue) is decided when the plan is written.
Author
Owner

Research: LDAP account not found. Delete devices, use a stable ID, or pause? (full file: scratch/b7e/895-ldap-lifecycle-research.md)

Correction first: in option C, "cleaned up a month later" meant the stored records. Access ends immediately, at the next directory re-check (≤ directoryRecheck, default 5 min), the same moment browser sessions end. A, B and C all cut a departed person off at the same moment, so C has no leak window.

How others do it:

  • Nextcloud never deletes automatically. It marks LDAP users it can't find as "remnants", and the admin runs ldap:show-remnants and then user:delete. Its docs warn that an unreachable LDAP server marks its users as deleted, and the forums are full of remnant clean-up that fails.
  • GitLab blocks rather than deletes (ldap_blocked). Its docs: "All users are blocked if the LDAP server is unavailable when an LDAP user synchronization is run", and the users are not unblocked by the next sync. See also issue #480 (spurious blocks) and issue 592315 (no audit event for LDAP blocks).
  • Gitea 1.10.4 added "Prevent empty LDAP search from deactivating all users" (#9879). Another mass deactivation there came from username case.
  • Keycloak and Mattermost key LDAP users on objectGUID/entryUUID, with documented pitfalls: changing the ID attribute is risky, users get deleted and recreated, AD LDS has its own GUIDs, encodings differ.

Why not B (stable ID) in Cairn:

  • The ID itself is not that stable. An AD restore without a tombstone gives a new objectGUID (Veeam), ADMT inter-forest migration gives new GUIDs (Microsoft), and an OpenLDAP reload or slapmodify can change entryUUID.
  • Cairn's whole LDAP identity is the username: home folders, shares, spaces, audit. Putting only devices on a GUID would split identities. After a rename the person is a new Cairn user, yet their old devices would keep reaching the old home.
  • B doesn't fix the realistic false "not found" causes. A base or filter mistake, or a move outside the base, isn't helped by a GUID, because the search runs under the same base.
  • B only makes sense as a product-wide change to LDAP identity, which would be its own large project with its own migration.

Recommendation: C, hardened

  1. Pause access at once. A device of an account that is not found or disabled is refused at the next re-check. LDAP device records are re-checked by username with non-legacy rules: the record's name is the canonical LDAP name.
  2. Keep the records for 30 days, refused. If the account comes back within that time (for example after a config mistake is fixed), the devices work again with nothing to redo. This matches Nextcloud's "mark, don't delete", GitLab's "block, don't delete", and Cairn's own #865 rule ("kept, refused").
  3. Purge after 30 days of continuous absence or disablement. A daily sweep re-checks every LDAP account that holds devices, which also catches devices nobody uses. Audited as app-password-revoked by=directory.
  4. Mass-miss guard (the Gitea lesson). When more than 5 accounts and more than 20 % of LDAP accounts with devices are not found within an hour, access stays refused (fail closed), but admins get a bell item and a WARN. Example: "{n} directory accounts were not found within an hour. If your LDAP base or filter changed, check it: their devices are paused and come back once the accounts are found again." The purge is suspended for that batch until an admin acknowledges it.
  5. An outage never counts as "not found" (as today: an error means an outage, an ambiguous match is an error).
  6. Every pause, resume and purge is audited (the GitLab lesson).
  7. OIDC stays as #848: removal by Keycloak ID, immediately.
A delete at once B stable ID C hardened
Departed user cut off next re-check next re-check next re-check
Admin LDAP config mistake every device destroyed still destroyed paused, alert, back automatically when fixed
AD restore or migration destroyed new GUID, so devices dead back if the username is the same
Rename destroyed (correct: a new Cairn user) devices keep reaching the old identity paused, then purged
Build cost small large small to medium
## Research: LDAP account not found. Delete devices, use a stable ID, or pause? (full file: `scratch/b7e/895-ldap-lifecycle-research.md`) **Correction first:** in option C, "cleaned up a month later" meant the **stored records**. **Access ends immediately**, at the next directory re-check (≤ `directoryRecheck`, default 5 min), the same moment browser sessions end. A, B and C all cut a departed person off at the same moment, so C has no leak window. **How others do it:** - **Nextcloud** never deletes automatically. It marks LDAP users it can't find as "remnants", and the admin runs `ldap:show-remnants` and then `user:delete`. Its docs warn that an unreachable LDAP server marks its users as deleted, and the forums are full of remnant clean-up that fails. - **GitLab** blocks rather than deletes (`ldap_blocked`). Its docs: "All users are blocked if the LDAP server is unavailable when an LDAP user synchronization is run", and the users are not unblocked by the next sync. See also issue #480 (spurious blocks) and issue 592315 (no audit event for LDAP blocks). - **Gitea 1.10.4** added "Prevent empty LDAP search from deactivating all users" (#9879). Another mass deactivation there came from username case. - **Keycloak and Mattermost** key LDAP users on objectGUID/entryUUID, with documented pitfalls: changing the ID attribute is risky, users get deleted and recreated, AD LDS has its own GUIDs, encodings differ. **Why not B (stable ID) in Cairn:** - **The ID itself is not that stable.** An AD restore without a tombstone gives a **new objectGUID** (Veeam), ADMT inter-forest migration gives new GUIDs (Microsoft), and an OpenLDAP reload or `slapmodify` can change entryUUID. - **Cairn's whole LDAP identity is the username:** home folders, shares, spaces, audit. Putting only devices on a GUID would split identities. After a rename the person is a new Cairn user, yet their old devices would keep reaching the **old** home. - **B doesn't fix the realistic false "not found" causes.** A base or filter mistake, or a move outside the base, isn't helped by a GUID, because the search runs under the same base. - B only makes sense as a product-wide change to LDAP identity, which would be its own large project with its own migration. **Recommendation: C, hardened** 1. **Pause access at once.** A device of an account that is not found or disabled is refused at the next re-check. LDAP device records are re-checked by username with non-legacy rules: the record's name *is* the canonical LDAP name. 2. **Keep the records for 30 days, refused.** If the account comes back within that time (for example after a config mistake is fixed), the devices work again with nothing to redo. This matches Nextcloud's "mark, don't delete", GitLab's "block, don't delete", and Cairn's own #865 rule ("kept, refused"). 3. **Purge after 30 days of continuous absence or disablement.** A daily sweep re-checks every LDAP account that holds devices, which also catches devices nobody uses. Audited as `app-password-revoked by=directory`. 4. **Mass-miss guard (the Gitea lesson).** When more than 5 accounts **and** more than 20 % of LDAP accounts with devices are not found within an hour, access stays refused (fail closed), but admins get a bell item and a WARN. Example: "{n} directory accounts were not found within an hour. If your LDAP base or filter changed, check it: their devices are paused and come back once the accounts are found again." The purge is suspended for that batch until an admin acknowledges it. 5. **An outage never counts as "not found"** (as today: an error means an outage, an ambiguous match is an error). 6. **Every pause, resume and purge is audited** (the GitLab lesson). 7. **OIDC stays as #848:** removal by Keycloak ID, immediately. | | A delete at once | B stable ID | **C hardened** | |---|---|---|---| | Departed user cut off | next re-check | next re-check | **next re-check** | | Admin LDAP config mistake | **every device destroyed** | still destroyed | paused, alert, **back automatically when fixed** | | AD restore or migration | destroyed | **new GUID, so devices dead** | back if the username is the same | | Rename | destroyed (correct: a new Cairn user) | devices keep reaching the **old** identity | paused, then purged | | Build cost | small | large | small to medium |
Author
Owner

Spec approved (Nikola, 2026-10-14)

Decision: hardened C for LDAP accounts that are not found or are disabled. Their devices are paused at once, the records are kept for 30 days, and then purged. A mass-miss guard and audit come with it.

Also approved:

  • pre-upgrade device records start their unused clock at the upgrade;
  • device passwords are wired outside the browser-form provider, so the form and confirm-it's-you accept only the account password.

Spec: docs/superpowers/specs/2026-10-14-connected-devices-895-design.md on branch connected-devices-895.

Next: the implementation plan.

## Spec approved (Nikola, 2026-10-14) **Decision:** hardened C for LDAP accounts that are not found or are disabled. Their devices are paused at once, the records are kept for 30 days, and then purged. A mass-miss guard and audit come with it. **Also approved:** - pre-upgrade device records start their unused clock at the upgrade; - device passwords are wired outside the browser-form provider, so the form and confirm-it's-you accept only the account password. **Spec:** `docs/superpowers/specs/2026-10-14-connected-devices-895-design.md` on branch `connected-devices-895`. **Next:** the implementation plan.
Cordy closed this issue 2026-10-14 02:23:51 +00:00
Author
Owner

Shipped in v0.6.339 (PR #898)

Both dogfoods run it (homelab-config 6161af2) and started cleanly (version=v0.6.339, no errors). CI is green after one fix: a German relative-time test assertion is now gated, because the runner's Node has small-ICU.

Built: spec §1–§11 in full. Device approval (Frame D) is server side only; the apps come later.

Process: 11 tasks, each implemented and reviewed by a fresh subagent, with fix rounds. The reviews caught and fixed several real problems:

  • a device password could have opened a browser session (wiring; found by the builder check);
  • the upgrade baseline ran on every start instead of once;
  • per-account caps were missing for User-Agent-derived client names (bell eviction, readiness, sign-in folding);
  • a stale clean-up warning still counted after the period changed;
  • the maintenance loop had no panic guard;
  • device approval keyed IPv6 limits per address instead of per /64, and the redirect was loose;
  • in local mode, a device of a deleted account was still accepted;
  • OIDC "Sign in again" did not force re-authentication;
  • config accounts could keep devices created before the upgrade.

The final whole-branch review was done after one fix wave.

Live checks so far (curl, files-bao):

  • POST /api/v1/connect/requests returns the RFC 8628 shape (code XXXX-XXXX, 600 s, interval 5, #connect?code= link). The token poll answers authorization_pending.
  • A non-cairn:// redirect gets 400 bad-request.
  • /api/v1/app-passwords without sign-in gets 401.

Still to check in the UI: Nikola signs in to both dogfoods (the restart signed everyone out), then the screens are checked.

Calls Nikola should know about:

  • Allow on the approval page needs a recent sign-in or confirmation. This is anti-phishing per RFC 8628 §5.4.
  • Approved devices get the required expiry: the admin maximum, else 12 months.
  • OIDC users need an IdP that sends auth_time to connect devices. Keycloak sends it.
  • The bell items for clean-up and "Tell them" can be cleared but not muted.
  • Per-account caps:
    • 100 devices;
    • 10 apps per account in readiness and sign-in folding;
    • one refused-app bell item per day.
  • For the apps work: the pending approval pool is capped per /64; revisit with a per-/48 cap before the apps ship.
## Shipped in v0.6.339 (PR #898) Both dogfoods run it (homelab-config 6161af2) and started cleanly (`version=v0.6.339`, no errors). CI is green after one fix: a German relative-time test assertion is now gated, because the runner's Node has small-ICU. **Built:** spec §1–§11 in full. Device approval (Frame D) is server side only; the apps come later. **Process:** 11 tasks, each implemented and reviewed by a fresh subagent, with fix rounds. The reviews caught and fixed several real problems: - a device password could have opened a browser session (wiring; found by the builder check); - the upgrade baseline ran on every start instead of once; - per-account caps were missing for User-Agent-derived client names (bell eviction, readiness, sign-in folding); - a stale clean-up warning still counted after the period changed; - the maintenance loop had no panic guard; - device approval keyed IPv6 limits per address instead of per /64, and the redirect was loose; - in local mode, a device of a deleted account was still accepted; - OIDC "Sign in again" did not force re-authentication; - config accounts could keep devices created before the upgrade. The final whole-branch review was done after one fix wave. **Live checks so far (curl, files-bao):** - `POST /api/v1/connect/requests` returns the RFC 8628 shape (code `XXXX-XXXX`, 600 s, interval 5, `#connect?code=` link). The token poll answers `authorization_pending`. - A non-`cairn://` redirect gets 400 `bad-request`. - `/api/v1/app-passwords` without sign-in gets 401. **Still to check in the UI:** Nikola signs in to both dogfoods (the restart signed everyone out), then the screens are checked. **Calls Nikola should know about:** - **Allow on the approval page needs a recent sign-in or confirmation.** This is anti-phishing per RFC 8628 §5.4. - **Approved devices get the required expiry:** the admin maximum, else 12 months. - **OIDC users need an IdP that sends `auth_time`** to connect devices. Keycloak sends it. - **The bell items for clean-up and "Tell them" can be cleared but not muted.** - **Per-account caps:** - 100 devices; - 10 apps per account in readiness and sign-in folding; - one refused-app bell item per day. - **For the apps work:** the pending approval pool is capped per /64; revisit with a per-/48 cap before the apps ship.
Author
Owner

Follow-up shipped in v0.6.340 (PR #899), from Nikola's live check of v0.6.339.

"Login failed" after Sign in again

  • Root cause: Keycloak 25+ only puts auth_time in the ID token when the client has the basic client scope. The Cairn client lacked it, so the reauth check failed closed, without logging anything.
  • Fixed for the homelab in the realm file (homelab-config k3s/keycloak/realm-configmap.yaml). The live realm needs it added once in the Keycloak console.
  • Product changes:
    • Every failed OIDC callback now logs one WARN oidc callback failed with a reason.
    • A failed or cancelled Sign in again goes back to the connect or approval dialog with a message, instead of the 401 page.
    • next now refuses backslashes and control characters.
  • Docs: deployment.md, users-access.md, account.md and ARCHITECTURE.md.

Drift from the approved mockup. Everything is fixed per spec docs/superpowers/specs/2026-10-14-fix-895b-design.md:

  • A1-A11: page structure; primary button; count and summary; headers; sort (used first, then never used, then unused); chips; ISO dates; footer; deep links.
  • B1-B5: about 640 px dialog; expiry select capped by the admin maximum; focus ring; first Continue click.
  • C1-C4: amber "Shown once"; paper box with bold terms; "Show setup for another app".
  • D1-D2: approval address and result dialog.
  • E1: bell icons per kind.
  • F1-F3: info box; stray "Connected …" text; #account/<section> routes.
  • G1: one settings box with the amber readiness box, readable in dark themes.

Open follow-up (not drift): the default name for a new device can repeat an existing one, for example a second "rclone". A follow-up could append " 2" when the name is already taken.

Both dogfoods are on v0.6.340 (homelab-config 105511e).

**Follow-up shipped in v0.6.340 (PR #899)**, from Nikola's live check of v0.6.339. **"Login failed" after Sign in again** - Root cause: Keycloak 25+ only puts `auth_time` in the ID token when the client has the `basic` client scope. The Cairn client lacked it, so the reauth check failed closed, without logging anything. - Fixed for the homelab in the realm file (homelab-config `k3s/keycloak/realm-configmap.yaml`). The live realm needs it added once in the Keycloak console. - Product changes: - Every failed OIDC callback now logs one WARN `oidc callback failed` with a `reason`. - A failed or cancelled Sign in again goes back to the connect or approval dialog with a message, instead of the 401 page. - `next` now refuses backslashes and control characters. - Docs: deployment.md, users-access.md, account.md and ARCHITECTURE.md. **Drift from the approved mockup.** Everything is fixed per spec `docs/superpowers/specs/2026-10-14-fix-895b-design.md`: - A1-A11: page structure; primary button; count and summary; headers; sort (used first, then never used, then unused); chips; ISO dates; footer; deep links. - B1-B5: about 640 px dialog; expiry select capped by the admin maximum; focus ring; first Continue click. - C1-C4: amber "Shown once"; paper box with bold terms; "Show setup for another app". - D1-D2: approval address and result dialog. - E1: bell icons per kind. - F1-F3: info box; stray "Connected …" text; `#account/<section>` routes. - G1: one settings box with the amber readiness box, readable in dark themes. **Open follow-up (not drift):** the default name for a new device can repeat an existing one, for example a second "rclone". A follow-up could append " 2" when the name is already taken. Both dogfoods are on v0.6.340 (homelab-config 105511e).
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#895
No description provided.