M8 epic — Groups & Classification Lattice (CLS-01..09, tasks 7.14–7.16) #158
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit#158
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adopted requirements (product decision 2026-11-11, SRS §3.18 CLS-01..09, PRs #156 + UX flows #157 — ux-flows v2.0 F-CLS1–6). Org-level opt-in (
classification_enabled, default off = zero behavioral delta): Internal < Confidential < Secret < Top Secret as a per-tenant ordered level table; personal clearance (admin-assigned, constant); groups with floor levels (membership requires clearance ≥ floor); lattice filter over existing ACLs (no read-up on shares, no write down on uploads); downgrade = owner-or-admin + auto-revoke + notify + audit.Tasks (dev plan v1.9, Phase 7 additions ~2.5 wk):
classification_insufficientdenials, read-time re-check, downgrade discipline — CLS-01, CLS-02, CLS-04–07, CLS-09Acceptance (exit): flag on → TS→Confidential share impossible (denied + audited), C→TS works, clearance downgrade revokes violating grants and drops below-floor memberships; flag off → zero behavioral delta; all five audit events queryable.
Order: 7.14 (groups entity) must land before 7.15/7.16. Slots after the Phase 7 core; independent of DUR (M9).
SRS: §3.18 · UX: F-CLS1–6 (ux-flows v2.0) · Spec PRs: #156, #157
M8 SEC-12 gate — STRIDE pre-pass complete (PR #199, threat-model §12)
Six findings, four need a binding decision from you (silence = adopted, per the §11 convention):
clearance_assigned/changedaudit events + no-self-change (setter ≠ target; Owner sets Admin/Member, Admin sets Member).group_membership_auto_removedevent + notifications).Plus two accepted/low: CLS-T5 (downloads re-check per chunk; presign TTL constraint if ever introduced), CLS-D6 (mass-downgrade notification storms → SEC-08 caps).
Core soundness argument now in §12.2: floors gate distribution, personal clearance gates access — every control above leans on CLS-06 being per-principal and un-cacheable; its acceptance tests are the load-bearing wall.
SRS §3.18 rows amended in place (marked
[§12 …]). Once you confirm/veto the four, 7.14 (groups entity) starts under the amended spec.7.14 landed — PR #200 merged (
361c553): server + admin-portal slicesServer (CLS-02/03 + the four adopted §12 decisions):
classification_levels, name+rank unique) +tenants.ClassificationEnabled— one-way enable, backfill to Internal, no disable endpoint (CLS-T1)user_tenantswith no-self-change +clearance_assigned/changedaudit (CLS-E2)group_membership_auto_removed) + in-app notifiedAdmin portal (F-CLS4): ClassificationPanel (enable + ladder chips + groups table + members dialog with eligible/ineligible-with-reason), clearance dropdown per member row.
Scope call (deliberate): share-to-group targeting moved to 7.15 — it is intrinsically tied to the lattice filter + per-principal access-time resolution (encrypted-key distribution mechanics) and has zero flag-off behavior; landing Share schema changes without consumers adds risk for no behavior.
New permanent guard (from #196, in this PR):
MigrationSmokeTests+ api-cimigrationsjob — the full migration chain now applies to fresh postgres:17 on every PR touching the API. The #195 outage bug class (hand-written SQL with wrong casing, ~21h staging crash-loop) fails CI at PR time from now on. Schema-convention pins (snake_case tables / PascalCase columns) included.Verification: server suite 1050/0/39-skip locally (11 new tests), admin 244/244, tsc clean; PR runs green (security + api incl. migrations job); flag-off tenants 409 on every classification endpoint — zero behavioral delta, safe to deploy.
Next: 7.15 classification core (upload gating, share lattice filter, read-time re-check, downgrade discipline + share-to-group targeting).
7.15 slice 2 landed — PR #204 merged (
f0f0603): share lattice + read-time re-check + group sharesCLS-05 (grant-time): user shares gated by
document level ≤ recipient clearance; group shares (newPOST /api/shares/group) gated bydocument level ≤ group floor. Denials → 403classification_insufficient+share_denied_classificationaudit.Group shares — SNAPSHOT semantics (design decision, unobjected → adopted): zero-knowledge forces per-recipient key material, so a group share materializes one Share row per CURRENT member (server-resolved membership; the sharer's client supplies per-member encrypted keys).
shares.ShareTargetGroupIdattributes the rows. Members joining a group later do not retroactively hold keys for pre-existing shares — documented in the endpoint, tests, and here as the accepted trade-off of snapshot semantics; owner re-share covers new members, and CLS-06 still gates every row by its holder's clearance.CLS-06 (read-time re-check) — the load-bearing wall, now enforced: every share-granted path re-checks per access — GetFolder, ListFiles, DownloadFile (per-request = per-chunk, §12 CLS-T5), GetFolderKey (decryption oracle), ListFolders (below-clearance items hidden). Flagship test: downgrade a member mid-session → all share-granted paths refuse on next access with grant rows untouched. Owners keep inherent access to their own content (documented residual — downgrades don't brick owners; re-classification is the remedy).
CLS-09:
share_denied_classification+group_share_createdevents feed the audit chain.Suite 1070/0/40; PR runs green by SHA (api-ci incl. migrations leg + security-ci). Ride-along: test fixture mirrors the CLS-02 joiner clearance default.
Remaining in 7.15: slice 3 — downgrade discipline (CLS-07 auto-revoke of violating grants + recipient notification on document level lowers).
7.15 slice 3 landed — PR #205 merged (
4a1f987): downgrade discipline. CLS enforcement is COMPLETE.CLS-07 completion: a level LOWER now auto-revokes every active share whose holder's current clearance sits below the new rank — each revocation audited (
share_auto_revoked_classification) + holder notified (in-app + push). Compliant holders untouched and REGAIN working access (Secret→Confidential readmits Confidential holders); raises never revoke (CLS-06 access-time gating already governs them — test-pinned). Folder lowers revoke FOLDER grants only; contained files keep their own levels and grants (§12 CLS-E4 container-constraint, test-pinned). Response bodies exposerevoked_grantsfor the F-CLS5 consequences dialog (7.16).Notable semantics: revoke-on-lower doubles as stale-grant hygiene — grants stranded by a holder's clearance drop (denied at access since, row intact per CLS-06) are finally cleaned up when the document lowers to a rank they still violate.
7.15 scoreboard (slices 1–3, PRs #203/#204/#205, suite 1073/0/40)
share_denied_classificationaudit + snapshot group sharesRemaining in M8: 7.16 client UX (desktop level badges, classification pickers at folder-create/upload, share-dialog eligibility rendering against the new endpoints) — the server contract is fully in place (DTOs carry levels, group-share batch endpoint ready for the client's per-member key encryption).
M8 CLOSES with this issue. Scope: tasks 7.14–7.16 (groups + CLS lattice client/server) landed via the #207 align-then-adorn campaign (#210–#213) and 7.14 group surfaces; milestone-close ponytail audit #214 (20 findings) remediated via FIX-ALL #215 — six PRs (#216–#221) merged, main @
8b45a46, staging re-deployed by the merged CD pipeline. Deferred feature items (M8-3 KEM provisioning, M8-11 streaming, M8-13 receive-envelope) + operator items tracked in #222 for re-planning. M8 done.