feat(security): authz matrix with route auto-discovery + PublicRouteRegistry (task 1.10 slice A, SEC-03/04) #69
No reviewers
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 milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit!69
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/1.10-authz-matrix"
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?
Part of #25 (task 1.10) — this PR lands the flagship SEC-03/04 harness; rate limits, security headers, ZK canaries, KAT consolidation and the fuzz scaffold follow as the closing PR.
SEC-03 — authz matrix with route auto-discovery (
AuthzMatrixTests):EndpointDataSource; each route must have an explicitMatrix[]row — a new endpoint without a declared authz contract fails the build (the SEC-03 acceptance). Stale rows (renamed/deleted routes) fail too.org_approval_pending(tenant-scoped only) · Active-no-workspace → 403no_workspace(tenant-scoped only) · MFA-pending → 403 except TOTP paths · member passes all central gates · non-SuperAdmin on /api/admin → 403. All 35 public routes verified reachable anonymously. Costs ~2s — the central gates are middleware-enforced, so one sweep covers every route.SEC-04 —
PublicRouteRegistry(src/FailSulit.Api/Authorization/): 33 public routes, each with a justification; api-ci verifies[SsdidPublic]⇄ registry in both directions plus justification quality. Health/bootstrap/auth/recovery/invitation-lookup/blob routes all registered.Findings surfaced by the matrix (and what this PR does about them):
GET /health/rediswas the only health probe without public metadata (siblings had it) — marked for consistency.PUT /api/files/{fileId}/blobconfirmed public = the UPL-02 unauthenticated-blob-PUT debt from the design audit — registered with an explicit LEGACY justification; enforcement lands with Phase 7 file consolidation (tracker 07-tracker-map row exists). Now impossible to silently change: the matrix row + registry entry pin it.H-1 dimension note (in the class doc): view-only share / download kill-switch / web-disabled / step-up enforcement arrive with Phases 2/5/7; the matrix covers every dimension with runtime enforcement today (anonymous, suspended, pending-org, no-workspace, MFA-pending, admin, workspace-scoped).
Suite 812/0/39 Release ×3; coverage gate 84.34% ≥ 80 (matrix suite lifted coverage +0.4pt).
- PublicRouteRegistry: 33 public routes with SEC-04 justifications - AuthzMatrixTests: endpoint discovery from EndpointDataSource; every route requires an explicit matrix row (missing row fails the build); class consistency cross-checked against route metadata; [SsdidPublic] <-> registry verified both directions - Behavioral sweeps: ~113 non-public routes x caller state (anonymous 401, suspended 403, pending-org/no-workspace gates on tenant-scoped, MFA-pending gate, admin 403) + all 35 public routes reachable anonymously - Findings fixed en route: /health/redis was the only health probe without public metadata (consistency); /api/files/{id}/blob PUT confirmed public = UPL-02 debt, registered with justification pending Phase 7