Step-by-step answer
Stretch 60 min8 stepsRed-team tenant isolation (stretch)
A pgvector chunks table for two fictional firms and three matters, protected by a tenant policy and a restrictive matter policy, with FORCE ROW LEVEL SECURITY and a non-owner application role. Each attack from the exercise is a check that shows the broken version leaking and the fixed version holding, against a real Postgres.
Back to the exercise