Add pgrls (Postgres Row-Level Security static analyzer)#1829
Open
dmitrymaranik wants to merge 1 commit into
Open
Add pgrls (Postgres Row-Level Security static analyzer)#1829dmitrymaranik wants to merge 1 commit into
dmitrymaranik wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds pgrls — https://github.com/pgrls/pgrls — a static analyzer for Postgres Row-Level Security.
What pgrls does
pgrls connects to a live Postgres database, walks the parsed AST of every RLS policy predicate (via pglast /
pg_query), and reports auth bugs, predicate logic flaws, and per-row performance traps. The current release ships 36 lint rules across four categories — security (SEC001–SEC026), per-row performance (PERF001–PERF003), hygiene (HYG001–HYG003), and view-mediated bypasses (VIEW001–VIEW004). 10 rules are mechanically auto-fixable viapgrls fix, which emits ready-to-apply SQL (ALTER POLICY …,ALTER TABLE … FORCE ROW LEVEL SECURITY, etc.). Output formats include text, JSON, SARIF, and Markdown.A
pgrls diffcommand compares two Postgres sources and classifies every change as SAFE / BREAKING / REQUIRES_REVIEW / DANGEROUS so CI can gate merges on real security regressions without blocking safe schema migrations.Format
data/tools/pgrls.ymllintersql,securitycliAdoption / maturity (transparent about the soft criteria)
The contributing guide lists three soft requirements; I want to be upfront on where pgrls lands:
Mentioning this so you can apply your judgement. If the maturity gap is a blocker, please feel free to close with a "resubmit in July" note and I'll be back on the dot.