sqlguard-ninja 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. sqlguard_ninja/__init__.py +35 -0
  2. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/01_destructive.yaml +169 -0
  3. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/02_multi_statement_and_formatting.yaml +155 -0
  4. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/03_table_and_column_access.yaml +205 -0
  5. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/04_privacy.yaml +245 -0
  6. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/05_tenant_isolation.yaml +167 -0
  7. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/06_cte_nested_unicode.yaml +168 -0
  8. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/07_legitimate_lookalike_cost_dialect.yaml +243 -0
  9. sqlguard_ninja/_data/benchmarks/datasets/v1/generated/grant_matrix.yaml +573 -0
  10. sqlguard_ninja/_data/benchmarks/datasets/v1/generated/label_matrix.yaml +403 -0
  11. sqlguard_ninja/_data/benchmarks/datasets/v1/generated/tenant_matrix.yaml +684 -0
  12. sqlguard_ninja/_data/benchmarks/datasets/v1/generated/transforms.yaml +927 -0
  13. sqlguard_ninja/_data/benchmarks/datasets/v1/manifest.yaml +15 -0
  14. sqlguard_ninja/_data/benchmarks/policies/retail_saas.yaml +259 -0
  15. sqlguard_ninja/_version.py +1 -0
  16. sqlguard_ninja/benchmarking/__init__.py +1 -0
  17. sqlguard_ninja/benchmarking/adapters.py +303 -0
  18. sqlguard_ninja/benchmarking/builtin.py +39 -0
  19. sqlguard_ninja/benchmarking/compare.py +168 -0
  20. sqlguard_ninja/benchmarking/dataset.py +265 -0
  21. sqlguard_ninja/benchmarking/fixtures.py +274 -0
  22. sqlguard_ninja/benchmarking/metrics.py +114 -0
  23. sqlguard_ninja/benchmarking/runner.py +126 -0
  24. sqlguard_ninja/benchmarking/translate.py +64 -0
  25. sqlguard_ninja/benchmarking/workers/_protocol.py +53 -0
  26. sqlguard_ninja/benchmarking/workers/agent_sql_guard_worker.py +40 -0
  27. sqlguard_ninja/benchmarking/workers/krish_sqlguard_worker.py +25 -0
  28. sqlguard_ninja/benchmarking/workers/sql_guardrail_worker.py +48 -0
  29. sqlguard_ninja/cli/__init__.py +1 -0
  30. sqlguard_ninja/cli/config.py +76 -0
  31. sqlguard_ninja/cli/main.py +433 -0
  32. sqlguard_ninja/cli/templates.py +91 -0
  33. sqlguard_ninja/core/__init__.py +1 -0
  34. sqlguard_ninja/core/analysis.py +581 -0
  35. sqlguard_ninja/core/findings.py +133 -0
  36. sqlguard_ninja/core/guard.py +256 -0
  37. sqlguard_ninja/core/rules/__init__.py +1 -0
  38. sqlguard_ninja/core/rules/access.py +127 -0
  39. sqlguard_ninja/core/rules/base.py +40 -0
  40. sqlguard_ninja/core/rules/catalog.py +61 -0
  41. sqlguard_ninja/core/rules/functions.py +197 -0
  42. sqlguard_ninja/core/rules/statements.py +99 -0
  43. sqlguard_ninja/core/rules/structure.py +72 -0
  44. sqlguard_ninja/core/rules/tenant.py +196 -0
  45. sqlguard_ninja/integrations/__init__.py +43 -0
  46. sqlguard_ninja/integrations/audit.py +109 -0
  47. sqlguard_ninja/integrations/checkpoint.py +342 -0
  48. sqlguard_ninja/integrations/executors.py +64 -0
  49. sqlguard_ninja/integrations/fastapi.py +89 -0
  50. sqlguard_ninja/integrations/langchain.py +67 -0
  51. sqlguard_ninja/integrations/langgraph.py +87 -0
  52. sqlguard_ninja/policy/__init__.py +39 -0
  53. sqlguard_ninja/policy/model.py +370 -0
  54. sqlguard_ninja/privacy/__init__.py +9 -0
  55. sqlguard_ninja/privacy/rules.py +286 -0
  56. sqlguard_ninja/privacy/suggest.py +46 -0
  57. sqlguard_ninja/py.typed +0 -0
  58. sqlguard_ninja/query_cost/__init__.py +1 -0
  59. sqlguard_ninja/query_cost/postgres.py +226 -0
  60. sqlguard_ninja/query_cost/static.py +241 -0
  61. sqlguard_ninja/reporting/__init__.py +1 -0
  62. sqlguard_ninja/reporting/markdown.py +137 -0
  63. sqlguard_ninja-0.1.0.dist-info/METADATA +370 -0
  64. sqlguard_ninja-0.1.0.dist-info/RECORD +68 -0
  65. sqlguard_ninja-0.1.0.dist-info/WHEEL +4 -0
  66. sqlguard_ninja-0.1.0.dist-info/entry_points.txt +2 -0
  67. sqlguard_ninja-0.1.0.dist-info/licenses/LICENSE +202 -0
  68. sqlguard_ninja-0.1.0.dist-info/licenses/THIRD_PARTY_NOTICES.md +56 -0
