troxy-cli 1.21.0 → 1.22.0
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.
- package/bin/troxy.js +113 -14
- package/package.json +7 -4
- package/src/api.js +18 -0
- package/src/data/policy-spec.json +496 -0
- package/src/data/templates.json +1429 -0
- package/src/init.js +11 -0
- package/src/mcp-server.js +81 -0
- package/src/policies.js +341 -46
- package/src/policy-fields.js +107 -0
- package/src/simulate.js +251 -0
- package/src/tests/mcp-checkpoints.test.js +79 -0
- package/src/tests/model-checkpoint.test.js +5 -1
- package/src/tests/policies-create.test.js +218 -0
- package/src/tests/policies-org.test.js +60 -0
- package/src/tests/simulate.test.js +127 -0
- package/src/tests/templates.test.js +46 -0
- package/src/tool_detect.js +179 -0
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_generated_by": "troxy-tf-live/src/core-handler/tools/export_policy_spec.py",
|
|
3
|
+
"_why": "Vendored copy of the backend's policy condition rules, shared verbatim across every consumer that builds a condition without a round-trip: the dashboard (tests/policy-spec.json, checked by tests/check-policy-spec.js) and the CLI (src/data/policy-spec.json, checked by src/policy-fields.js). A field/operator/value drifting into a 'saves fine, never fires' bug now fails a build in exactly one place instead of silently in three.",
|
|
4
|
+
"domain_fields": {
|
|
5
|
+
"access": [
|
|
6
|
+
"login_action",
|
|
7
|
+
"site"
|
|
8
|
+
],
|
|
9
|
+
"comms": [
|
|
10
|
+
"body",
|
|
11
|
+
"channel",
|
|
12
|
+
"recipient",
|
|
13
|
+
"recipient_count",
|
|
14
|
+
"recipient_domain",
|
|
15
|
+
"subject"
|
|
16
|
+
],
|
|
17
|
+
"destructive": [
|
|
18
|
+
"action_verb",
|
|
19
|
+
"destination",
|
|
20
|
+
"item_count",
|
|
21
|
+
"resource",
|
|
22
|
+
"reversible"
|
|
23
|
+
],
|
|
24
|
+
"model": [
|
|
25
|
+
"cost_per_day",
|
|
26
|
+
"cost_per_hour",
|
|
27
|
+
"cost_per_month",
|
|
28
|
+
"effort",
|
|
29
|
+
"estimated_cost",
|
|
30
|
+
"model",
|
|
31
|
+
"model_calls_per_day",
|
|
32
|
+
"model_calls_per_hour",
|
|
33
|
+
"output_price",
|
|
34
|
+
"provider",
|
|
35
|
+
"tokens",
|
|
36
|
+
"tokens_per_day",
|
|
37
|
+
"tokens_per_hour",
|
|
38
|
+
"tokens_per_month"
|
|
39
|
+
],
|
|
40
|
+
"payment": [
|
|
41
|
+
"amount",
|
|
42
|
+
"merchant_name",
|
|
43
|
+
"spend_per_day",
|
|
44
|
+
"spend_per_hour",
|
|
45
|
+
"spend_per_month",
|
|
46
|
+
"tx_per_day"
|
|
47
|
+
],
|
|
48
|
+
"secrets": [
|
|
49
|
+
"content_action",
|
|
50
|
+
"content_type",
|
|
51
|
+
"destination",
|
|
52
|
+
"detection_count",
|
|
53
|
+
"detection_types",
|
|
54
|
+
"has_api_key",
|
|
55
|
+
"has_connection_string",
|
|
56
|
+
"has_credit_card",
|
|
57
|
+
"has_jwt",
|
|
58
|
+
"has_password",
|
|
59
|
+
"has_pii",
|
|
60
|
+
"has_private_key",
|
|
61
|
+
"has_sensitive_data",
|
|
62
|
+
"highest_severity",
|
|
63
|
+
"is_public"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"field_specs": {
|
|
67
|
+
"action_verb": {
|
|
68
|
+
"ops": [
|
|
69
|
+
"contains",
|
|
70
|
+
"eq",
|
|
71
|
+
"neq",
|
|
72
|
+
"not_contains",
|
|
73
|
+
"starts_with"
|
|
74
|
+
],
|
|
75
|
+
"kind": "text"
|
|
76
|
+
},
|
|
77
|
+
"amount": {
|
|
78
|
+
"ops": [
|
|
79
|
+
"between",
|
|
80
|
+
"eq",
|
|
81
|
+
"gt",
|
|
82
|
+
"gte",
|
|
83
|
+
"lt",
|
|
84
|
+
"lte"
|
|
85
|
+
],
|
|
86
|
+
"kind": "number"
|
|
87
|
+
},
|
|
88
|
+
"body": {
|
|
89
|
+
"ops": [
|
|
90
|
+
"contains",
|
|
91
|
+
"eq",
|
|
92
|
+
"neq",
|
|
93
|
+
"not_contains",
|
|
94
|
+
"starts_with"
|
|
95
|
+
],
|
|
96
|
+
"kind": "text"
|
|
97
|
+
},
|
|
98
|
+
"channel": {
|
|
99
|
+
"ops": [
|
|
100
|
+
"contains",
|
|
101
|
+
"eq",
|
|
102
|
+
"neq",
|
|
103
|
+
"not_contains"
|
|
104
|
+
],
|
|
105
|
+
"kind": "text"
|
|
106
|
+
},
|
|
107
|
+
"content_action": {
|
|
108
|
+
"ops": [
|
|
109
|
+
"contains",
|
|
110
|
+
"eq",
|
|
111
|
+
"neq",
|
|
112
|
+
"not_contains"
|
|
113
|
+
],
|
|
114
|
+
"kind": "text"
|
|
115
|
+
},
|
|
116
|
+
"content_type": {
|
|
117
|
+
"ops": [
|
|
118
|
+
"eq",
|
|
119
|
+
"neq"
|
|
120
|
+
],
|
|
121
|
+
"kind": "text"
|
|
122
|
+
},
|
|
123
|
+
"cost_per_day": {
|
|
124
|
+
"ops": [
|
|
125
|
+
"gt",
|
|
126
|
+
"gte",
|
|
127
|
+
"lt",
|
|
128
|
+
"lte"
|
|
129
|
+
],
|
|
130
|
+
"kind": "number"
|
|
131
|
+
},
|
|
132
|
+
"cost_per_hour": {
|
|
133
|
+
"ops": [
|
|
134
|
+
"gt",
|
|
135
|
+
"gte",
|
|
136
|
+
"lt",
|
|
137
|
+
"lte"
|
|
138
|
+
],
|
|
139
|
+
"kind": "number"
|
|
140
|
+
},
|
|
141
|
+
"cost_per_month": {
|
|
142
|
+
"ops": [
|
|
143
|
+
"gt",
|
|
144
|
+
"gte",
|
|
145
|
+
"lt",
|
|
146
|
+
"lte"
|
|
147
|
+
],
|
|
148
|
+
"kind": "number"
|
|
149
|
+
},
|
|
150
|
+
"destination": {
|
|
151
|
+
"ops": [
|
|
152
|
+
"contains",
|
|
153
|
+
"eq",
|
|
154
|
+
"neq",
|
|
155
|
+
"not_contains",
|
|
156
|
+
"starts_with"
|
|
157
|
+
],
|
|
158
|
+
"kind": "text"
|
|
159
|
+
},
|
|
160
|
+
"detection_count": {
|
|
161
|
+
"ops": [
|
|
162
|
+
"eq",
|
|
163
|
+
"gt",
|
|
164
|
+
"gte",
|
|
165
|
+
"lt",
|
|
166
|
+
"lte"
|
|
167
|
+
],
|
|
168
|
+
"kind": "number"
|
|
169
|
+
},
|
|
170
|
+
"detection_types": {
|
|
171
|
+
"ops": [
|
|
172
|
+
"contains",
|
|
173
|
+
"not_contains"
|
|
174
|
+
],
|
|
175
|
+
"kind": "text"
|
|
176
|
+
},
|
|
177
|
+
"effort": {
|
|
178
|
+
"ops": [
|
|
179
|
+
"eq",
|
|
180
|
+
"neq"
|
|
181
|
+
],
|
|
182
|
+
"kind": "text",
|
|
183
|
+
"values": [
|
|
184
|
+
"high",
|
|
185
|
+
"low",
|
|
186
|
+
"medium"
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
"estimated_cost": {
|
|
190
|
+
"ops": [
|
|
191
|
+
"gt",
|
|
192
|
+
"gte",
|
|
193
|
+
"lt",
|
|
194
|
+
"lte"
|
|
195
|
+
],
|
|
196
|
+
"kind": "number"
|
|
197
|
+
},
|
|
198
|
+
"has_api_key": {
|
|
199
|
+
"ops": [
|
|
200
|
+
"eq",
|
|
201
|
+
"neq"
|
|
202
|
+
],
|
|
203
|
+
"kind": "bool"
|
|
204
|
+
},
|
|
205
|
+
"has_connection_string": {
|
|
206
|
+
"ops": [
|
|
207
|
+
"eq",
|
|
208
|
+
"neq"
|
|
209
|
+
],
|
|
210
|
+
"kind": "bool"
|
|
211
|
+
},
|
|
212
|
+
"has_credit_card": {
|
|
213
|
+
"ops": [
|
|
214
|
+
"eq",
|
|
215
|
+
"neq"
|
|
216
|
+
],
|
|
217
|
+
"kind": "bool"
|
|
218
|
+
},
|
|
219
|
+
"has_jwt": {
|
|
220
|
+
"ops": [
|
|
221
|
+
"eq",
|
|
222
|
+
"neq"
|
|
223
|
+
],
|
|
224
|
+
"kind": "bool"
|
|
225
|
+
},
|
|
226
|
+
"has_password": {
|
|
227
|
+
"ops": [
|
|
228
|
+
"eq",
|
|
229
|
+
"neq"
|
|
230
|
+
],
|
|
231
|
+
"kind": "bool"
|
|
232
|
+
},
|
|
233
|
+
"has_pii": {
|
|
234
|
+
"ops": [
|
|
235
|
+
"eq",
|
|
236
|
+
"neq"
|
|
237
|
+
],
|
|
238
|
+
"kind": "bool"
|
|
239
|
+
},
|
|
240
|
+
"has_private_key": {
|
|
241
|
+
"ops": [
|
|
242
|
+
"eq",
|
|
243
|
+
"neq"
|
|
244
|
+
],
|
|
245
|
+
"kind": "bool"
|
|
246
|
+
},
|
|
247
|
+
"has_sensitive_data": {
|
|
248
|
+
"ops": [
|
|
249
|
+
"eq",
|
|
250
|
+
"neq"
|
|
251
|
+
],
|
|
252
|
+
"kind": "bool"
|
|
253
|
+
},
|
|
254
|
+
"highest_severity": {
|
|
255
|
+
"ops": [
|
|
256
|
+
"eq",
|
|
257
|
+
"neq"
|
|
258
|
+
],
|
|
259
|
+
"kind": "text",
|
|
260
|
+
"values": [
|
|
261
|
+
"high",
|
|
262
|
+
"low",
|
|
263
|
+
"medium"
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
"is_public": {
|
|
267
|
+
"ops": [
|
|
268
|
+
"eq",
|
|
269
|
+
"neq"
|
|
270
|
+
],
|
|
271
|
+
"kind": "bool"
|
|
272
|
+
},
|
|
273
|
+
"item_count": {
|
|
274
|
+
"ops": [
|
|
275
|
+
"eq",
|
|
276
|
+
"gt",
|
|
277
|
+
"gte",
|
|
278
|
+
"lt",
|
|
279
|
+
"lte"
|
|
280
|
+
],
|
|
281
|
+
"kind": "number"
|
|
282
|
+
},
|
|
283
|
+
"login_action": {
|
|
284
|
+
"ops": [
|
|
285
|
+
"contains",
|
|
286
|
+
"eq",
|
|
287
|
+
"neq",
|
|
288
|
+
"not_contains",
|
|
289
|
+
"starts_with"
|
|
290
|
+
],
|
|
291
|
+
"kind": "text",
|
|
292
|
+
"values": [
|
|
293
|
+
"login",
|
|
294
|
+
"signup"
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
"merchant_name": {
|
|
298
|
+
"ops": [
|
|
299
|
+
"contains",
|
|
300
|
+
"eq",
|
|
301
|
+
"neq",
|
|
302
|
+
"not_contains",
|
|
303
|
+
"starts_with"
|
|
304
|
+
],
|
|
305
|
+
"kind": "text"
|
|
306
|
+
},
|
|
307
|
+
"model": {
|
|
308
|
+
"ops": [
|
|
309
|
+
"contains",
|
|
310
|
+
"eq",
|
|
311
|
+
"neq",
|
|
312
|
+
"not_contains",
|
|
313
|
+
"starts_with"
|
|
314
|
+
],
|
|
315
|
+
"kind": "text"
|
|
316
|
+
},
|
|
317
|
+
"model_calls_per_day": {
|
|
318
|
+
"ops": [
|
|
319
|
+
"gt",
|
|
320
|
+
"gte",
|
|
321
|
+
"lt",
|
|
322
|
+
"lte"
|
|
323
|
+
],
|
|
324
|
+
"kind": "number"
|
|
325
|
+
},
|
|
326
|
+
"model_calls_per_hour": {
|
|
327
|
+
"ops": [
|
|
328
|
+
"gt",
|
|
329
|
+
"gte",
|
|
330
|
+
"lt",
|
|
331
|
+
"lte"
|
|
332
|
+
],
|
|
333
|
+
"kind": "number"
|
|
334
|
+
},
|
|
335
|
+
"output_price": {
|
|
336
|
+
"ops": [
|
|
337
|
+
"eq",
|
|
338
|
+
"gt",
|
|
339
|
+
"gte",
|
|
340
|
+
"lt",
|
|
341
|
+
"lte"
|
|
342
|
+
],
|
|
343
|
+
"kind": "number"
|
|
344
|
+
},
|
|
345
|
+
"provider": {
|
|
346
|
+
"ops": [
|
|
347
|
+
"contains",
|
|
348
|
+
"eq",
|
|
349
|
+
"neq",
|
|
350
|
+
"not_contains",
|
|
351
|
+
"starts_with"
|
|
352
|
+
],
|
|
353
|
+
"kind": "text"
|
|
354
|
+
},
|
|
355
|
+
"recipient": {
|
|
356
|
+
"ops": [
|
|
357
|
+
"contains",
|
|
358
|
+
"eq",
|
|
359
|
+
"neq",
|
|
360
|
+
"not_contains",
|
|
361
|
+
"starts_with"
|
|
362
|
+
],
|
|
363
|
+
"kind": "text"
|
|
364
|
+
},
|
|
365
|
+
"recipient_count": {
|
|
366
|
+
"ops": [
|
|
367
|
+
"eq",
|
|
368
|
+
"gt",
|
|
369
|
+
"gte",
|
|
370
|
+
"lt",
|
|
371
|
+
"lte"
|
|
372
|
+
],
|
|
373
|
+
"kind": "number"
|
|
374
|
+
},
|
|
375
|
+
"recipient_domain": {
|
|
376
|
+
"ops": [
|
|
377
|
+
"contains",
|
|
378
|
+
"eq",
|
|
379
|
+
"neq",
|
|
380
|
+
"not_contains",
|
|
381
|
+
"starts_with"
|
|
382
|
+
],
|
|
383
|
+
"kind": "text"
|
|
384
|
+
},
|
|
385
|
+
"resource": {
|
|
386
|
+
"ops": [
|
|
387
|
+
"contains",
|
|
388
|
+
"eq",
|
|
389
|
+
"neq",
|
|
390
|
+
"not_contains",
|
|
391
|
+
"starts_with"
|
|
392
|
+
],
|
|
393
|
+
"kind": "text"
|
|
394
|
+
},
|
|
395
|
+
"reversible": {
|
|
396
|
+
"ops": [
|
|
397
|
+
"eq",
|
|
398
|
+
"neq"
|
|
399
|
+
],
|
|
400
|
+
"kind": "bool"
|
|
401
|
+
},
|
|
402
|
+
"site": {
|
|
403
|
+
"ops": [
|
|
404
|
+
"contains",
|
|
405
|
+
"eq",
|
|
406
|
+
"neq",
|
|
407
|
+
"not_contains",
|
|
408
|
+
"starts_with"
|
|
409
|
+
],
|
|
410
|
+
"kind": "text"
|
|
411
|
+
},
|
|
412
|
+
"spend_per_day": {
|
|
413
|
+
"ops": [
|
|
414
|
+
"gt",
|
|
415
|
+
"gte",
|
|
416
|
+
"lt",
|
|
417
|
+
"lte"
|
|
418
|
+
],
|
|
419
|
+
"kind": "number"
|
|
420
|
+
},
|
|
421
|
+
"spend_per_hour": {
|
|
422
|
+
"ops": [
|
|
423
|
+
"gt",
|
|
424
|
+
"gte",
|
|
425
|
+
"lt",
|
|
426
|
+
"lte"
|
|
427
|
+
],
|
|
428
|
+
"kind": "number"
|
|
429
|
+
},
|
|
430
|
+
"spend_per_month": {
|
|
431
|
+
"ops": [
|
|
432
|
+
"gt",
|
|
433
|
+
"gte",
|
|
434
|
+
"lt",
|
|
435
|
+
"lte"
|
|
436
|
+
],
|
|
437
|
+
"kind": "number"
|
|
438
|
+
},
|
|
439
|
+
"subject": {
|
|
440
|
+
"ops": [
|
|
441
|
+
"contains",
|
|
442
|
+
"eq",
|
|
443
|
+
"neq",
|
|
444
|
+
"not_contains",
|
|
445
|
+
"starts_with"
|
|
446
|
+
],
|
|
447
|
+
"kind": "text"
|
|
448
|
+
},
|
|
449
|
+
"tokens": {
|
|
450
|
+
"ops": [
|
|
451
|
+
"eq",
|
|
452
|
+
"gt",
|
|
453
|
+
"gte",
|
|
454
|
+
"lt",
|
|
455
|
+
"lte"
|
|
456
|
+
],
|
|
457
|
+
"kind": "number"
|
|
458
|
+
},
|
|
459
|
+
"tokens_per_day": {
|
|
460
|
+
"ops": [
|
|
461
|
+
"gt",
|
|
462
|
+
"gte",
|
|
463
|
+
"lt",
|
|
464
|
+
"lte"
|
|
465
|
+
],
|
|
466
|
+
"kind": "number"
|
|
467
|
+
},
|
|
468
|
+
"tokens_per_hour": {
|
|
469
|
+
"ops": [
|
|
470
|
+
"gt",
|
|
471
|
+
"gte",
|
|
472
|
+
"lt",
|
|
473
|
+
"lte"
|
|
474
|
+
],
|
|
475
|
+
"kind": "number"
|
|
476
|
+
},
|
|
477
|
+
"tokens_per_month": {
|
|
478
|
+
"ops": [
|
|
479
|
+
"gt",
|
|
480
|
+
"gte",
|
|
481
|
+
"lt",
|
|
482
|
+
"lte"
|
|
483
|
+
],
|
|
484
|
+
"kind": "number"
|
|
485
|
+
},
|
|
486
|
+
"tx_per_day": {
|
|
487
|
+
"ops": [
|
|
488
|
+
"gt",
|
|
489
|
+
"gte",
|
|
490
|
+
"lt",
|
|
491
|
+
"lte"
|
|
492
|
+
],
|
|
493
|
+
"kind": "number"
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|