HIPAA evidence for Supabase: RLS, functions, views, triggers and audit logs as pgTAP tests #53177
Replies: 3 comments 4 replies
|
Automated pgTAP verification for RLS policies, security definer functions, and audit triggers is a huge operational win for teams managing HIPAA/SOC2 compliance on Supabase. Because Supabase signs the BAA for underlying cloud infrastructure while data access controls and RLS enforcement remain a shared-responsibility boundary, having repeatable automated test suites in A couple of notable implementation patterns that pair particularly well with this in CI/CD pipelines:
Embedding these pgTAP suites into GitHub Actions via |
|
Automated pgTAP generation is the right shape for this evidence — an auditor wants repeatable proof, not a one-off report. From running these audits for clients, three test-design details decide whether the suite actually answers the questions a HIPAA reviewer asks, and they are easy to miss in generated output: 1. Test with a second tenant's real JWT, not just anon. Most generated suites stop at "anon cannot select" and "authenticated owner can select". The leak that survives review is a cross-tenant read: tenant B's session selecting tenant A's row by id. That test needs two tenant identities and a row owned by the other one — i.e. seed data where 2. Views exposed through the Data API without 3. Audit tables must be tested for tamper, not just existence. "Every insert leaves an audit row" is half the requirement. The other half is that the application role cannot UPDATE or DELETE audit rows — i.e. no audit policy uses One process note on the CI side: run the suite on every migration and against a production-shaped clone before release. |
|
Thanks — that covers the three test-design points. The two-tenant seeding and the view-bypass test are the ones teams hand-rolling this most often skip, so good to see them explicit. The one item still open is my last note: grants drift from migrations in production (dashboard edits, direct role changes, a restore from a backup taken under different grants), so a suite that is green in CI can still miss what a reviewer pulls from the live project. Do you run the same suite against a production-shaped clone with the real grants applied before release, or is |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
From the team behind rlsautotest (featured in Supabase’s July 2026 Developer Update):
unitautogen hipaagenerates pgTAP tests and seed data from RLS policies, security definer functions, views, triggers and audit tables to prove, per tenant and identity, who can read, write or tamper with PHI - and maps the result to HIPAA 164.312.Supabase signs the BAA and secures the platform. By their own HIPAA guidance, applying the recommended database controls responsibility falls to the customer, and those controls are the part a HIPAA review actually asks about.
How to run it
Tests land in supabase/tests/, so supabase test db and CI re-run them on every migration. It runs on the local stack, built from the migrations, so no patient data is involved.
What it proves
What it maps to
The evidence is organized by the Technical Safeguards under 45 CFR 164.312:
Transmission security, 164.312(e), is encryption in transit and stays out of scope.
What does the report give-
One per schema:
UnitAutogen works on any Postgres - Supabase, Neon, RDS, self-hosted.
The HIPAA report is in the Enterprise edition (free trial, reduced rate for Supabase startups). If you run Supabase for healthcare, I’d like your feedback on where it helps and where it misses.
Docs: https://unitautogen.com/postgresql/unitautogen/docs/hipaa/


Download-https://github.com/unitautogen/unitautogen-postgresql/releases
All reactions