Audit console access

Enter the shared code to render this RLS isolation harness.

Demo code: RLS-AUDIT

SECURITY REVIEW / POSTGRES ROW LEVEL SECURITY

Multi-Tenant RLS Isolation Audit

A working RLS isolation harness built to demonstrate the audit approach — not a claim of a shipped client system.

REAL SUPABASE QUERIES
Active identity
Sign in with one of the four seeded Supabase users. Authentication is real; no browser-side data filtering is used.

Authenticated as: Not signed in

Run configuration
Use IDs from your two seeded tenants. They are intentionally not embedded in source.
Adversarial test suite
Every line below is an actual Supabase query attempt, shown in full.
#1 · Baseline read
PENDING
select * from ledger_entries where org_id = '<active-org>'
Expected: Rows returnedActual: Not run
#2 · Cross-tenant by direct ID
PENDING
select * from ledger_entries where id = '<Org B row id>'
Expected: 0 rowsActual: Not run
#3 · Cross-tenant by org filter
PENDING
select * from ledger_entries where org_id = '<Org B id>'
Expected: 0 rowsActual: Not run
#4 · Cross-tenant write
PENDING
insert ledger_entries (org_id, amount_cents) values ('<Org B id>', 1)
Expected: Rejected by WITH CHECKActual: Not run
#5 · Role escalation
NEEDS STUDENT
insert ledger_entries (org_id, amount_cents) values ('<active org>', 1) as student
Expected: Rejected (director-only)Actual: Run while signed in as a student
#6 · Storage isolation
PENDING
download org-files/<Org B id>/secret.pdf
Expected: DeniedActual: Not run

Known Failure Modes — intentional audit exhibits

These should FAIL: missing RLS exposes data silently; service_role bypasses RLS by design.

#7 · Unprotected table
PENDING
select * from announcements_unprotected where org_id = '<Org B id>'
Expected: 0 rowsActual: Not run
#8 · Service-role bypass
PENDING
GET /rlsaudit/api/service-role?orgId=<Org B id>
Expected: 0 rowsActual: Not run