Skip to content

pgveil v0.4.0 — AST Virtual Row-Level Security (RLS), Zero-Config pgveil demo & pgveil init

Choose a tag to compare

@github-actions github-actions released this 21 Nov 19:14
· 7 commits to main since this release

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, injects LEFT JOIN / RIGHT JOIN predicates into ON clauses, wraps FULL OUTER JOIN & USING/NATURAL joins as filtered subqueries, prevents CTE double-injection on shadowed table names, and emits canonical SQL via pg_query.Deparse.
  • Works across Simple Query ('Q'), Extended Query parameterized Parse ('P') frames (, ), and native pgveil mcp.
  • Supports SQLi-safe quote-escaped session placeholders ({{db_user}}, {{database}}, {{application_name}}, {{profile}}) and validates every row_filters predicate 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 demo

3. 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.yaml

4. Workbench UI Upgrades (68.7 KB gzip)

  • Live debounced AST Pre-Flight bar displays RLS: +N filters and a wrapped Virtual 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_tr demo profile and RLS Tenant JOIN preset.