Skip to content
All features

Feature

SQL Server RLS multi-tenancy

Your customer's data is filtered by the database, not by the application layer.

What it is

Every per-customer table has a SQL Server Row-Level Security policy. FILTER and BLOCK predicates enforce that no query — accidental or malicious — can return rows belonging to a different customer.

How it works

SESSION_CONTEXT('customer_id') is stamped on every new connection by an EF Core interceptor. The fn_tenant_filter UDF compares against the customer_id column. Background workers explicitly OpenBypassScope() to set bypass_rls=1 — auditable, narrow, time-bounded.

What you get

  • A single dropped WHERE clause can't leak data.
  • Cross-customer access tests run on every module.
  • Customer-by-customer encryption keys land cleanly atop this primitive.

See this feature running.