Skip to main content

Database security controls

Current control model

ControlPurposeReview position
Managed PostgreSQLSeparates infrastructure operation from application data designSupabase operates the platform; FinTrack owns schema and data controls
Managed authenticationEstablishes signed application identities and sessionsImplemented
Database grantsControls whether an API role can reach a data object or operationImplemented; least-privilege review remains continuous
Row-level securityRestricts rows available to ordinary API identitiesEnabled on all reviewed public tables at the current read-only review point
Policies and trusted operationsEnforce tenant, role, hierarchy, ownership, and workflow rulesImplemented across application domains; individual correctness is not universally certified
Constraints and transactionsProtect relationships and multi-record invariantsUsed across the system of record
Migration change controlMakes schema and policy changes reviewable and repeatableEstablished as an operator-controlled process
Security advisorDetects configuration risks and database-security smellsCurrent review contains unresolved warnings and informational findings

Required security practices

  1. Keep all exposed tables protected by row-level security and explicit grants.
  2. Test anonymous, authenticated, cross-tenant, ownership, hierarchy, and privileged cases.
  3. Restrict elevated functions, set safe execution context, and validate the caller in the body.
  4. Keep privileged keys outside public clients.
  5. Review security-advisor findings to remediation or documented risk acceptance.
  6. Verify migrations before and after controlled deployment, with rollback or recovery guidance.
  7. Retain audit evidence for sensitive access and administrative changes.

Enforcement-layer test matrix

Test identityRead caseWrite caseRequired result
AnonymousPublicly classified content onlyNo protected mutationProtected records and operations are denied without a signed identity
Ordinary tenant userRecords within assigned tenant, hierarchy, ownership, or mapped scopeOnly permitted workflow fields and transitionsCross-tenant, peer-restricted, and privileged data remain inaccessible
Management userExpanded subordinate or assigned scopeManagement operations allowed only within current authorityRole level does not bypass tenant or target restrictions
Privileged application userApproved administrative scopeExplicit administrative operationsEvery privileged operation validates actor, target, purpose, and current state
Trusted workloadOnly data required for the defined functionBounded service transactionCaller or event authenticity, tenant, input, replay, and idempotency checks pass before elevated access
Database administratorOperational administration under authorizationControlled maintenance or recoveryAccess is named, recorded, reviewed, and excluded from ordinary application use

For each exposed record domain, the review records reachable roles, grants, row-policy predicates, write checks, privileged operations, storage linkage, and negative cases. The test set uses direct API access rather than relying on hidden UI routes. Changes to tenant, hierarchy, ownership, menu, or reporting logic trigger review of both application behavior and database enforcement.

Migration security gate

GateRequired decision
PreconditionConfirm expected schema version, object existence, data shape, extension dependency, and backup or recovery requirement
ExpansionAdd compatible objects or nullable fields before depending on them; avoid breaking active clients during rollout
Data movementBound the affected rows, batch long work, preserve attribution, and make restart or reconciliation behavior explicit
AccessDefine grants, row-level security, write checks, function execution rights, search path, and ownership before exposure
VerificationExecute anonymous, tenant, cross-tenant, hierarchy, ownership, privileged, constraint, and performance checks
DeploymentRecord operator, approved migration set, start/end time, provider result, and application compatibility
FailureStop dependent rollout, preserve error and partial-state evidence, and use the approved forward correction or provider recovery path
ClosureRetain post-deployment catalog state, security-advisor review, critical query result, and business-owner confirmation where required

Destructive or privilege-expanding database work is not executed through an undocumented console change. Emergency correction still produces a reviewable migration and an operator-controlled deployment record so the authoritative schema can be reconstructed.

Current limitations

The point-in-time advisor review identified unresolved function hardening, execution-access, authentication-protection, and policy-coverage findings. Object names and counts are omitted from this public summary. The presence of row-level security does not prove that every policy is correct, and tables with no policy intentionally deny ordinary access but still require documented ownership.