docs(security): ratify AR-1 MFA for platform roles

AR-1 option B (BDR-083): aal2 for every platform role change. Contract 5.7 rule, path inventory, bootstrap, factors, recovery, sessions; F17-F19; M4 scope, tests, DEV preconditions; fresh security review integrated (19.4).
This commit is contained in:
bchanot committed 2026-10-28 12:20:11 +01:00
1 parent 41d3b09120
commit 9c13bae4bc
5 files changed
+447 -57

No files matched your search

+10
View File
@@ -603,3 +603,13 @@ Supersedes for official sheets the 2026-10-25 rule « no graphic editor until St
Consolidation also fixed: rights table moved to M4 (M4 used table created in M5); core step V1-2.2 now before worker step V1-2.3; progressive review via per-group acknowledgments with digests.
Alt: options not chosen listed in contract §17 and the 2026-10-28 review; O15 B and O4 C rejected outright.
Status: ratified; contract under owner final review; V1-2.1 not authorised.
## BDR-083 | 2026-10-28 | AR-1 ratified option B: aal2 for every platform role change
Decision (owner brief « V1-2.0 : résolution définitive d'AR-1 »): grant, revoke, replace, promote, demote of any platform role (owner, admin, moderator, support) need valid aal2 session, checked server-side in RPC at call time. No permanent exception (owner, first admin, old accounts, admin UI, direct RPC). aal2 necessary never sufficient: can_manage_platform_role, self-target refusal, last-owner guard stay. Ordinary users no MFA. Completes O4, no change to D1-D9, O1-O23.
Why: aal1 owner session could grant owner to attacker account → enrol own TOTP → aal2 → self-grant all catalogue capabilities. Read from `20261008100200` RPCs.
Shape (contract §5.7): aal2 check 2nd after auth, before role checks (no role oracle); private assign/withdraw re-check for non-null actor; service_role revoked on profile_roles/profiles + RPC EXECUTE (F17); owner-count race locked (F18); first owner: enrol 2 factors first, role assigned last by operator; DEV owner: enrol before M4 applied; recovery operator-only, ban account during enrol window; GoTrue v2.197.0 enrol/unenroll need aal2 once verified factor (source read, sandbox proves).
Alt: A (owner+admin only) rejected: leaves moderator/support weak path; C (accept residual) rejected.
Review (fresh challenger FATAL(4), all integrated, no ratified decision changed): grant needs target with verified factor; private fns: non-null actor = auth.uid() + aal2, null actor only without JWT; advisory lock both RPCs; DEV precondition before M4 = ENVIRONMENTS §3.6 hardening (public default JWT secret + demo service key + 54321 LAN → aal2 forgeable) + seed owner password changed + role holders listed; recovery reordered (ban, password set with owner, unban, enrol).
Reserves: staff read policies (is_platform_admin) stay aal1, owner decision; stolen aal2 session residual; refused attempts not in audit table.
Status: ratified; contract only, no code/migration/DEV change; V1-2.1 not authorised.
+5
View File
@@ -467,3 +467,8 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp
- Contract rewritten: rights M4, catalogue access fail-closed, MFA + operator recovery, group acknowledgments, worker verdict states, species inactive, equine working copy, SQL mirror removal, steps §16 with 9 headings.
- 3 fresh challengers: business CONCERNS, security FATAL (AR-1: aal1 owner grants owner role → bypasses catalogue MFA; O4-D unratified → owner arbitration), simplicity CONCERNS. All other findings integrated (omitted status = inherited, F12 unconditional, F15/F16, reader row predicate, uploads to M5, PreviewSheet editor handle, removal groups).
- Docs only, committed + pushed on feature/v1-2-anatomical-sheets. STOP: verdict BLOCKED on AR-1.
## 2026-10-28 (V1-2.0 AR-1 B ratified, contract updated)
- Owner ratified AR-1 B (BDR-083). Contract §5.7 written: rule, chain, path inventory (2 RPCs, 2 private fns, service_role table grants F17, owner-count race F18), bootstrap, factor/password/recovery, session rules, deploy order (enrol before M4 on DEV), tests §15.
- GoTrue v2.197.0 source read: enrol needs aal2 once verified factor, unenroll verified needs aal2. auth.sessions check kept as to-verify.
- Docs only. Independent security review, then commit + push feature branch. STOP at checkpoint.
+2 -1
View File
@@ -535,7 +535,8 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
- [ ] V1-2.0 contract and decisions (docs only): read-only audit delivered; contract drafted; 3 fresh plan challengers (correctness, robustness, simplicity); doc fixes (V1-1 status in TODO + V1-1 contract header, CLAUDE.md M1-M3 line); challengers FATAL(2 blockers)/FATAL(1)/CONCERNS integrated (contract §19); STOP at checkpoint: owner ratification of §5-§16 and options O1-O20
- [x] owner review of O1-O20 delivered (2026-10-28, read-only); O21-O23 proposed (catalogue access, SQL mirror, failed verification)
- [x] owner ratified O1-O23 (brief « V1-2.0 : ratification des arbitrages O1 à O23 et consolidation du contrat », 2026-10-28, BDR-082)
- [ ] consolidation (docs only): contract rewritten (decisions §17, contradictions C1-C14 §19.2, steps §16 with 9 headings each); IMPLEMENTATION_PLAN §0 + Steps 13/17 notes, ANATOMICAL_SHEET_MODEL stale Zod/TS mentions + V1-2 pointer, OPEN_QUESTIONS conflicts 1-2, V1-1 §5.4 pointer (N1 amended), rule sheet-model, CLAUDE.md pointer; 3 fresh challengers (business CONCERNS 3 major, security FATAL 1 arbitration + 6 major, simplicity CONCERNS 5 major) integrated (contract §19.3); commit + push branch; STOP at checkpoint: owner final review + AR-1 (MFA on platform role grants, contract §17.2), no V1-2.1
- [ ] consolidation (docs only): contract rewritten (decisions §17, contradictions C1-C14 §19.2, steps §16 with 9 headings each); IMPLEMENTATION_PLAN §0 + Steps 13/17 notes, ANATOMICAL_SHEET_MODEL stale Zod/TS mentions + V1-2 pointer, OPEN_QUESTIONS conflicts 1-2, V1-1 §5.4 pointer (N1 amended), rule sheet-model, CLAUDE.md pointer; 3 fresh challengers (business CONCERNS 3 major, security FATAL 1 arbitration + 6 major, simplicity CONCERNS 5 major) integrated (contract §19.3); commit + push branch; STOP at checkpoint: owner final review, no V1-2.1
- [x] AR-1 ratified option B by the owner 2026-10-28 (BDR-083): `aal2` on every platform role change; contract §5.7 (rule, inventory, bootstrap, factors, recovery, sessions), F17-F19, M4 scope, tests §15, DEV order §16.11 (enrol before M4); docs only; independent security review then commit + push; no code, migration or DEV change
- [ ] V1-2.1 server access and workflow (M4, M5) · V1-2.2 core verdict, preview, change list, edit primitives, SVG cleaning · V1-2.3 drawings and worker verification (M6) · V1-2.4 wireframes (editor, review, admin entry) · V1-2.5 catalogue, admin space, rights, species, MFA · V1-2.6 editor level 1 · V1-2.7 preview, review, publication UI · V1-2.8 equine working copy and review preparation · V1-2.9 FR/EN acceptance and closure (owner checkpoints V1-2.3, V1-2.4, V1-2.6, V1-2.7, V1-2.8, V1-2.9 + each DEV operation of contract §16.11)
## Release readiness track (owner 2026-10-25, distinct from the functional roadmap; nothing here authorises a release or exposure)