Repository navigation
pgveil v0.4.0 — AST Virtual Row-Level Security (RLS), Zero-Config pgveil demo & pgveil init
Highlights
1. AST-Level Virtual Row-Level Security (RLS) & Tenant Predicate Injection
Enforce multi-tenant and regional row isolation directly at the PostgreSQL wire layer with zero database RLS policies, views, or schema changes:
- Parses approved queries using PostgreSQL 17's own C AST (
libpg_query), qualifies table aliases, injectsLEFT JOIN/RIGHT JOINpredicates intoONclauses, wrapsFULL OUTER JOIN&USING/NATURALjoins as filtered subqueries, prevents CTE double-injection on shadowed table names, and emits canonical SQL viapg_query.Deparse. - Works across Simple Query (
'Q'), Extended Query parameterizedParse ('P')frames (,), and nativepgveil mcp. - Supports SQLi-safe quote-escaped session placeholders (
{{db_user}},{{database}},{{application_name}},{{profile}}) and validates everyrow_filterspredicate at config load & hot-reload time. - Security Ordering Invariant: Firewall checks (
block_write_without_where, tautology analysis, CTE taint & PII side-channel guards) strictly execute on the original client SQL before Virtual RLS injects predicates.
2. Zero-Config Interactive Sandbox (pgveil demo)
Try the full Precision Workbench UI (:8088), live PostgreSQL wire proxy (:6432), PII masking, AST firewall, live HITL holds, PII Discovery, and Virtual RLS (tenant_tr) in 3 seconds with zero Docker and zero external PostgreSQL:
brew install duhanguler/tap/pgveil && pgveil demo3. Live Onboarding Wizard (pgveil init)
Scan any existing PostgreSQL database and synthesize a complete, validated pgveil.yaml with a cryptographic HMAC key, discovered column_rules, protected_columns, and denied_tables:
pgveil init --dsn "postgres://user:pass@localhost:5432/mydb" --output pgveil.yaml4. Workbench UI Upgrades (68.7 KB gzip)
- Live debounced AST Pre-Flight bar displays
RLS: +N filtersand a wrappedVirtual RLS →rewritten SQL preview as you type. - Event Inspector slide-over drawer displays both Original SQL and Rewritten SQL (Virtual RLS) with applied predicate badges.
- Ships with the new backwards-compatible
tenant_trdemo profile andRLS Tenant JOINpreset.