Files
loki/scripts/hetzner
CatoandClaude Opus 5.5 0fd886de8d fix(schema): new tables in a PostgREST schema are not public by default; refuse a deploy that leaves one readable (#1054)
apply-schema default-granted ALL on every future table in an app schema to
anon and authenticated (copying printcraft's posture). A migration-created
table has RLS off, and the anon key ships in the browser bundle, so every
new table was readable and writable by anyone through PostgREST. Found live
2026-10-06: botsmann.consultations (visitors' names, emails, messages) —
closed by hand on the DB and in botsmann#221.

- Default privileges: tables and sequences to service_role only. A table the
  anon key should reach grants it (or RLS + policy) in its own migration;
  forgetting now fails with 'permission denied' instead of publishing data.
- refuse_public_exposure on both supabase exits: a table PostgREST serves
  that anon can SELECT with RLS off fails the deploy, with the fix printed.
  Checked live: botsmann and printcraft schemas return no open tables.
- Tests: 5 new checks (54/54); reverting the default grant fails 2.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 07:44:30 -07:00
..