Emergency access visibility: break-glass sign-in alert, "no break-glass" warning, emergency-path notices (split from #880) #887

Closed
opened 2026-10-12 20:37:38 +00:00 by Cordy · 6 comments
Owner

Split from #880 on 2026-10-12. #880 keeps the rules (who can be removed, demoted or disabled). This issue covers making emergency access visible. It needs a mockup before any UI work. Research is in scratch/b7e/880-research.md and 880-standards.md; see the #880 comments.

Decided (Nikola, 2026-10-12)

  • Break-glass sign-in alert: an audit event that is always written, plus a bell item for all admins. The config-file break-glass account is not used day to day, so every use matters.
  • Recommended setup: two emergency paths.
    • One config-file break-glass account (auth.users + auth.admins, or the env admin).
    • One local-store admin.
    • Both are independent of the IdP. In the docs these are "two emergency paths", not "two break-glass accounts".

Scope

  1. auth-breakglass-signin audit event. Always recorded, on every sign-in path: the form, Basic and WebDAV. It also triggers a bell item for all admins that can't be muted, worded like "The emergency account {name} signed in from {address}".
  2. Overview card when no break-glass account exists (pattern from #864). Admin rights rest only on IdP groups, dashboard grants or local accounts. The card carries the copyable recovery recipe: cairnd hash-password → env admin or auth.users + auth.admins → restart. Also a startup WARN.
  3. Lower-severity notice when only one emergency path exists. Either a config-file account or a local admin, but not both. The notice cites the two-path recommendation.
  4. Audit and bell when an emergency path is removed. A local admin deleted, demoted or disabled while it is one of the emergency paths. With a break-glass account present the local floor is off (#880), so this keeps the second path from vanishing silently.
  5. To decide when this issue is worked on: should Cairn audit every admin sign-in? BSI OPS.1.1.2.A5 requires all admin logins to be logged, and today Cairn writes no sign-in event at all.

Standards this supports (claims to use only once shipped; full table in 880-standards.md)

  • BK AR012 Beilage 2 (Swiss Federal Chancellery): break-glass use "muss … detektiert werden … alarmiert".
  • BSI ORP.4.A20 and OPS.1.1.2.A2/A5/A27/A28.
  • ISO/IEC 27001 A.8.2/A.8.15/A.8.16. The standard is paywalled, so wording is from secondary sources.
  • NIST SP 800-53 AC-2 "account of last resort", AC-6(9), AU-6.
  • IKT-Minimalstandard PR.AC-1.
  • Entra and CIS: two emergency accounts.
  • NIS2 Art. 21(2)(c)(i).
  • HIPAA 164.312(a)(2)(ii).

Do not claim: AC-2(2), ISO 8.2 "time windows", ISG/ISV, MFA for break-glass.

Split from #880 on 2026-10-12. #880 keeps the rules (who can be removed, demoted or disabled). This issue covers making emergency access **visible**. It needs a mockup before any UI work. Research is in `scratch/b7e/880-research.md` and `880-standards.md`; see the #880 comments. ## Decided (Nikola, 2026-10-12) - **Break-glass sign-in alert:** an audit event that is always written, plus a bell item for **all admins**. The config-file break-glass account is not used day to day, so every use matters. - **Recommended setup: two emergency paths.** - One config-file break-glass account (`auth.users` + `auth.admins`, or the env admin). - One local-store admin. - Both are independent of the IdP. In the docs these are "two emergency paths", not "two break-glass accounts". ## Scope 1. **`auth-breakglass-signin` audit event.** Always recorded, on every sign-in path: the form, Basic and WebDAV. It also triggers a bell item for all admins that can't be muted, worded like "The emergency account {name} signed in from {address}". 2. **Overview card when no break-glass account exists** (pattern from #864). Admin rights rest only on IdP groups, dashboard grants or local accounts. The card carries the copyable recovery recipe: `cairnd hash-password` → env admin or `auth.users` + `auth.admins` → restart. Also a startup WARN. 3. **Lower-severity notice when only one emergency path exists.** Either a config-file account or a local admin, but not both. The notice cites the two-path recommendation. 4. **Audit and bell when an emergency path is removed.** A local admin deleted, demoted or disabled while it is one of the emergency paths. With a break-glass account present the local floor is off (#880), so this keeps the second path from vanishing silently. 5. **To decide when this issue is worked on:** should Cairn audit **every** admin sign-in? BSI OPS.1.1.2.A5 requires all admin logins to be logged, and today Cairn writes no sign-in event at all. ## Standards this supports (claims to use only once shipped; full table in 880-standards.md) - BK AR012 Beilage 2 (Swiss Federal Chancellery): break-glass use "muss … detektiert werden … alarmiert". - BSI ORP.4.A20 and OPS.1.1.2.A2/A5/A27/A28. - ISO/IEC 27001 A.8.2/A.8.15/A.8.16. The standard is paywalled, so wording is from secondary sources. - NIST SP 800-53 AC-2 "account of last resort", AC-6(9), AU-6. - IKT-Minimalstandard PR.AC-1. - Entra and CIS: two emergency accounts. - NIS2 Art. 21(2)(c)(i). - HIPAA 164.312(a)(2)(ii). Do **not** claim: AC-2(2), ISO 8.2 "time windows", ISG/ISV, MFA for break-glass.
Author
Owner

Added scope from the BSI verification (2026-10-12, scratch/b7e/880-bsi-verify.md)

  1. Audit every successful admin sign-in, from any source. BSI OPS.1.1.2.A5 is a MUST. It shares the code path with item 1, so scope item 5 is now recommended yes; confirm when this issue is worked on.
  2. Audit and bell when privileged rights change: promote, demote, admin-group mapping change, disable of an admin. Basis: AR012 Prinzip 12, NIST AC-2(4). This merges with item 4.
  3. "Last sign-in" per admin, including break-glass. It makes the regular emergency-access test visible (Entra recommends every 90 days). Basis: NIST AC-9, ORP.4.A1.

When this ships, update docs/handbook/security-standards.md (created in #880): move these rows from "planned (#887)" to "shipped".

## Added scope from the BSI verification (2026-10-12, `scratch/b7e/880-bsi-verify.md`) 6. **Audit every successful admin sign-in, from any source.** BSI OPS.1.1.2.A5 is a MUST. It shares the code path with item 1, so scope item 5 is now **recommended yes**; confirm when this issue is worked on. 7. **Audit and bell when privileged rights change:** promote, demote, admin-group mapping change, disable of an admin. Basis: AR012 Prinzip 12, NIST AC-2(4). This merges with item 4. 8. **"Last sign-in" per admin, including break-glass.** It makes the regular emergency-access test visible (Entra recommends every 90 days). Basis: NIST AC-9, ORP.4.A1. When this ships, update `docs/handbook/security-standards.md` (created in #880): move these rows from "planned (#887)" to "shipped".
Author
Owner

Added from the #880 final review: when a restart leaves no break-glass account (auth-breakglass-changed with removed= and an empty set), warn in the startup log, on the Overview card and in the admin bell. Today only the audit event records it. Also cover a changed break-glass password: the startup audit compares names only, so a password change writes nothing today. Decide here whether a hash fingerprint should be compared too.

Added from the #880 final review: when a restart leaves **no** break-glass account (`auth-breakglass-changed` with `removed=` and an empty set), warn in the startup log, on the Overview card and in the admin bell. Today only the audit event records it. Also cover a changed break-glass *password*: the startup audit compares names only, so a password change writes nothing today. Decide here whether a hash fingerprint should be compared too.
Author
Owner

Decisions (Nikola, 2026-10-13)

  • Mockup approved (887-emergency-access-mockup.html, revised):
    • no audit table in Users & access, the events stay in the audit log only;
    • every "Show in audit log" link opens #admin/audit/query?user=&actions= with the filter already set, and works on any instance;
    • a new action-picker group "Sign-in & administrators".
  • Audit admin sign-ins: yes. Interpretation: access to the file server, meaning browser and SSO sign-ins.
  • The "one emergency path" notice can be dismissed for 90 days. The "no emergency account" card cannot.
  • Fingerprint the config-file emergency account's password hash, so a changed password is recorded too (changed=<name>). The hash itself is never logged.

Open finding (2026-10-13)

requireAdmin accepts any authenticated request, so an admin's app password or Basic credentials can call the admin API. BSI OPS.1.1.2.A5 (verified, Edition 2023): "Jeder Anmeldevorgang (Login) über eine Administrationskennung MUSS protokolliert werden." It makes no protocol exception, so today a WebDAV or app-password login of an admin is an admin login.

Proposal: the admin API accepts interactive sessions only, and answers Basic and app passwords with 403 admin-needs-session. Logging browser and SSO sign-ins then covers A5 exactly, and it is least privilege (NIST AC-6(2), BSI OPS.1.1.2.A22). No handbook page uses Basic against /api/v1/admin/*. Waiting for Nikola's decision.

## Decisions (Nikola, 2026-10-13) - **Mockup approved** (`887-emergency-access-mockup.html`, revised): - no audit table in Users & access, the events stay in the audit log only; - every "Show in audit log" link opens `#admin/audit/query?user=&actions=` with the filter already set, and works on any instance; - a new action-picker group "Sign-in & administrators". - **Audit admin sign-ins:** yes. Interpretation: access to the file server, meaning browser and SSO sign-ins. - The "one emergency path" notice can be dismissed for 90 days. The "no emergency account" card cannot. - **Fingerprint the config-file emergency account's password hash**, so a changed password is recorded too (`changed=<name>`). The hash itself is never logged. ## Open finding (2026-10-13) `requireAdmin` accepts **any** authenticated request, so an admin's app password or Basic credentials can call the admin API. BSI OPS.1.1.2.A5 (verified, Edition 2023): "Jeder Anmeldevorgang (Login) über eine Administrationskennung MUSS protokolliert werden." It makes no protocol exception, so today a WebDAV or app-password login of an admin is an admin login. **Proposal:** the admin API accepts interactive sessions only, and answers Basic and app passwords with 403 `admin-needs-session`. Logging browser and SSO sign-ins then covers A5 exactly, and it is least privilege (NIST AC-6(2), BSI OPS.1.1.2.A22). No handbook page uses Basic against `/api/v1/admin/*`. Waiting for Nikola's decision.
Cordy closed this issue 2026-10-13 01:50:55 +00:00
Author
Owner

Shipped in v0.6.336 (PR #891). Both dogfoods report cairn_build_info{version="v0.6.336"}.

files-bao (cairn-openbao) logs the expected startup warning: WARN no break-glass account: only local administrators can sign in if the identity provider fails … (#887), which is state check.

Still open: the live UI check. It needs an admin sign-in, then:

  1. The Overview shows the "No emergency account" card, the Emergency access row reads "Check", and Overview has a rail dot.
  2. Users & access shows the EMERGENCY badge on admin1 and last sign-in on the admin rows.
  3. A bell item appears.
  4. The audit deep links work.

Optional: to see ok, add a config-file break-glass account to the dogfood. Run cairnd hash-password on the host, put CAIRN_ADMIN_USERNAME and CAIRN_ADMIN_PASSWORD_HASH in the deployment env, then restart.

Shipped in v0.6.336 (PR #891). Both dogfoods report `cairn_build_info{version="v0.6.336"}`. files-bao (cairn-openbao) logs the expected startup warning: `WARN no break-glass account: only local administrators can sign in if the identity provider fails … (#887)`, which is state `check`. **Still open:** the live UI check. It needs an admin sign-in, then: 1. The Overview shows the "No emergency account" card, the Emergency access row reads "Check", and Overview has a rail dot. 2. Users & access shows the EMERGENCY badge on admin1 and last sign-in on the admin rows. 3. A bell item appears. 4. The audit deep links work. **Optional:** to see `ok`, add a config-file break-glass account to the dogfood. Run `cairnd hash-password` on the host, put `CAIRN_ADMIN_USERNAME` and `CAIRN_ADMIN_PASSWORD_HASH` in the deployment env, then restart.
Author
Owner

Live check on files-bao (2026-10-13, v0.6.336)

  • Overview:
    • The "No emergency account" card shows, along with the rail dot.
    • The state is check: no break-glass account, one local admin (admin1).
    • The bell was empty at first, as designed: bell items are for events, and the missing account is shown by the card.
  • Bell events, triggered on purpose on the throwaway dogfood:
    • Promoting sharer1 gave "Administrator rights changed: sharer1 was made an administrator by nikola-test".
    • Demoting sharer1 gave a single item, "Emergency path removed: sharer1 (local administrator) was demoted by nikola-test. One emergency path is left."
    • Turning admin review reminders on gave "Administrator review due: 2 administrators need a look" right away, and the Admin review tab opened with "Needs a look 2" preselected.
  • Audit:
    • The deep link #admin/audit/query?actions=admin-promote,admin-demote,admin-rights-changed opened with the filter set and listed the 3 events, with addresses.
    • auth-admin-signin source=oidc was recorded for Nikola's sign-in.
  • Reverted: sharer1 is back to user, and reminders are back off.

Follow-up v0.6.337 (PR #892)

Nikola's point: the card's docker exec … command doesn't fit Kubernetes, which the dogfoods and many future customers run on.

  • The card's first step is now platform-neutral and links to a new "Per platform" guide section. It covers Kubernetes (kubectl exec or run, a Secret, the Helm value or secretKeyRef or the config Secret, then a rollout restart), Docker/Compose and the binary.
  • The Helm chart gets breakGlass.existingSecret / usernameKey / passwordHashKey.
  • Live on both dogfoods.
## Live check on files-bao (2026-10-13, v0.6.336) - **Overview:** - The "No emergency account" card shows, along with the rail dot. - The state is `check`: no break-glass account, one local admin (admin1). - The bell was empty at first, as designed: bell items are for **events**, and the missing account is shown by the card. - **Bell events, triggered on purpose on the throwaway dogfood:** - Promoting sharer1 gave "Administrator rights changed: sharer1 was made an administrator by nikola-test". - Demoting sharer1 gave a single item, "Emergency path removed: sharer1 (local administrator) was demoted by nikola-test. One emergency path is left." - Turning admin review reminders on gave "Administrator review due: 2 administrators need a look" right away, and the Admin review tab opened with "Needs a look 2" preselected. - **Audit:** - The deep link `#admin/audit/query?actions=admin-promote,admin-demote,admin-rights-changed` opened with the filter set and listed the 3 events, with addresses. - `auth-admin-signin source=oidc` was recorded for Nikola's sign-in. - **Reverted:** sharer1 is back to user, and reminders are back off. ## Follow-up v0.6.337 (PR #892) Nikola's point: the card's `docker exec …` command doesn't fit Kubernetes, which the dogfoods and many future customers run on. - The card's first step is now platform-neutral and links to a new "Per platform" guide section. It covers Kubernetes (kubectl exec or run, a Secret, the Helm value or `secretKeyRef` or the config Secret, then a rollout restart), Docker/Compose and the binary. - The Helm chart gets `breakGlass.existingSecret` / `usernameKey` / `passwordHashKey`. - Live on both dogfoods.
Author
Owner

Live check on files-bao (v0.6.337), first real break-glass sign-in: passed

Setup: the env admin comes from Secret cairn-breakglass via secretKeyRef (homelab-config 50671d8). The account breakglass signed in through the UI.

  • GET /api/v1/admin/emergency-access returns state: "ok". The break-glass path is breakglass (with lastSignIn set) and the local admin is admin1.
  • Overview, Emergency access row: "Config-file account (breakglass) · local administrator (admin1) · last emergency sign-in 2026-10-13 21:50 · audit log ↗", marked OK. The amber card is gone.
  • Users & access: breakglass shows the EMERGENCY, CONFIG FILE and YOU badges, the "emergency test due every 90 days" hint, and the "sign-ins in the audit log ↗" deep link.
  • Audit log:
    • auth-breakglass-signin source=config 15.25.10.3, with the real client address through the trusted proxy (#864)
    • auth-breakglass-changed added=breakglass, from the system on first boot with the Secret
    • auth-admin-signin source=oidc for the normal admin path
  • Bell: breakglass-signin (breakglass, config, 15.25.10.3) is shown to all admins and cannot be muted.

Follow-up: #893, which makes hash-password safe under kubectl exec (one-line read, no echo).

**Live check on files-bao (v0.6.337), first real break-glass sign-in: passed** Setup: the env admin comes from Secret `cairn-breakglass` via `secretKeyRef` (homelab-config 50671d8). The account `breakglass` signed in through the UI. - `GET /api/v1/admin/emergency-access` returns `state: "ok"`. The break-glass path is `breakglass` (with lastSignIn set) and the local admin is `admin1`. - **Overview, Emergency access row:** "Config-file account (breakglass) · local administrator (admin1) · last emergency sign-in 2026-10-13 21:50 · audit log ↗", marked **OK**. The amber card is gone. - **Users & access:** `breakglass` shows the EMERGENCY, CONFIG FILE and YOU badges, the "emergency test due every 90 days" hint, and the "sign-ins in the audit log ↗" deep link. - **Audit log:** - `auth-breakglass-signin source=config 15.25.10.3`, with the real client address through the trusted proxy (#864) - `auth-breakglass-changed added=breakglass`, from the system on first boot with the Secret - `auth-admin-signin source=oidc` for the normal admin path - **Bell:** `breakglass-signin` (breakglass, config, 15.25.10.3) is shown to all admins and cannot be muted. Follow-up: #893, which makes `hash-password` safe under kubectl exec (one-line read, no echo).
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#887
No description provided.