Grantguard
Verify Postgres roles only have the write permissions they are explicitly allowed, preventing silent privilege escalation.
Grantguard is a robust security tool designed to prevent unintended privilege escalation in PostgreSQL databases. It addresses a critical issue where seemingly innocuous SQL migrations can silently widen a role's write access from specific columns to an entire table. By reading directly from PostgreSQL's `pg_catalog`, Grantguard provides a factual audit of actual permissions, comparing them against a committed policy file. It then acts as a CI/CD gate, failing builds when live database grants diverge from the declared least-privilege policy, ensuring unattended agents and services operate with the minimal necessary access.