{
  "id": 22327621,
  "title": "A catalogue-only Postgres role for nightly RLS drift checks (measured on PG17)",
  "url": "https://urgent.news/2026/11/28/a-catalogue-only-postgres-role-for-nightly-rls-drift-checks-measured",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-28T08:20:42.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/cekuu35/a-catalogue-only-postgres-role-for-nightly-rls-drift-checks-measured-on-pg17-2m7d"
  },
  "original_language": null,
  "account": "Monitoring a Postgres database for Row Level Security (RLS) drift is possible without granting excessive privileges to a monitoring role. This was demonstrated using a small Local PostgreSQL 17 container with a single table named public.orders. The monitoring role, rls_monitor, was created with minimal privileges: LOGIN, NOSUPERUSER, NOCREATEDB, NOCREATEROLE, NOREPLICATION, NOBYPASSRLS, CONNECT, USAGE, and no select grants on tables.\n\nThe monitoring job utilized the 12-check SQL to assess RLS configurations. The checks included: verifying that RLS was disabled, checking if RLS was enabled but not forced, examining for permissive USING (true) SELECT/ALL policies, identifying missing WITH CHECK clauses, detecting policies open to PUBLIC, checking for SECURITY DEFINER without pinned search_path or bypassing roles, reviewing write grants to anonymous or authenticated users, inspecting public EXECUTE grants, monitoring future grants to pg_default_acl, and identifying views without the security_invoker.\n\nThe monitoring role was able to access the pg_catalog and information_schema, which provided the necessary catalog data for the checks. However, the role could not perform any data reads on the public.orders table, ensuring that sensitive customer data remained protected. The workflow, standalone SQL, a short guide, and the role template were made available for free at https://kurtoglu1.gumroad.com/l/supabase-rls-drift-monitor-free. The author emphasizes that a catalog signal is not proof of a leak, and zero findings do not guarantee safety. Additionally, the nightly diff must be fail-closed to avoid false reporting in the event of credential issues.",
  "summary": "A monitoring job that reads pg_catalog does not need to read a single application row. I wanted to verify that claim instead of repeating it, so I ran a small local experiment. The setup Local PostgreSQL 17 container, one table public.orders , and a role created with: CREATE ROLE rls_monitor LOGIN PASSWORD 'CHANGE_ME' NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION NOBYPASSRLS ; GRANT CONNECT…",
  "summary_source": "publisher",
  "key_points": [
    "Monitoring role 'rlsmonitor' created with limited privileges",
    "Nightly RLS drift checks performed using 12 SQL checks",
    "Monitoring role accessed pgcatalog and informationschema"
  ],
  "editors_take": "Using a restricted role to audit security configurations allows administrators to detect potential policy drift without exposing sensitive customer data to the monitoring process.",
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}