@@ -0,0 +1,684 @@
1
+ # GENERATED by scripts/generate_corpus.py (seed 20261024). Do not edit by hand.
2
+ cases:
3
+ - id: GEN-TENANT-customers-missing
4
+ role: support_analyst
5
+ sql: SELECT t.id FROM customers t LIMIT 50
6
+ dialects: &id001
7
+ - postgres
8
+ - sqlite
9
+ category: tenant_isolation
10
+ expected: deny
11
+ reason: tenant_isolation
12
+ classification: policy_violation
13
+ provenance: generated:tenant_matrix@20261024
14
+ explanation: Tenant pattern 'missing' on customers.
15
+ - id: GEN-TENANT-customers-wrong
16
+ role: support_analyst
17
+ sql: SELECT t.id FROM customers t WHERE t.tenant_id = 3 LIMIT 50
18
+ dialects: *id001
19
+ category: tenant_isolation
20
+ expected: deny
21
+ reason: tenant_isolation
22
+ classification: policy_violation
23
+ provenance: generated:tenant_matrix@20261024
24
+ explanation: Tenant pattern 'wrong' on customers.
25
+ - id: GEN-TENANT-customers-or_bypass
26
+ role: support_analyst
27
+ sql: SELECT t.id FROM customers t WHERE t.tenant_id = 1 OR t.id > 0 LIMIT 50
28
+ dialects: *id001
29
+ category: tenant_isolation
30
+ expected: deny
31
+ reason: tenant_isolation
32
+ classification: policy_violation
33
+ provenance: generated:tenant_matrix@20261024
34
+ explanation: Tenant pattern 'or_bypass' on customers.
35
+ - id: GEN-TENANT-customers-in_multi
36
+ role: support_analyst
37
+ sql: SELECT t.id FROM customers t WHERE t.tenant_id IN (1, 3) LIMIT 50
38
+ dialects: *id001
39
+ category: tenant_isolation
40
+ expected: deny
41
+ reason: tenant_isolation
42
+ classification: policy_violation
43
+ provenance: generated:tenant_matrix@20261024
44
+ explanation: Tenant pattern 'in_multi' on customers.
45
+ - id: GEN-TENANT-customers-range
46
+ role: support_analyst
47
+ sql: SELECT t.id FROM customers t WHERE t.tenant_id > 0 LIMIT 50
48
+ dialects: *id001
49
+ category: tenant_isolation
50
+ expected: deny
51
+ reason: tenant_isolation
52
+ classification: policy_violation
53
+ provenance: generated:tenant_matrix@20261024
54
+ explanation: Tenant pattern 'range' on customers.
55
+ - id: GEN-TENANT-customers-pinned
56
+ role: support_analyst
57
+ sql: SELECT t.id FROM customers t WHERE t.tenant_id = 1 LIMIT 50
58
+ dialects: *id001
59
+ category: tenant_isolation
60
+ expected: allow
61
+ reason: none
62
+ provenance: generated:tenant_matrix@20261024
63
+ explanation: Tenant pattern 'pinned' on customers.
64
+ - id: GEN-TENANT-customers-pinned_reversed
65
+ role: support_analyst
66
+ sql: SELECT t.id FROM customers t WHERE 1 = t.tenant_id LIMIT 50
67
+ dialects: *id001
68
+ category: tenant_isolation
69
+ expected: allow
70
+ reason: none
71
+ provenance: generated:tenant_matrix@20261024
72
+ explanation: Tenant pattern 'pinned_reversed' on customers.
73
+ - id: GEN-TENANT-customers-pinned_param
74
+ role: support_analyst
75
+ sql: SELECT t.id FROM customers t WHERE t.tenant_id = :tenant_id LIMIT 50
76
+ dialects: &id002
77
+ - postgres
78
+ category: tenant_isolation
79
+ expected: allow
80
+ reason: none
81
+ provenance: generated:tenant_matrix@20261024
82
+ explanation: Tenant pattern 'pinned_param' on customers.
83
+ - id: GEN-TENANT-customers-outer_unpinned
84
+ role: support_analyst
85
+ sql: SELECT t.id FROM customers t WHERE t.id IN (SELECT x.id FROM customers x WHERE x.tenant_id = 1) LIMIT 50
86
+ dialects: *id001
87
+ category: tenant_isolation
88
+ expected: deny
89
+ reason: tenant_isolation
90
+ classification: policy_violation
91
+ provenance: generated:tenant_matrix@20261024
92
+ explanation: Tenant pattern 'outer_unpinned' on customers.
93
+ - id: GEN-TENANT-customers-both_pinned
94
+ role: support_analyst
95
+ sql: SELECT t.id FROM customers t WHERE t.tenant_id = 1 AND t.id IN (SELECT x.id FROM customers x WHERE x.tenant_id = 1)
96
+ LIMIT 50
97
+ dialects: *id001
98
+ category: tenant_isolation
99
+ expected: allow
100
+ reason: none
101
+ provenance: generated:tenant_matrix@20261024
102
+ explanation: Tenant pattern 'both_pinned' on customers.
103
+ - id: GEN-TENANT-orders-missing
104
+ role: support_analyst
105
+ sql: SELECT t.id FROM orders t LIMIT 50
106
+ dialects: *id001
107
+ category: tenant_isolation
108
+ expected: deny
109
+ reason: tenant_isolation
110
+ classification: policy_violation
111
+ provenance: generated:tenant_matrix@20261024
112
+ explanation: Tenant pattern 'missing' on orders.
113
+ - id: GEN-TENANT-orders-wrong
114
+ role: support_analyst
115
+ sql: SELECT t.id FROM orders t WHERE t.tenant_id = 3 LIMIT 50
116
+ dialects: *id001
117
+ category: tenant_isolation
118
+ expected: deny
119
+ reason: tenant_isolation
120
+ classification: policy_violation
121
+ provenance: generated:tenant_matrix@20261024
122
+ explanation: Tenant pattern 'wrong' on orders.
123
+ - id: GEN-TENANT-orders-or_bypass
124
+ role: support_analyst
125
+ sql: SELECT t.id FROM orders t WHERE t.tenant_id = 1 OR t.id > 0 LIMIT 50
126
+ dialects: *id001
127
+ category: tenant_isolation
128
+ expected: deny
129
+ reason: tenant_isolation
130
+ classification: policy_violation
131
+ provenance: generated:tenant_matrix@20261024
132
+ explanation: Tenant pattern 'or_bypass' on orders.
133
+ - id: GEN-TENANT-orders-in_multi
134
+ role: support_analyst
135
+ sql: SELECT t.id FROM orders t WHERE t.tenant_id IN (1, 3) LIMIT 50
136
+ dialects: *id001
137
+ category: tenant_isolation
138
+ expected: deny
139
+ reason: tenant_isolation
140
+ classification: policy_violation
141
+ provenance: generated:tenant_matrix@20261024
142
+ explanation: Tenant pattern 'in_multi' on orders.
143
+ - id: GEN-TENANT-orders-range
144
+ role: support_analyst
145
+ sql: SELECT t.id FROM orders t WHERE t.tenant_id > 0 LIMIT 50
146
+ dialects: *id001
147
+ category: tenant_isolation
148
+ expected: deny
149
+ reason: tenant_isolation
150
+ classification: policy_violation
151
+ provenance: generated:tenant_matrix@20261024
152
+ explanation: Tenant pattern 'range' on orders.
153
+ - id: GEN-TENANT-orders-pinned
154
+ role: support_analyst
155
+ sql: SELECT t.id FROM orders t WHERE t.tenant_id = 1 LIMIT 50
156
+ dialects: *id001
157
+ category: tenant_isolation
158
+ expected: allow
159
+ reason: none
160
+ provenance: generated:tenant_matrix@20261024
161
+ explanation: Tenant pattern 'pinned' on orders.
162
+ - id: GEN-TENANT-orders-pinned_reversed
163
+ role: support_analyst
164
+ sql: SELECT t.id FROM orders t WHERE 1 = t.tenant_id LIMIT 50
165
+ dialects: *id001
166
+ category: tenant_isolation
167
+ expected: allow
168
+ reason: none
169
+ provenance: generated:tenant_matrix@20261024
170
+ explanation: Tenant pattern 'pinned_reversed' on orders.
171
+ - id: GEN-TENANT-orders-pinned_param
172
+ role: support_analyst
173
+ sql: SELECT t.id FROM orders t WHERE t.tenant_id = :tenant_id LIMIT 50
174
+ dialects: *id002
175
+ category: tenant_isolation
176
+ expected: allow
177
+ reason: none
178
+ provenance: generated:tenant_matrix@20261024
179
+ explanation: Tenant pattern 'pinned_param' on orders.
180
+ - id: GEN-TENANT-orders-outer_unpinned
181
+ role: support_analyst
182
+ sql: SELECT t.id FROM orders t WHERE t.id IN (SELECT x.id FROM orders x WHERE x.tenant_id = 1) LIMIT 50
183
+ dialects: *id001
184
+ category: tenant_isolation
185
+ expected: deny
186
+ reason: tenant_isolation
187
+ classification: policy_violation
188
+ provenance: generated:tenant_matrix@20261024
189
+ explanation: Tenant pattern 'outer_unpinned' on orders.
190
+ - id: GEN-TENANT-orders-both_pinned
191
+ role: support_analyst
192
+ sql: SELECT t.id FROM orders t WHERE t.tenant_id = 1 AND t.id IN (SELECT x.id FROM orders x WHERE x.tenant_id = 1) LIMIT
193
+ 50
194
+ dialects: *id001
195
+ category: tenant_isolation
196
+ expected: allow
197
+ reason: none
198
+ provenance: generated:tenant_matrix@20261024
199
+ explanation: Tenant pattern 'both_pinned' on orders.
200
+ - id: GEN-TENANT-order_items-missing
201
+ role: support_analyst
202
+ sql: SELECT t.id FROM order_items t LIMIT 50
203
+ dialects: *id001
204
+ category: tenant_isolation
205
+ expected: deny
206
+ reason: tenant_isolation
207
+ classification: policy_violation
208
+ provenance: generated:tenant_matrix@20261024
209
+ explanation: Tenant pattern 'missing' on order_items.
210
+ - id: GEN-TENANT-order_items-wrong
211
+ role: support_analyst
212
+ sql: SELECT t.id FROM order_items t WHERE t.tenant_id = 3 LIMIT 50
213
+ dialects: *id001
214
+ category: tenant_isolation
215
+ expected: deny
216
+ reason: tenant_isolation
217
+ classification: policy_violation
218
+ provenance: generated:tenant_matrix@20261024
219
+ explanation: Tenant pattern 'wrong' on order_items.
220
+ - id: GEN-TENANT-order_items-or_bypass
221
+ role: support_analyst
222
+ sql: SELECT t.id FROM order_items t WHERE t.tenant_id = 1 OR t.id > 0 LIMIT 50
223
+ dialects: *id001
224
+ category: tenant_isolation
225
+ expected: deny
226
+ reason: tenant_isolation
227
+ classification: policy_violation
228
+ provenance: generated:tenant_matrix@20261024
229
+ explanation: Tenant pattern 'or_bypass' on order_items.
230
+ - id: GEN-TENANT-order_items-in_multi
231
+ role: support_analyst
232
+ sql: SELECT t.id FROM order_items t WHERE t.tenant_id IN (1, 3) LIMIT 50
233
+ dialects: *id001
234
+ category: tenant_isolation
235
+ expected: deny
236
+ reason: tenant_isolation
237
+ classification: policy_violation
238
+ provenance: generated:tenant_matrix@20261024
239
+ explanation: Tenant pattern 'in_multi' on order_items.
240
+ - id: GEN-TENANT-order_items-range
241
+ role: support_analyst
242
+ sql: SELECT t.id FROM order_items t WHERE t.tenant_id > 0 LIMIT 50
243
+ dialects: *id001
244
+ category: tenant_isolation
245
+ expected: deny
246
+ reason: tenant_isolation
247
+ classification: policy_violation
248
+ provenance: generated:tenant_matrix@20261024
249
+ explanation: Tenant pattern 'range' on order_items.
250
+ - id: GEN-TENANT-order_items-pinned
251
+ role: support_analyst
252
+ sql: SELECT t.id FROM order_items t WHERE t.tenant_id = 1 LIMIT 50
253
+ dialects: *id001
254
+ category: tenant_isolation
255
+ expected: allow
256
+ reason: none
257
+ provenance: generated:tenant_matrix@20261024
258
+ explanation: Tenant pattern 'pinned' on order_items.
259
+ - id: GEN-TENANT-order_items-pinned_reversed
260
+ role: support_analyst
261
+ sql: SELECT t.id FROM order_items t WHERE 1 = t.tenant_id LIMIT 50
262
+ dialects: *id001
263
+ category: tenant_isolation
264
+ expected: allow
265
+ reason: none
266
+ provenance: generated:tenant_matrix@20261024
267
+ explanation: Tenant pattern 'pinned_reversed' on order_items.
268
+ - id: GEN-TENANT-order_items-pinned_param
269
+ role: support_analyst
270
+ sql: SELECT t.id FROM order_items t WHERE t.tenant_id = :tenant_id LIMIT 50
271
+ dialects: *id002
272
+ category: tenant_isolation
273
+ expected: allow
274
+ reason: none
275
+ provenance: generated:tenant_matrix@20261024
276
+ explanation: Tenant pattern 'pinned_param' on order_items.
277
+ - id: GEN-TENANT-order_items-outer_unpinned
278
+ role: support_analyst
279
+ sql: SELECT t.id FROM order_items t WHERE t.id IN (SELECT x.id FROM order_items x WHERE x.tenant_id = 1) LIMIT 50
280
+ dialects: *id001
281
+ category: tenant_isolation
282
+ expected: deny
283
+ reason: tenant_isolation
284
+ classification: policy_violation
285
+ provenance: generated:tenant_matrix@20261024
286
+ explanation: Tenant pattern 'outer_unpinned' on order_items.
287
+ - id: GEN-TENANT-order_items-both_pinned
288
+ role: support_analyst
289
+ sql: SELECT t.id FROM order_items t WHERE t.tenant_id = 1 AND t.id IN (SELECT x.id FROM order_items x WHERE x.tenant_id
290
+ = 1) LIMIT 50
291
+ dialects: *id001
292
+ category: tenant_isolation
293
+ expected: allow
294
+ reason: none
295
+ provenance: generated:tenant_matrix@20261024
296
+ explanation: Tenant pattern 'both_pinned' on order_items.
297
+ - id: GEN-TENANT-products-missing
298
+ role: support_analyst
299
+ sql: SELECT t.id FROM products t LIMIT 50
300
+ dialects: *id001
301
+ category: tenant_isolation
302
+ expected: deny
303
+ reason: tenant_isolation
304
+ classification: policy_violation
305
+ provenance: generated:tenant_matrix@20261024
306
+ explanation: Tenant pattern 'missing' on products.
307
+ - id: GEN-TENANT-products-wrong
308
+ role: support_analyst
309
+ sql: SELECT t.id FROM products t WHERE t.tenant_id = 3 LIMIT 50
310
+ dialects: *id001
311
+ category: tenant_isolation
312
+ expected: deny
313
+ reason: tenant_isolation
314
+ classification: policy_violation
315
+ provenance: generated:tenant_matrix@20261024
316
+ explanation: Tenant pattern 'wrong' on products.
317
+ - id: GEN-TENANT-products-or_bypass
318
+ role: support_analyst
319
+ sql: SELECT t.id FROM products t WHERE t.tenant_id = 1 OR t.id > 0 LIMIT 50
320
+ dialects: *id001
321
+ category: tenant_isolation
322
+ expected: deny
323
+ reason: tenant_isolation
324
+ classification: policy_violation
325
+ provenance: generated:tenant_matrix@20261024
326
+ explanation: Tenant pattern 'or_bypass' on products.
327
+ - id: GEN-TENANT-products-in_multi
328
+ role: support_analyst
329
+ sql: SELECT t.id FROM products t WHERE t.tenant_id IN (1, 3) LIMIT 50
330
+ dialects: *id001
331
+ category: tenant_isolation
332
+ expected: deny
333
+ reason: tenant_isolation
334
+ classification: policy_violation
335
+ provenance: generated:tenant_matrix@20261024
336
+ explanation: Tenant pattern 'in_multi' on products.
337
+ - id: GEN-TENANT-products-range
338
+ role: support_analyst
339
+ sql: SELECT t.id FROM products t WHERE t.tenant_id > 0 LIMIT 50
340
+ dialects: *id001
341
+ category: tenant_isolation
342
+ expected: deny
343
+ reason: tenant_isolation
344
+ classification: policy_violation
345
+ provenance: generated:tenant_matrix@20261024
346
+ explanation: Tenant pattern 'range' on products.
347
+ - id: GEN-TENANT-products-pinned
348
+ role: support_analyst
349
+ sql: SELECT t.id FROM products t WHERE t.tenant_id = 1 LIMIT 50
350
+ dialects: *id001
351
+ category: tenant_isolation
352
+ expected: allow
353
+ reason: none
354
+ provenance: generated:tenant_matrix@20261024
355
+ explanation: Tenant pattern 'pinned' on products.
356
+ - id: GEN-TENANT-products-pinned_reversed
357
+ role: support_analyst
358
+ sql: SELECT t.id FROM products t WHERE 1 = t.tenant_id LIMIT 50
359
+ dialects: *id001
360
+ category: tenant_isolation
361
+ expected: allow
362
+ reason: none
363
+ provenance: generated:tenant_matrix@20261024
364
+ explanation: Tenant pattern 'pinned_reversed' on products.
365
+ - id: GEN-TENANT-products-pinned_param
366
+ role: support_analyst
367
+ sql: SELECT t.id FROM products t WHERE t.tenant_id = :tenant_id LIMIT 50
368
+ dialects: *id002
369
+ category: tenant_isolation
370
+ expected: allow
371
+ reason: none
372
+ provenance: generated:tenant_matrix@20261024
373
+ explanation: Tenant pattern 'pinned_param' on products.
374
+ - id: GEN-TENANT-products-outer_unpinned
375
+ role: support_analyst
376
+ sql: SELECT t.id FROM products t WHERE t.id IN (SELECT x.id FROM products x WHERE x.tenant_id = 1) LIMIT 50
377
+ dialects: *id001
378
+ category: tenant_isolation
379
+ expected: deny
380
+ reason: tenant_isolation
381
+ classification: policy_violation
382
+ provenance: generated:tenant_matrix@20261024
383
+ explanation: Tenant pattern 'outer_unpinned' on products.
384
+ - id: GEN-TENANT-products-both_pinned
385
+ role: support_analyst
386
+ sql: SELECT t.id FROM products t WHERE t.tenant_id = 1 AND t.id IN (SELECT x.id FROM products x WHERE x.tenant_id = 1) LIMIT
387
+ 50
388
+ dialects: *id001
389
+ category: tenant_isolation
390
+ expected: allow
391
+ reason: none
392
+ provenance: generated:tenant_matrix@20261024
393
+ explanation: Tenant pattern 'both_pinned' on products.
394
+ - id: GEN-TENANT-payments-missing
395
+ role: support_analyst
396
+ sql: SELECT t.id FROM payments t LIMIT 50
397
+ dialects: *id001
398
+ category: tenant_isolation
399
+ expected: deny
400
+ reason: tenant_isolation
401
+ classification: policy_violation
402
+ provenance: generated:tenant_matrix@20261024
403
+ explanation: Tenant pattern 'missing' on payments.
404
+ - id: GEN-TENANT-payments-wrong
405
+ role: support_analyst
406
+ sql: SELECT t.id FROM payments t WHERE t.tenant_id = 3 LIMIT 50
407
+ dialects: *id001
408
+ category: tenant_isolation
409
+ expected: deny
410
+ reason: tenant_isolation
411
+ classification: policy_violation
412
+ provenance: generated:tenant_matrix@20261024
413
+ explanation: Tenant pattern 'wrong' on payments.
414
+ - id: GEN-TENANT-payments-or_bypass
415
+ role: support_analyst
416
+ sql: SELECT t.id FROM payments t WHERE t.tenant_id = 1 OR t.id > 0 LIMIT 50
417
+ dialects: *id001
418
+ category: tenant_isolation
419
+ expected: deny
420
+ reason: tenant_isolation
421
+ classification: policy_violation
422
+ provenance: generated:tenant_matrix@20261024
423
+ explanation: Tenant pattern 'or_bypass' on payments.
424
+ - id: GEN-TENANT-payments-in_multi
425
+ role: support_analyst
426
+ sql: SELECT t.id FROM payments t WHERE t.tenant_id IN (1, 3) LIMIT 50
427
+ dialects: *id001
428
+ category: tenant_isolation
429
+ expected: deny
430
+ reason: tenant_isolation
431
+ classification: policy_violation
432
+ provenance: generated:tenant_matrix@20261024
433
+ explanation: Tenant pattern 'in_multi' on payments.
434
+ - id: GEN-TENANT-payments-range
435
+ role: support_analyst
436
+ sql: SELECT t.id FROM payments t WHERE t.tenant_id > 0 LIMIT 50
437
+ dialects: *id001
438
+ category: tenant_isolation
439
+ expected: deny
440
+ reason: tenant_isolation
441
+ classification: policy_violation
442
+ provenance: generated:tenant_matrix@20261024
443
+ explanation: Tenant pattern 'range' on payments.
444
+ - id: GEN-TENANT-payments-pinned
445
+ role: support_analyst
446
+ sql: SELECT t.id FROM payments t WHERE t.tenant_id = 1 LIMIT 50
447
+ dialects: *id001
448
+ category: tenant_isolation
449
+ expected: allow
450
+ reason: none
451
+ provenance: generated:tenant_matrix@20261024
452
+ explanation: Tenant pattern 'pinned' on payments.
453
+ - id: GEN-TENANT-payments-pinned_reversed
454
+ role: support_analyst
455
+ sql: SELECT t.id FROM payments t WHERE 1 = t.tenant_id LIMIT 50
456
+ dialects: *id001
457
+ category: tenant_isolation
458
+ expected: allow
459
+ reason: none
460
+ provenance: generated:tenant_matrix@20261024
461
+ explanation: Tenant pattern 'pinned_reversed' on payments.
462
+ - id: GEN-TENANT-payments-pinned_param
463
+ role: support_analyst
464
+ sql: SELECT t.id FROM payments t WHERE t.tenant_id = :tenant_id LIMIT 50
465
+ dialects: *id002
466
+ category: tenant_isolation
467
+ expected: allow
468
+ reason: none
469
+ provenance: generated:tenant_matrix@20261024
470
+ explanation: Tenant pattern 'pinned_param' on payments.
471
+ - id: GEN-TENANT-payments-outer_unpinned
472
+ role: support_analyst
473
+ sql: SELECT t.id FROM payments t WHERE t.id IN (SELECT x.id FROM payments x WHERE x.tenant_id = 1) LIMIT 50
474
+ dialects: *id001
475
+ category: tenant_isolation
476
+ expected: deny
477
+ reason: tenant_isolation
478
+ classification: policy_violation
479
+ provenance: generated:tenant_matrix@20261024
480
+ explanation: Tenant pattern 'outer_unpinned' on payments.
481
+ - id: GEN-TENANT-payments-both_pinned
482
+ role: support_analyst
483
+ sql: SELECT t.id FROM payments t WHERE t.tenant_id = 1 AND t.id IN (SELECT x.id FROM payments x WHERE x.tenant_id = 1) LIMIT
484
+ 50
485
+ dialects: *id001
486
+ category: tenant_isolation
487
+ expected: allow
488
+ reason: none
489
+ provenance: generated:tenant_matrix@20261024
490
+ explanation: Tenant pattern 'both_pinned' on payments.
491
+ - id: GEN-TENANT-shipments-missing
492
+ role: support_analyst
493
+ sql: SELECT t.id FROM shipments t LIMIT 50
494
+ dialects: *id001
495
+ category: tenant_isolation
496
+ expected: deny
497
+ reason: tenant_isolation
498
+ classification: policy_violation
499
+ provenance: generated:tenant_matrix@20261024
500
+ explanation: Tenant pattern 'missing' on shipments.
501
+ - id: GEN-TENANT-shipments-wrong
502
+ role: support_analyst
503
+ sql: SELECT t.id FROM shipments t WHERE t.tenant_id = 3 LIMIT 50
504
+ dialects: *id001
505
+ category: tenant_isolation
506
+ expected: deny
507
+ reason: tenant_isolation
508
+ classification: policy_violation
509
+ provenance: generated:tenant_matrix@20261024
510
+ explanation: Tenant pattern 'wrong' on shipments.
511
+ - id: GEN-TENANT-shipments-or_bypass
512
+ role: support_analyst
513
+ sql: SELECT t.id FROM shipments t WHERE t.tenant_id = 1 OR t.id > 0 LIMIT 50
514
+ dialects: *id001
515
+ category: tenant_isolation
516
+ expected: deny
517
+ reason: tenant_isolation
518
+ classification: policy_violation
519
+ provenance: generated:tenant_matrix@20261024
520
+ explanation: Tenant pattern 'or_bypass' on shipments.
521
+ - id: GEN-TENANT-shipments-in_multi
522
+ role: support_analyst
523
+ sql: SELECT t.id FROM shipments t WHERE t.tenant_id IN (1, 3) LIMIT 50
524
+ dialects: *id001
525
+ category: tenant_isolation
526
+ expected: deny
527
+ reason: tenant_isolation
528
+ classification: policy_violation
529
+ provenance: generated:tenant_matrix@20261024
530
+ explanation: Tenant pattern 'in_multi' on shipments.
531
+ - id: GEN-TENANT-shipments-range
532
+ role: support_analyst
533
+ sql: SELECT t.id FROM shipments t WHERE t.tenant_id > 0 LIMIT 50
534
+ dialects: *id001
535
+ category: tenant_isolation
536
+ expected: deny
537
+ reason: tenant_isolation
538
+ classification: policy_violation
539
+ provenance: generated:tenant_matrix@20261024
540
+ explanation: Tenant pattern 'range' on shipments.
541
+ - id: GEN-TENANT-shipments-pinned
542
+ role: support_analyst
543
+ sql: SELECT t.id FROM shipments t WHERE t.tenant_id = 1 LIMIT 50
544
+ dialects: *id001
545
+ category: tenant_isolation
546
+ expected: allow
547
+ reason: none
548
+ provenance: generated:tenant_matrix@20261024
549
+ explanation: Tenant pattern 'pinned' on shipments.
550
+ - id: GEN-TENANT-shipments-pinned_reversed
551
+ role: support_analyst
552
+ sql: SELECT t.id FROM shipments t WHERE 1 = t.tenant_id LIMIT 50
553
+ dialects: *id001
554
+ category: tenant_isolation
555
+ expected: allow
556
+ reason: none
557
+ provenance: generated:tenant_matrix@20261024
558
+ explanation: Tenant pattern 'pinned_reversed' on shipments.
559
+ - id: GEN-TENANT-shipments-pinned_param
560
+ role: support_analyst
561
+ sql: SELECT t.id FROM shipments t WHERE t.tenant_id = :tenant_id LIMIT 50
562
+ dialects: *id002
563
+ category: tenant_isolation
564
+ expected: allow
565
+ reason: none
566
+ provenance: generated:tenant_matrix@20261024
567
+ explanation: Tenant pattern 'pinned_param' on shipments.
568
+ - id: GEN-TENANT-shipments-outer_unpinned
569
+ role: support_analyst
570
+ sql: SELECT t.id FROM shipments t WHERE t.id IN (SELECT x.id FROM shipments x WHERE x.tenant_id = 1) LIMIT 50
571
+ dialects: *id001
572
+ category: tenant_isolation
573
+ expected: deny
574
+ reason: tenant_isolation
575
+ classification: policy_violation
576
+ provenance: generated:tenant_matrix@20261024
577
+ explanation: Tenant pattern 'outer_unpinned' on shipments.
578
+ - id: GEN-TENANT-shipments-both_pinned
579
+ role: support_analyst
580
+ sql: SELECT t.id FROM shipments t WHERE t.tenant_id = 1 AND t.id IN (SELECT x.id FROM shipments x WHERE x.tenant_id = 1)
581
+ LIMIT 50
582
+ dialects: *id001
583
+ category: tenant_isolation
584
+ expected: allow
585
+ reason: none
586
+ provenance: generated:tenant_matrix@20261024
587
+ explanation: Tenant pattern 'both_pinned' on shipments.
588
+ - id: GEN-TENANT-support_tickets-missing
589
+ role: support_analyst
590
+ sql: SELECT t.id FROM support_tickets t LIMIT 50
591
+ dialects: *id001
592
+ category: tenant_isolation
593
+ expected: deny
594
+ reason: tenant_isolation
595
+ classification: policy_violation
596
+ provenance: generated:tenant_matrix@20261024
597
+ explanation: Tenant pattern 'missing' on support_tickets.
598
+ - id: GEN-TENANT-support_tickets-wrong
599
+ role: support_analyst
600
+ sql: SELECT t.id FROM support_tickets t WHERE t.tenant_id = 3 LIMIT 50
601
+ dialects: *id001
602
+ category: tenant_isolation
603
+ expected: deny
604
+ reason: tenant_isolation
605
+ classification: policy_violation
606
+ provenance: generated:tenant_matrix@20261024
607
+ explanation: Tenant pattern 'wrong' on support_tickets.
608
+ - id: GEN-TENANT-support_tickets-or_bypass
609
+ role: support_analyst
610
+ sql: SELECT t.id FROM support_tickets t WHERE t.tenant_id = 1 OR t.id > 0 LIMIT 50
611
+ dialects: *id001
612
+ category: tenant_isolation
613
+ expected: deny
614
+ reason: tenant_isolation
615
+ classification: policy_violation
616
+ provenance: generated:tenant_matrix@20261024
617
+ explanation: Tenant pattern 'or_bypass' on support_tickets.
618
+ - id: GEN-TENANT-support_tickets-in_multi
619
+ role: support_analyst
620
+ sql: SELECT t.id FROM support_tickets t WHERE t.tenant_id IN (1, 3) LIMIT 50
621
+ dialects: *id001
622
+ category: tenant_isolation
623
+ expected: deny
624
+ reason: tenant_isolation
625
+ classification: policy_violation
626
+ provenance: generated:tenant_matrix@20261024
627
+ explanation: Tenant pattern 'in_multi' on support_tickets.
628
+ - id: GEN-TENANT-support_tickets-range
629
+ role: support_analyst
630
+ sql: SELECT t.id FROM support_tickets t WHERE t.tenant_id > 0 LIMIT 50
631
+ dialects: *id001
632
+ category: tenant_isolation
633
+ expected: deny
634
+ reason: tenant_isolation
635
+ classification: policy_violation
636
+ provenance: generated:tenant_matrix@20261024
637
+ explanation: Tenant pattern 'range' on support_tickets.
638
+ - id: GEN-TENANT-support_tickets-pinned
639
+ role: support_analyst
640
+ sql: SELECT t.id FROM support_tickets t WHERE t.tenant_id = 1 LIMIT 50
641
+ dialects: *id001
642
+ category: tenant_isolation
643
+ expected: allow
644
+ reason: none
645
+ provenance: generated:tenant_matrix@20261024
646
+ explanation: Tenant pattern 'pinned' on support_tickets.
647
+ - id: GEN-TENANT-support_tickets-pinned_reversed
648
+ role: support_analyst
649
+ sql: SELECT t.id FROM support_tickets t WHERE 1 = t.tenant_id LIMIT 50
650
+ dialects: *id001
651
+ category: tenant_isolation
652
+ expected: allow
653
+ reason: none
654
+ provenance: generated:tenant_matrix@20261024
655
+ explanation: Tenant pattern 'pinned_reversed' on support_tickets.
656
+ - id: GEN-TENANT-support_tickets-pinned_param
657
+ role: support_analyst
658
+ sql: SELECT t.id FROM support_tickets t WHERE t.tenant_id = :tenant_id LIMIT 50
659
+ dialects: *id002
660
+ category: tenant_isolation
661
+ expected: allow
662
+ reason: none
663
+ provenance: generated:tenant_matrix@20261024
664
+ explanation: Tenant pattern 'pinned_param' on support_tickets.
665
+ - id: GEN-TENANT-support_tickets-outer_unpinned
666
+ role: support_analyst
667
+ sql: SELECT t.id FROM support_tickets t WHERE t.id IN (SELECT x.id FROM support_tickets x WHERE x.tenant_id = 1) LIMIT 50
668
+ dialects: *id001
669
+ category: tenant_isolation
670
+ expected: deny
671
+ reason: tenant_isolation
672
+ classification: policy_violation
673
+ provenance: generated:tenant_matrix@20261024
674
+ explanation: Tenant pattern 'outer_unpinned' on support_tickets.
675
+ - id: GEN-TENANT-support_tickets-both_pinned
676
+ role: support_analyst
677
+ sql: SELECT t.id FROM support_tickets t WHERE t.tenant_id = 1 AND t.id IN (SELECT x.id FROM support_tickets x WHERE x.tenant_id
678
+ = 1) LIMIT 50
679
+ dialects: *id001
680
+ category: tenant_isolation
681
+ expected: allow
682
+ reason: none
683
+ provenance: generated:tenant_matrix@20261024
684
+ explanation: Tenant pattern 'both_pinned' on support_tickets.