fix: enable rls on remaining public tables

This commit is contained in:
Philipp
2026-06-10 16:14:41 +02:00
parent a22c1a4171
commit d87d8c6be7
4 changed files with 27 additions and 0 deletions
+1
View File
@@ -2,6 +2,7 @@
## Unreleased ## Unreleased
- RLS-Advisor-Cleanup fuer alle uebrigen Public-Tabellen angelegt.
- RLS-Migration fuer tenant-bezogene Tabellen mit Membership-basierten Policies angelegt. - RLS-Migration fuer tenant-bezogene Tabellen mit Membership-basierten Policies angelegt.
- Audit-Log-Migration mit append-only Triggern und Tenant-Zeit-Index angelegt. - Audit-Log-Migration mit append-only Triggern und Tenant-Zeit-Index angelegt.
- VMID-Allokator-Migration mit transaktionssicherer Reservation pro Cluster angelegt. - VMID-Allokator-Migration mit transaktionssicherer Reservation pro Cluster angelegt.
+2
View File
@@ -69,6 +69,7 @@ Arbeitsliste auf Basis von `proxmox-console-entwicklungsplan.md`. Die Entwurfsda
- [x] Membership-basierte SELECT-Policies angelegt - [x] Membership-basierte SELECT-Policies angelegt
- [x] Audit-Log auf owner/admin beschraenkt - [x] Audit-Log auf owner/admin beschraenkt
- [x] Direkter Query als Nicht-Mitglied lokal verifiziert - [x] Direkter Query als Nicht-Mitglied lokal verifiziert
- [x] Supabase-Advisor-Follow-up: RLS auf allen uebrigen Public-Tabellen aktiviert
## MVP-Backlog ## MVP-Backlog
@@ -115,3 +116,4 @@ Arbeitsliste auf Basis von `proxmox-console-entwicklungsplan.md`. Die Entwurfsda
- 2026-06-10: VMID-Allokator-Migration `0006_vmid_allocator` angelegt und mit 50 parallelen Reservierungen lokal gegen Supabase verifiziert. - 2026-06-10: VMID-Allokator-Migration `0006_vmid_allocator` angelegt und mit 50 parallelen Reservierungen lokal gegen Supabase verifiziert.
- 2026-06-10: Audit-Log-Migration `0007_audit_log` angelegt und Append-only-Verhalten lokal gegen Supabase verifiziert. - 2026-06-10: Audit-Log-Migration `0007_audit_log` angelegt und Append-only-Verhalten lokal gegen Supabase verifiziert.
- 2026-06-10: RLS-Migration `0008_rls_policies` angelegt und Mitglied/Nicht-Mitglied-Isolation lokal gegen Supabase verifiziert. - 2026-06-10: RLS-Migration `0008_rls_policies` angelegt und Mitglied/Nicht-Mitglied-Isolation lokal gegen Supabase verifiziert.
- 2026-06-10: RLS-Advisor-Cleanup `0009_rls_advisor_cleanup` angelegt; alle Public-Tabellen haben RLS aktiv.
@@ -0,0 +1,8 @@
DROP POLICY IF EXISTS profiles_self_update ON public.profiles;
DROP POLICY IF EXISTS profiles_self_select ON public.profiles;
ALTER TABLE public.vmid_reservations DISABLE ROW LEVEL SECURITY;
ALTER TABLE public.cluster_vmid_allocators DISABLE ROW LEVEL SECURITY;
ALTER TABLE public.clusters DISABLE ROW LEVEL SECURITY;
ALTER TABLE public.profiles DISABLE ROW LEVEL SECURITY;
ALTER TABLE public.schema_migrations DISABLE ROW LEVEL SECURITY;
@@ -0,0 +1,16 @@
ALTER TABLE public.schema_migrations ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.profiles ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.clusters ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.cluster_vmid_allocators ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.vmid_reservations ENABLE ROW LEVEL SECURITY;
CREATE POLICY profiles_self_select
ON public.profiles
FOR SELECT
USING (id = public.current_profile_id());
CREATE POLICY profiles_self_update
ON public.profiles
FOR UPDATE
USING (id = public.current_profile_id())
WITH CHECK (id = public.current_profile_id());