Ethanporath commited on
Commit
d3b7254
·
1 Parent(s): 3fab2ad

Revert "Test Commit"

Browse files

This reverts commit 3fab2ad8f602e702e4d3c88a42bee41c0c6a5424.

.DS_Store ADDED
Binary file (6.15 kB). View file
 
.scribe/cache.json DELETED
@@ -1,1219 +0,0 @@
1
- {
2
- "timestamp": "2025-07-30T10:52:52.318210",
3
- "datasets": {
4
- "result": [
5
- {
6
- "id": 3729,
7
- "datasource_name": "asbom_filtered",
8
- "columns": [
9
- {
10
- "column_name": "latest_version",
11
- "type": "STRING",
12
- "verbose_name": "Dep latest ver"
13
- },
14
- {
15
- "column_name": "high_severity_cves",
16
- "type": "INTEGER",
17
- "verbose_name": "C+H Vulns"
18
- },
19
- {
20
- "column_name": "license_is_permissive",
21
- "type": "BOOLEAN",
22
- "verbose_name": "Is permissive"
23
- },
24
- {
25
- "column_name": "scorecard_score",
26
- "type": "FLOAT",
27
- "verbose_name": "OpenSSF score"
28
- },
29
- {
30
- "column_name": "targets",
31
- "type": "STRING",
32
- "verbose_name": "SBOM Type"
33
- },
34
- {
35
- "column_name": "component_type",
36
- "type": "STRING",
37
- "verbose_name": "Component type"
38
- },
39
- {
40
- "column_name": "tag",
41
- "type": "STRING",
42
- "verbose_name": "Component version"
43
- },
44
- {
45
- "column_name": "component_version",
46
- "type": "STRING",
47
- "verbose_name": "Dep version"
48
- },
49
- {
50
- "column_name": "maintenance_score_int",
51
- "type": "INTEGER",
52
- "verbose_name": "Maintenance Score"
53
- },
54
- {
55
- "column_name": "license_expression",
56
- "type": "STRING",
57
- "verbose_name": "Licesne expression"
58
- },
59
- {
60
- "column_name": "version_is_up_to_date",
61
- "type": "BOOLEAN",
62
- "verbose_name": "Up-to-date"
63
- },
64
- {
65
- "column_name": "targetName",
66
- "type": "STRING",
67
- "verbose_name": "Component"
68
- },
69
- {
70
- "column_name": "component_name",
71
- "type": "STRING",
72
- "verbose_name": "Dependency"
73
- },
74
- {
75
- "column_name": "labels",
76
- "type": "STRING",
77
- "verbose_name": "Labels"
78
- },
79
- {
80
- "column_name": "component_purl",
81
- "type": "STRING",
82
- "verbose_name": "PURL"
83
- },
84
- {
85
- "column_name": "source_layer",
86
- "type": "STRING",
87
- "verbose_name": "Layer"
88
- },
89
- {
90
- "column_name": "licenses",
91
- "type": "STRING",
92
- "verbose_name": "Licenses"
93
- },
94
- {
95
- "column_name": "logical_app",
96
- "type": "STRING",
97
- "verbose_name": "Product"
98
- },
99
- {
100
- "column_name": "logical_app_version",
101
- "type": "STRING",
102
- "verbose_name": "Version"
103
- },
104
- {
105
- "column_name": "component_group",
106
- "type": "STRING",
107
- "verbose_name": ""
108
- },
109
- {
110
- "column_name": "tools",
111
- "type": "STRING",
112
- "verbose_name": ""
113
- }
114
- ]
115
- },
116
- {
117
- "id": 3702,
118
- "datasource_name": "API Attestations",
119
- "columns": [
120
- {
121
- "column_name": "logical_app",
122
- "type": "STRING",
123
- "verbose_name": "Product"
124
- },
125
- {
126
- "column_name": "logical_app_version",
127
- "type": "STRING",
128
- "verbose_name": "Version"
129
- },
130
- {
131
- "column_name": "published",
132
- "type": "BOOLEAN",
133
- "verbose_name": ""
134
- },
135
- {
136
- "column_name": "deleted",
137
- "type": "BOOLEAN",
138
- "verbose_name": ""
139
- },
140
- {
141
- "column_name": "attestation_timestamp",
142
- "type": "DATETIMETZ",
143
- "verbose_name": ""
144
- },
145
- {
146
- "column_name": "context_elements",
147
- "type": "JSONB",
148
- "verbose_name": ""
149
- },
150
- {
151
- "column_name": "context",
152
- "type": "JSONB",
153
- "verbose_name": ""
154
- },
155
- {
156
- "column_name": "version_rank",
157
- "type": "LONGINTEGER",
158
- "verbose_name": ""
159
- },
160
- {
161
- "column_name": "deeplink",
162
- "type": "STRING",
163
- "verbose_name": ""
164
- },
165
- {
166
- "column_name": "targetName",
167
- "type": "STRING",
168
- "verbose_name": ""
169
- },
170
- {
171
- "column_name": "sigStatus",
172
- "type": "STRING",
173
- "verbose_name": ""
174
- },
175
- {
176
- "column_name": "targetType",
177
- "type": "STRING",
178
- "verbose_name": ""
179
- },
180
- {
181
- "column_name": "contentType",
182
- "type": "STRING",
183
- "verbose_name": ""
184
- },
185
- {
186
- "column_name": "contextType",
187
- "type": "STRING",
188
- "verbose_name": ""
189
- },
190
- {
191
- "column_name": "job_name",
192
- "type": "STRING",
193
- "verbose_name": ""
194
- },
195
- {
196
- "column_name": "run_id",
197
- "type": "STRING",
198
- "verbose_name": ""
199
- },
200
- {
201
- "column_name": "license",
202
- "type": "STRING",
203
- "verbose_name": ""
204
- }
205
- ]
206
- },
207
- {
208
- "id": 3706,
209
- "datasource_name": "CVE Impact v2",
210
- "columns": [
211
- {
212
- "column_name": "is_latest_logical_version",
213
- "type": "BOOLEAN",
214
- "verbose_name": "Latest product version"
215
- },
216
- {
217
- "column_name": "has_kev",
218
- "type": "BOOLEAN",
219
- "verbose_name": "Has KEV"
220
- },
221
- {
222
- "column_name": "has_fix",
223
- "type": "BOOLEAN",
224
- "verbose_name": "Has Fix"
225
- },
226
- {
227
- "column_name": "version_timestamp",
228
- "type": "DATETIMETZ",
229
- "verbose_name": "Version timestamp"
230
- },
231
- {
232
- "column_name": "component_id",
233
- "type": "LONGINTEGER",
234
- "verbose_name": "Component ID"
235
- },
236
- {
237
- "column_name": "tag",
238
- "type": "STRING",
239
- "verbose_name": "Component Version"
240
- },
241
- {
242
- "column_name": "version_id",
243
- "type": "LONGINTEGER",
244
- "verbose_name": "Version ID"
245
- },
246
- {
247
- "column_name": "product_id",
248
- "type": "LONGINTEGER",
249
- "verbose_name": "Product ID"
250
- },
251
- {
252
- "column_name": "component_version",
253
- "type": "STRING",
254
- "verbose_name": "Dependency Version"
255
- },
256
- {
257
- "column_name": "cvss_score",
258
- "type": "FLOAT",
259
- "verbose_name": "CVSS"
260
- },
261
- {
262
- "column_name": "vul_component_created",
263
- "type": "DATETIMETZ",
264
- "verbose_name": "Discovered"
265
- },
266
- {
267
- "column_name": "vul_published_on",
268
- "type": "DATETIMETZ",
269
- "verbose_name": "Published"
270
- },
271
- {
272
- "column_name": "epssProbability",
273
- "type": "FLOAT",
274
- "verbose_name": "EPSS"
275
- },
276
- {
277
- "column_name": "cwes",
278
- "type": "JSONB",
279
- "verbose_name": "CWEs"
280
- },
281
- {
282
- "column_name": "targetName",
283
- "type": "STRING",
284
- "verbose_name": "Component"
285
- },
286
- {
287
- "column_name": "vulnerability_id",
288
- "type": "STRING",
289
- "verbose_name": "ID"
290
- },
291
- {
292
- "column_name": "component_name",
293
- "type": "STRING",
294
- "verbose_name": "Dependency"
295
- },
296
- {
297
- "column_name": "severity",
298
- "type": "INTEGER",
299
- "verbose_name": ""
300
- },
301
- {
302
- "column_name": "source_layer",
303
- "type": "STRING",
304
- "verbose_name": "Layer"
305
- },
306
- {
307
- "column_name": "labels",
308
- "type": "STRING",
309
- "verbose_name": "Labels"
310
- },
311
- {
312
- "column_name": "logical_app",
313
- "type": "STRING",
314
- "verbose_name": "Product"
315
- },
316
- {
317
- "column_name": "vul_hyperlinks",
318
- "type": "STRING",
319
- "verbose_name": "References"
320
- },
321
- {
322
- "column_name": "vul_source",
323
- "type": "STRING",
324
- "verbose_name": "Source"
325
- },
326
- {
327
- "column_name": "tool",
328
- "type": "STRING",
329
- "verbose_name": "Tool"
330
- },
331
- {
332
- "column_name": "logical_app_version",
333
- "type": "STRING",
334
- "verbose_name": "Version"
335
- },
336
- {
337
- "column_name": "teamId",
338
- "type": "LONGINTEGER",
339
- "verbose_name": ""
340
- },
341
- {
342
- "column_name": "targets",
343
- "type": "STRING",
344
- "verbose_name": ""
345
- },
346
- {
347
- "column_name": "latest_package_version",
348
- "type": "STRING",
349
- "verbose_name": ""
350
- },
351
- {
352
- "column_name": "attestation_name",
353
- "type": "STRING",
354
- "verbose_name": ""
355
- }
356
- ]
357
- },
358
- {
359
- "id": 3730,
360
- "datasource_name": "endoflife_250326",
361
- "columns": [
362
- {
363
- "column_name": "lts",
364
- "type": "DATETIMETZ",
365
- "verbose_name": "LTS Date"
366
- },
367
- {
368
- "column_name": "eol",
369
- "type": "DATETIMETZ",
370
- "verbose_name": "EOL Date"
371
- },
372
- {
373
- "column_name": "releaseDate",
374
- "type": "DATETIMETZ",
375
- "verbose_name": "Release Date"
376
- },
377
- {
378
- "column_name": "support",
379
- "type": "DATETIMETZ",
380
- "verbose_name": "Support Date"
381
- },
382
- {
383
- "column_name": "link",
384
- "type": "STRING",
385
- "verbose_name": "Info URL"
386
- },
387
- {
388
- "column_name": "latest",
389
- "type": "STRING",
390
- "verbose_name": "Latest Version"
391
- },
392
- {
393
- "column_name": "cycle",
394
- "type": "STRING",
395
- "verbose_name": "Cycle"
396
- },
397
- {
398
- "column_name": "product",
399
- "type": "STRING",
400
- "verbose_name": "Product"
401
- },
402
- {
403
- "column_name": "teamId",
404
- "type": "LONGINTEGER",
405
- "verbose_name": ""
406
- }
407
- ]
408
- },
409
- {
410
- "id": 3709,
411
- "datasource_name": "FSTracker Event Data",
412
- "columns": [
413
- {
414
- "column_name": "mainAttestation_timestamp",
415
- "type": "DATETIMETZ",
416
- "verbose_name": ""
417
- },
418
- {
419
- "column_name": "event_time",
420
- "type": "DATETIME",
421
- "verbose_name": ""
422
- },
423
- {
424
- "column_name": "mainAttestation",
425
- "type": "LONGINTEGER",
426
- "verbose_name": ""
427
- },
428
- {
429
- "column_name": "event_id",
430
- "type": "LONGINTEGER",
431
- "verbose_name": ""
432
- },
433
- {
434
- "column_name": "targetName",
435
- "type": "STRING",
436
- "verbose_name": ""
437
- },
438
- {
439
- "column_name": "pipelineRun",
440
- "type": "STRING",
441
- "verbose_name": ""
442
- },
443
- {
444
- "column_name": "targetType",
445
- "type": "STRING",
446
- "verbose_name": ""
447
- },
448
- {
449
- "column_name": "contentType",
450
- "type": "STRING",
451
- "verbose_name": ""
452
- },
453
- {
454
- "column_name": "contextType",
455
- "type": "STRING",
456
- "verbose_name": ""
457
- },
458
- {
459
- "column_name": "cmd_line",
460
- "type": "STRING",
461
- "verbose_name": ""
462
- },
463
- {
464
- "column_name": "process_environment",
465
- "type": "STRING",
466
- "verbose_name": ""
467
- },
468
- {
469
- "column_name": "event_environment",
470
- "type": "STRING",
471
- "verbose_name": ""
472
- },
473
- {
474
- "column_name": "event_type",
475
- "type": "STRING",
476
- "verbose_name": ""
477
- },
478
- {
479
- "column_name": "executable",
480
- "type": "STRING",
481
- "verbose_name": ""
482
- },
483
- {
484
- "column_name": "action",
485
- "type": "STRING",
486
- "verbose_name": ""
487
- },
488
- {
489
- "column_name": "path",
490
- "type": "STRING",
491
- "verbose_name": ""
492
- },
493
- {
494
- "column_name": "process",
495
- "type": "STRING",
496
- "verbose_name": ""
497
- },
498
- {
499
- "column_name": "user",
500
- "type": "STRING",
501
- "verbose_name": ""
502
- }
503
- ]
504
- },
505
- {
506
- "id": 3722,
507
- "datasource_name": "ProcessesData",
508
- "columns": [
509
- {
510
- "column_name": "created",
511
- "type": "DATETIME",
512
- "verbose_name": ""
513
- },
514
- {
515
- "column_name": "mainAttestation",
516
- "type": "LONGINTEGER",
517
- "verbose_name": ""
518
- },
519
- {
520
- "column_name": "teamId",
521
- "type": "LONGINTEGER",
522
- "verbose_name": ""
523
- },
524
- {
525
- "column_name": "id",
526
- "type": "LONGINTEGER",
527
- "verbose_name": ""
528
- },
529
- {
530
- "column_name": "cmd_line",
531
- "type": "STRING",
532
- "verbose_name": ""
533
- },
534
- {
535
- "column_name": "process_id",
536
- "type": "STRING",
537
- "verbose_name": ""
538
- },
539
- {
540
- "column_name": "work_dir",
541
- "type": "STRING",
542
- "verbose_name": ""
543
- },
544
- {
545
- "column_name": "mnt_ns",
546
- "type": "STRING",
547
- "verbose_name": ""
548
- },
549
- {
550
- "column_name": "executable",
551
- "type": "STRING",
552
- "verbose_name": ""
553
- },
554
- {
555
- "column_name": "tracing",
556
- "type": "STRING",
557
- "verbose_name": ""
558
- },
559
- {
560
- "column_name": "parent",
561
- "type": "STRING",
562
- "verbose_name": ""
563
- },
564
- {
565
- "column_name": "cgroup",
566
- "type": "STRING",
567
- "verbose_name": ""
568
- },
569
- {
570
- "column_name": "pid",
571
- "type": "STRING",
572
- "verbose_name": ""
573
- },
574
- {
575
- "column_name": "environment",
576
- "type": "STRING",
577
- "verbose_name": ""
578
- },
579
- {
580
- "column_name": "user",
581
- "type": "STRING",
582
- "verbose_name": ""
583
- }
584
- ]
585
- },
586
- {
587
- "id": 3712,
588
- "datasource_name": "Findings",
589
- "columns": [
590
- {
591
- "column_name": "Severity",
592
- "type": "",
593
- "verbose_name": ""
594
- },
595
- {
596
- "column_name": "created",
597
- "type": "DATETIMETZ",
598
- "verbose_name": "Created"
599
- },
600
- {
601
- "column_name": "description",
602
- "type": "STRING",
603
- "verbose_name": "Description"
604
- },
605
- {
606
- "column_name": "parser",
607
- "type": "STRING",
608
- "verbose_name": ""
609
- },
610
- {
611
- "column_name": "title",
612
- "type": "STRING",
613
- "verbose_name": "Title"
614
- },
615
- {
616
- "column_name": "finding",
617
- "type": "JSONB",
618
- "verbose_name": ""
619
- },
620
- {
621
- "column_name": "context",
622
- "type": "JSONB",
623
- "verbose_name": ""
624
- },
625
- {
626
- "column_name": "teamId",
627
- "type": "LONGINTEGER",
628
- "verbose_name": ""
629
- }
630
- ]
631
- },
632
- {
633
- "id": 3719,
634
- "datasource_name": "License per dependency",
635
- "columns": [
636
- {
637
- "column_name": "latest",
638
- "type": "BOOLEAN",
639
- "verbose_name": ""
640
- },
641
- {
642
- "column_name": "license",
643
- "type": "STRING",
644
- "verbose_name": "License"
645
- },
646
- {
647
- "column_name": "license_expression",
648
- "type": "STRING",
649
- "verbose_name": "License Exp."
650
- },
651
- {
652
- "column_name": "license_is_permissive",
653
- "type": "BOOLEAN",
654
- "verbose_name": "Is Permissive"
655
- },
656
- {
657
- "column_name": "targetType",
658
- "type": "STRING",
659
- "verbose_name": "Comp type"
660
- },
661
- {
662
- "column_name": "group",
663
- "type": "STRING",
664
- "verbose_name": "Package Mgr"
665
- },
666
- {
667
- "column_name": "targetName",
668
- "type": "STRING",
669
- "verbose_name": "Component"
670
- },
671
- {
672
- "column_name": "component_name",
673
- "type": "STRING",
674
- "verbose_name": "Dependency"
675
- },
676
- {
677
- "column_name": "logical_app",
678
- "type": "STRING",
679
- "verbose_name": "Product"
680
- },
681
- {
682
- "column_name": "logical_app_version",
683
- "type": "STRING",
684
- "verbose_name": "Version"
685
- },
686
- {
687
- "column_name": "teamId",
688
- "type": "LONGINTEGER",
689
- "verbose_name": ""
690
- }
691
- ]
692
- },
693
- {
694
- "id": 3731,
695
- "datasource_name": "extended_lineage_new",
696
- "columns": [
697
- {
698
- "column_name": "parent_external_id",
699
- "type": "STRING",
700
- "verbose_name": "Parent External ID"
701
- },
702
- {
703
- "column_name": "product_id",
704
- "type": "LONGINTEGER",
705
- "verbose_name": "Product ID"
706
- },
707
- {
708
- "column_name": "external_id",
709
- "type": "STRING",
710
- "verbose_name": "External ID"
711
- },
712
- {
713
- "column_name": "timestamp",
714
- "type": "DATETIME",
715
- "verbose_name": "Updated"
716
- },
717
- {
718
- "column_name": "properties",
719
- "type": "JSONB",
720
- "verbose_name": "Info"
721
- },
722
- {
723
- "column_name": "uri",
724
- "type": "STRING",
725
- "verbose_name": "URI"
726
- },
727
- {
728
- "column_name": "owner",
729
- "type": "STRING",
730
- "verbose_name": "Owner"
731
- },
732
- {
733
- "column_name": "logical_app",
734
- "type": "STRING",
735
- "verbose_name": "Product"
736
- },
737
- {
738
- "column_name": "path",
739
- "type": "STRING",
740
- "verbose_name": "Path"
741
- },
742
- {
743
- "column_name": "logical_app_version",
744
- "type": "STRING",
745
- "verbose_name": "Version"
746
- },
747
- {
748
- "column_name": "parent_id",
749
- "type": "LONGINTEGER",
750
- "verbose_name": ""
751
- },
752
- {
753
- "column_name": "child_id",
754
- "type": "LONGINTEGER",
755
- "verbose_name": ""
756
- },
757
- {
758
- "column_name": "version_id",
759
- "type": "LONGINTEGER",
760
- "verbose_name": ""
761
- },
762
- {
763
- "column_name": "teamId",
764
- "type": "INTEGER",
765
- "verbose_name": ""
766
- }
767
- ]
768
- },
769
- {
770
- "id": 3739,
771
- "datasource_name": "policy_initiative",
772
- "columns": [
773
- {
774
- "column_name": "is_latest_logical_version",
775
- "type": "BOOLEAN",
776
- "verbose_name": "Latest Product Version"
777
- },
778
- {
779
- "column_name": "control_name",
780
- "type": "STRING",
781
- "verbose_name": "Policy Control"
782
- },
783
- {
784
- "column_name": "initiative_name",
785
- "type": "STRING",
786
- "verbose_name": "Policy Initiative"
787
- },
788
- {
789
- "column_name": "rule_name",
790
- "type": "STRING",
791
- "verbose_name": "Policy Rule"
792
- },
793
- {
794
- "column_name": "time_evaluated",
795
- "type": "DATETIMETZ",
796
- "verbose_name": "Time"
797
- },
798
- {
799
- "column_name": "count",
800
- "type": "LONGINTEGER",
801
- "verbose_name": "Count"
802
- },
803
- {
804
- "column_name": "message",
805
- "type": "STRING",
806
- "verbose_name": "Message"
807
- },
808
- {
809
- "column_name": "logical_app",
810
- "type": "STRING",
811
- "verbose_name": "Product"
812
- },
813
- {
814
- "column_name": "logical_app_version",
815
- "type": "STRING",
816
- "verbose_name": "Version"
817
- },
818
- {
819
- "column_name": "teamId",
820
- "type": "LONGINTEGER",
821
- "verbose_name": ""
822
- },
823
- {
824
- "column_name": "version_id",
825
- "type": "LONGINTEGER",
826
- "verbose_name": ""
827
- },
828
- {
829
- "column_name": "gate_name",
830
- "type": "STRING",
831
- "verbose_name": ""
832
- },
833
- {
834
- "column_name": "asset_name",
835
- "type": "STRING",
836
- "verbose_name": ""
837
- },
838
- {
839
- "column_name": "gate_type",
840
- "type": "STRING",
841
- "verbose_name": ""
842
- },
843
- {
844
- "column_name": "asset_type",
845
- "type": "STRING",
846
- "verbose_name": ""
847
- },
848
- {
849
- "column_name": "status",
850
- "type": "STRING",
851
- "verbose_name": ""
852
- }
853
- ]
854
- },
855
- {
856
- "id": 3742,
857
- "datasource_name": "product_risk_1.0",
858
- "columns": [
859
- {
860
- "column_name": "logical_app_version",
861
- "type": "STRING",
862
- "verbose_name": "Version"
863
- },
864
- {
865
- "column_name": "logical_app",
866
- "type": "STRING",
867
- "verbose_name": "Product"
868
- },
869
- {
870
- "column_name": "has_fix",
871
- "type": "BOOLEAN",
872
- "verbose_name": ""
873
- },
874
- {
875
- "column_name": "weighted_cve_risk",
876
- "type": "DECIMAL",
877
- "verbose_name": ""
878
- },
879
- {
880
- "column_name": "total_cves_in_base_image",
881
- "type": "DECIMAL",
882
- "verbose_name": ""
883
- },
884
- {
885
- "column_name": "in_base_image",
886
- "type": "BOOLEAN",
887
- "verbose_name": ""
888
- },
889
- {
890
- "column_name": "total_fixables",
891
- "type": "DECIMAL",
892
- "verbose_name": ""
893
- },
894
- {
895
- "column_name": "weight",
896
- "type": "FLOAT",
897
- "verbose_name": ""
898
- },
899
- {
900
- "column_name": "has_kev",
901
- "type": "BOOLEAN",
902
- "verbose_name": ""
903
- },
904
- {
905
- "column_name": "target_risk",
906
- "type": "DECIMAL",
907
- "verbose_name": "Component Risk"
908
- },
909
- {
910
- "column_name": "logical_app_version_cves_in_base_image",
911
- "type": "DECIMAL",
912
- "verbose_name": ""
913
- },
914
- {
915
- "column_name": "total_risk",
916
- "type": "DECIMAL",
917
- "verbose_name": ""
918
- },
919
- {
920
- "column_name": "total_exploitables",
921
- "type": "DECIMAL",
922
- "verbose_name": ""
923
- },
924
- {
925
- "column_name": "target_fixables",
926
- "type": "LONGINTEGER",
927
- "verbose_name": ""
928
- },
929
- {
930
- "column_name": "target",
931
- "type": "STRING",
932
- "verbose_name": "Component"
933
- },
934
- {
935
- "column_name": "logical_app_version_risk",
936
- "type": "DECIMAL",
937
- "verbose_name": "Product Risk"
938
- },
939
- {
940
- "column_name": "logical_app_version_fixables",
941
- "type": "DECIMAL",
942
- "verbose_name": ""
943
- },
944
- {
945
- "column_name": "logical_app_version_exploitables",
946
- "type": "DECIMAL",
947
- "verbose_name": ""
948
- },
949
- {
950
- "column_name": "target_cves_in_base_image",
951
- "type": "LONGINTEGER",
952
- "verbose_name": ""
953
- },
954
- {
955
- "column_name": "target_exploitables",
956
- "type": "LONGINTEGER",
957
- "verbose_name": ""
958
- },
959
- {
960
- "column_name": "vulnerability_id",
961
- "type": "STRING",
962
- "verbose_name": "CVE ID"
963
- },
964
- {
965
- "column_name": "num_targets",
966
- "type": "LONGINTEGER",
967
- "verbose_name": ""
968
- },
969
- {
970
- "column_name": "teamId",
971
- "type": "LONGINTEGER",
972
- "verbose_name": ""
973
- }
974
- ]
975
- },
976
- {
977
- "id": 3720,
978
- "datasource_name": "MARKETING Team activity",
979
- "columns": [
980
- {
981
- "column_name": "teamName",
982
- "type": "STRING",
983
- "verbose_name": "Team name"
984
- },
985
- {
986
- "column_name": "autoProvisioningCustomerSource",
987
- "type": "STRING",
988
- "verbose_name": "Provisioned-by"
989
- },
990
- {
991
- "column_name": "date",
992
- "type": "DATE",
993
- "verbose_name": ""
994
- },
995
- {
996
- "column_name": "teamId",
997
- "type": "LONGINTEGER",
998
- "verbose_name": ""
999
- }
1000
- ]
1001
- },
1002
- {
1003
- "id": 3703,
1004
- "datasource_name": "API Vulnerabilities",
1005
- "columns": [
1006
- {
1007
- "column_name": "cwe_array",
1008
- "type": "",
1009
- "verbose_name": "CWEs"
1010
- },
1011
- {
1012
- "column_name": "dependency_analysis",
1013
- "type": "JSONB",
1014
- "verbose_name": "Dependency Analysis"
1015
- },
1016
- {
1017
- "column_name": "has_fix",
1018
- "type": "BOOLEAN",
1019
- "verbose_name": "Has Fix"
1020
- },
1021
- {
1022
- "column_name": "will_not_fix",
1023
- "type": "BOOLEAN",
1024
- "verbose_name": "Will Not Fix"
1025
- },
1026
- {
1027
- "column_name": "is_latest_logical_version",
1028
- "type": "BOOLEAN",
1029
- "verbose_name": "Latest product version"
1030
- },
1031
- {
1032
- "column_name": "vul_date_changed",
1033
- "type": "DATETIMETZ",
1034
- "verbose_name": "Vulnerability Last Change"
1035
- },
1036
- {
1037
- "column_name": "cpes",
1038
- "type": "STRINGARRAY",
1039
- "verbose_name": "Dependency CPEs"
1040
- },
1041
- {
1042
- "column_name": "advisory_modified",
1043
- "type": "DATETIMETZ",
1044
- "verbose_name": "Advisory Modified"
1045
- },
1046
- {
1047
- "column_name": "hyper_links",
1048
- "type": "STRINGARRAY",
1049
- "verbose_name": "Hyper Links"
1050
- },
1051
- {
1052
- "column_name": "has_kev",
1053
- "type": "BOOLEAN",
1054
- "verbose_name": "Has KEV"
1055
- },
1056
- {
1057
- "column_name": "base_score",
1058
- "type": "FLOAT",
1059
- "verbose_name": "Base Score"
1060
- },
1061
- {
1062
- "column_name": "vul_component_created",
1063
- "type": "DATETIMETZ",
1064
- "verbose_name": "Dependency Date"
1065
- },
1066
- {
1067
- "column_name": "version_timestamp",
1068
- "type": "DATETIMETZ",
1069
- "verbose_name": "Version Timestamp"
1070
- },
1071
- {
1072
- "column_name": "advisory_justification",
1073
- "type": "STRING",
1074
- "verbose_name": "Advisory Justification"
1075
- },
1076
- {
1077
- "column_name": "attestation_name",
1078
- "type": "STRING",
1079
- "verbose_name": "Attestation Name"
1080
- },
1081
- {
1082
- "column_name": "advisory_status",
1083
- "type": "STRING",
1084
- "verbose_name": "Advisory Status"
1085
- },
1086
- {
1087
- "column_name": "advisory_text",
1088
- "type": "STRING",
1089
- "verbose_name": "Advisory Text"
1090
- },
1091
- {
1092
- "column_name": "tag",
1093
- "type": "STRING",
1094
- "verbose_name": "Component Version"
1095
- },
1096
- {
1097
- "column_name": "component_version",
1098
- "type": "STRING",
1099
- "verbose_name": "Dependency Version"
1100
- },
1101
- {
1102
- "column_name": "final_severity",
1103
- "type": "INTEGER",
1104
- "verbose_name": "Final Severity"
1105
- },
1106
- {
1107
- "column_name": "severity",
1108
- "type": "INTEGER",
1109
- "verbose_name": "Original Severity"
1110
- },
1111
- {
1112
- "column_name": "main_tool",
1113
- "type": "STRING",
1114
- "verbose_name": "Main Tool"
1115
- },
1116
- {
1117
- "column_name": "cvss_score",
1118
- "type": "FLOAT",
1119
- "verbose_name": "CVSS"
1120
- },
1121
- {
1122
- "column_name": "vul_published_on",
1123
- "type": "DATETIMETZ",
1124
- "verbose_name": "Published"
1125
- },
1126
- {
1127
- "column_name": "epssProbability",
1128
- "type": "FLOAT",
1129
- "verbose_name": "EPSS"
1130
- },
1131
- {
1132
- "column_name": "vul_hyperlinks",
1133
- "type": "JSONB",
1134
- "verbose_name": "References"
1135
- },
1136
- {
1137
- "column_name": "vendor",
1138
- "type": "JSONB",
1139
- "verbose_name": "Vendor"
1140
- },
1141
- {
1142
- "column_name": "targetName",
1143
- "type": "STRING",
1144
- "verbose_name": "Component"
1145
- },
1146
- {
1147
- "column_name": "vulnerability_id",
1148
- "type": "STRING",
1149
- "verbose_name": "ID"
1150
- },
1151
- {
1152
- "column_name": "component_name",
1153
- "type": "STRING",
1154
- "verbose_name": "Dependency"
1155
- },
1156
- {
1157
- "column_name": "source_layer",
1158
- "type": "STRING",
1159
- "verbose_name": "Layer"
1160
- },
1161
- {
1162
- "column_name": "labels",
1163
- "type": "STRING",
1164
- "verbose_name": "Labels"
1165
- },
1166
- {
1167
- "column_name": "logical_app",
1168
- "type": "STRING",
1169
- "verbose_name": "Product"
1170
- },
1171
- {
1172
- "column_name": "vul_source",
1173
- "type": "STRING",
1174
- "verbose_name": "Source"
1175
- },
1176
- {
1177
- "column_name": "targets",
1178
- "type": "STRING",
1179
- "verbose_name": "Targets"
1180
- },
1181
- {
1182
- "column_name": "text",
1183
- "type": "STRING",
1184
- "verbose_name": "Text"
1185
- },
1186
- {
1187
- "column_name": "tool",
1188
- "type": "STRING",
1189
- "verbose_name": "Tool"
1190
- },
1191
- {
1192
- "column_name": "logical_app_version",
1193
- "type": "STRING",
1194
- "verbose_name": "Version"
1195
- },
1196
- {
1197
- "column_name": "vector",
1198
- "type": "STRING",
1199
- "verbose_name": "Vector"
1200
- },
1201
- {
1202
- "column_name": "teamId",
1203
- "type": "LONGINTEGER",
1204
- "verbose_name": ""
1205
- },
1206
- {
1207
- "column_name": "pipeline_run_id",
1208
- "type": "LONGINTEGER",
1209
- "verbose_name": ""
1210
- }
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.vscode/mcp.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "servers": {
3
- "ScribeMCP": {
4
- "url": "http://127.0.0.1:8000/mcp",
5
- "type": "sse"
6
- }
7
- },
8
- }
 
 
 
 
 
 
 
 
 
mcp_app/__init__.py DELETED
File without changes
mcp_app/endpointsAPI.py DELETED
@@ -1,315 +0,0 @@
1
- from fastapi import FastAPI, HTTPException
2
- from fastapi.responses import JSONResponse
3
- from scribe_python_client.client import ScribeClient
4
- from dotenv import load_dotenv
5
- from pydantic import BaseModel
6
- from typing import *
7
- from pathlib import Path
8
- import logging
9
- import json
10
- import os
11
- from contextlib import asynccontextmanager
12
-
13
-
14
- load_dotenv()
15
- API_TOKEN = os.getenv("SCRIBE_TOKEN")
16
- client = ScribeClient(api_token=API_TOKEN)
17
-
18
- #test
19
- toolDocsPath = Path(__file__).parent / "toolsDescriptions/tool_docs.json"
20
-
21
- class QueryStr(BaseModel):
22
- columns: List[str] = []
23
- filters: List[dict] = []
24
- metrics: List[dict] = []
25
- groupby: List[str] = []
26
- orderby: List[List[Any]] = []
27
- row_limit: int = 20
28
-
29
-
30
- class QueryEntry(BaseModel):
31
- question: str = ""
32
- querystr: Union[dict, str]
33
-
34
- class QueryRequest(BaseModel):
35
- question: Optional[str] = None
36
- querystr: Optional[Union[str, dict]] = None
37
- format: Optional[str] = "str"
38
-
39
- class QueryResponse(BaseModel):
40
- format: str
41
- status: bool
42
- status_info: str
43
- json_data: object
44
- str: str
45
-
46
-
47
- def get_products_list() -> list:
48
- result = client.get_products()
49
- listOfProducts = []
50
- for i in range(len(result)):
51
- listOfProducts.append(result[i]["name"])
52
- return listOfProducts
53
-
54
- def load_context():
55
- with open(toolDocsPath, "r") as f:
56
- return json.load(f)
57
-
58
- @asynccontextmanager
59
- async def lifespan(app: FastAPI):
60
- app.state.tool_context = load_context()
61
- yield
62
-
63
- app = FastAPI(lifespan=lifespan)
64
-
65
-
66
- @app.get("/products")
67
- async def get_products():
68
- """
69
- Endpoint: Retrieve a list of products managed in Scribe: Should be called when asked for scribe products or a list of products.
70
-
71
- Args: Nothing
72
-
73
- Returns:
74
- JSONResponse: Json list of products
75
- """
76
- try:
77
- return client.get_products()
78
- except Exception as e:
79
- logging.exception(f"Error in get_products endpoint {e}")
80
-
81
- @app.get("/datasets")
82
- async def get_datasets():
83
- """
84
- Endpoint: Retrieve all datasets: This should be called when anything about datasets is mentions.
85
-
86
- Args: Nothing
87
-
88
- Returns:
89
- JSONResponse: Json list of datasets
90
- """
91
- try:
92
- return client.get_datasets()
93
- except Exception as e:
94
- logging.exception(f"Error in get_datasets endpoint: {e}")
95
-
96
- @app.get("/{product_name}/vulns")
97
- async def get_product_vulnerability(product_name: str):
98
- """
99
- Endpoint: Retrieve vulnerabilities for a specific product: This should be called when a specifc product and the user is asking for vulnerabilities.
100
-
101
- Args: product name.
102
-
103
- Returns:
104
- JSONResponse: Json list of product vulnerabilities
105
- """
106
- products = get_products_list()
107
- if product_name not in products:
108
- logging.exception(f"Product name: {product_name} is not a valid product")
109
- raise HTTPException(status_code=404, detail=str("Product not found"))
110
- try:
111
- return client.get_product_vulnerabilities(product_name)
112
- except Exception as e:
113
- logging.exception(f"Error in get_product_vulnerabilities endpoint: {e}")
114
-
115
-
116
- @app.get("/{product_name}/policy")
117
- async def get_product_policy(product_name: str):
118
- """
119
- Endpoint: Retrieve policy for a specific product: This should be called when a specifc product and the user is asking for policy.
120
-
121
- Args: product name.
122
-
123
- Returns: JSONResponse: Json list of product policy
124
- """
125
- products = get_products_list()
126
- if product_name not in products:
127
- logging.exception(f"Product name: {product_name} is not a valid product")
128
- raise HTTPException(status_code=404, detail=str("Product not found"))
129
- try:
130
- return client.get_policy_results(product_name)
131
- except Exception as e:
132
- logging.exception(f"Error in get_policy_results endpoint: {e}")
133
-
134
- @app.post("/vulnerabilities")
135
- async def query_vulnerabilities(input: dict):
136
- response = QueryResponse(
137
- format="",
138
- status=True,
139
- status_info="Query executed successfully",
140
- json_data={},
141
- str=""
142
- )
143
- try:
144
- result_str = client.query_vulnerabilities(json.dumps(input))
145
- if result_str.startswith("Error"):
146
- logging.exception("Error in query_vulnerabilities endpoint")
147
- raise HTTPException(status_code=400, detail=result_str)
148
- if result_str == f"\nNo data found":
149
- response.status = False
150
- response.status_info = "No data found"
151
- elif format == "json":
152
- response.json_data = result_str
153
- else:
154
- response.format = "str"
155
- response.str = result_str
156
- except HTTPException as he:
157
- raise he
158
- except Exception as e:
159
- logging.exception(f"Error in query_vulnerabilities endpoint: {e}")
160
- response.status = False
161
- response.status_info = str(e)
162
- return response
163
-
164
- @app.post("/products")
165
- async def query_products(input: dict):
166
- response = QueryResponse(
167
- format="",
168
- status=True,
169
- status_info="Query executed successfully",
170
- json_data={},
171
- str=""
172
- )
173
- try:
174
- result_str = client.query_products(json.dumps(input))
175
- if result_str.startswith("Error"):
176
- logging.exception("Error in query_products endpoint")
177
- raise HTTPException(status_code=400, detail=result_str)
178
- if result_str == f"\nNo data found":
179
- response.status = False
180
- response.status_info = "No data found"
181
- elif format == "json":
182
- response.json_data = result_str
183
- else:
184
- response.format = "str"
185
- response.str = result_str
186
- except HTTPException as he:
187
- raise he
188
- except Exception as e:
189
- logging.exception(f"Error in query_products endpoint: {e}")
190
- response.status = False
191
- response.status_info = str(e)
192
- return response
193
-
194
- @app.post("/policy")
195
- async def query_policy_results(input: dict):
196
- response = QueryResponse(
197
- format="",
198
- status=True,
199
- status_info="Query executed successfully",
200
- json_data={},
201
- str=""
202
- )
203
- try:
204
- result_str = client.query_policy_results(json.dumps(input))
205
- if result_str.startswith("Error"):
206
- logging.exception("Error in query_policy_results endpoint")
207
- raise HTTPException(status_code=400, detail=result_str)
208
- if result_str == f"\nNo data found":
209
- response.status = False
210
- response.status_info = "No data found"
211
- elif format == "json":
212
- response.json_data = result_str
213
- else:
214
- response.format = "str"
215
- response.str = result_str
216
- except HTTPException as he:
217
- raise he
218
- except Exception as e:
219
- logging.exception(f"Error in query_policy_results endpoint: {e}")
220
- response.status = False
221
- response.status_info = str(e)
222
- return response
223
-
224
- @app.post("/lineage")
225
- async def query_lineage(input: dict):
226
- response = QueryResponse(
227
- format="",
228
- status=True,
229
- status_info="Query executed successfully",
230
- json_data={},
231
- str=""
232
- )
233
- try:
234
- print(input)
235
- result_str = client.query_lineage(json.dumps(input))
236
- if result_str.startswith("Error"):
237
- logging.exception("Error in query_lineage endpoint")
238
- raise HTTPException(status_code=400, detail=result_str)
239
- if result_str == f"\nNo data found":
240
- response.status = False
241
- response.status_info = "No data found"
242
- elif format == "json":
243
- response.json_data = result_str
244
- else:
245
- response.format = "str"
246
- response.str = result_str
247
- except HTTPException as he:
248
- raise he
249
- except Exception as e:
250
- logging.exception(f"Error in query_lineage endpoint: {e}")
251
- response.status = False
252
- response.status_info = str(e)
253
- return response
254
-
255
- @app.post("/risk")
256
- async def query_risk(input: dict):
257
- response = QueryResponse(
258
- format="",
259
- status=True,
260
- status_info="Query executed successfully",
261
- json_data={},
262
- str=""
263
- )
264
- try:
265
- print(input)
266
- result_str = client.query_risk(json.dumps(input))
267
- if result_str.startswith("Error"):
268
- logging.exception("Error in query_risk endpoint")
269
- raise HTTPException(status_code=400, detail=result_str)
270
- if result_str == f"\nNo data found":
271
- response.status = False
272
- response.status_info = "No data found"
273
- elif format == "json":
274
- response.json_data = result_str
275
- else:
276
- response.format = "str"
277
- response.str = result_str
278
- except HTTPException as he:
279
- raise he
280
- except Exception as e:
281
- logging.exception(f"Error in query_risk endpoint: {e}")
282
- response.status = False
283
- response.status_info = str(e)
284
- return response
285
-
286
- @app.post("/findings")
287
- async def query_findings(input: dict):
288
- response = QueryResponse(
289
- format="",
290
- status=True,
291
- status_info="Query executed successfully",
292
- json_data={},
293
- str=""
294
- )
295
- try:
296
- print(input)
297
- result_str = client.query_findings(json.dumps(input))
298
- if result_str.startswith("Error"):
299
- logging.exception("Error in query_findings endpoint")
300
- raise HTTPException(status_code=400, detail=result_str)
301
- if result_str == f"\nNo data found":
302
- response.status = False
303
- response.status_info = "No data found"
304
- elif format == "json":
305
- response.json_data = result_str
306
- else:
307
- response.format = "str"
308
- response.str = result_str
309
- except HTTPException as he:
310
- raise he
311
- except Exception as e:
312
- logging.exception(f"Error in query_findings endpoint: {e}")
313
- response.status = False
314
- response.status_info = str(e)
315
- return response
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mcp_app/main.py DELETED
@@ -1,14 +0,0 @@
1
- from mcp_app.endpointsAPI import app
2
- from fastapi_mcp import FastApiMCP
3
- from pathlib import Path
4
- import json
5
-
6
- mcp = FastApiMCP(
7
- app,
8
- name="MCPEndpoints",
9
- description="Tools for querying data from Scribe database using FastAPI endpoints with MCP"
10
- )
11
-
12
-
13
- mcp.mount()
14
- mcp.setup_server()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mcp_app/openAiResponseAPITest.py DELETED
@@ -1,23 +0,0 @@
1
- from openai import OpenAI
2
- from dotenv import load_dotenv
3
-
4
-
5
- load_dotenv()
6
-
7
- def main():
8
- client = OpenAI()
9
- response = client.responses.create(
10
- model= "gpt-4o",
11
- tools= [{
12
- "type": "mcp",
13
- "server_label": "fastAPIEndpoints",
14
- "server_url": "https://eporath-scribe-client-mcp.hf.space/mcp",
15
- "require_approval": "never",
16
- }],
17
- input = "get me a list of products"
18
- )
19
- print(response.output_text)
20
-
21
-
22
- if __name__ == "__main__":
23
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mcp_app/query.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "columns": ["rule_name"],
3
- "metrics": [
4
- {
5
- "label": "failure_count",
6
- "expressionType": "SQL",
7
- "sqlExpression": "COUNT(*)"
8
- }
9
- ],
10
- "filters": [
11
- { "col": "initiative_name", "op": "==", "val": "SSDF" },
12
- { "col": "message", "op": "==", "val": "fail" }
13
- ],
14
- "orderby": [["failure_count", false]],
15
- "groupby": ["rule_name"],
16
- "row_limit": 20
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mcp_app/testEndpoints.py DELETED
@@ -1,138 +0,0 @@
1
- from dotenv import load_dotenv
2
- from pydantic import BaseModel
3
- import json
4
- import time
5
- import requests
6
- import os
7
- from pathlib import Path
8
-
9
- path1 = Path(__file__).parent / "query.json"
10
-
11
- class QueryString(BaseModel):
12
- query: dict
13
- title: str = ""
14
-
15
- def test_queries(payload):
16
- types_of_queries = ["vulnerabilities"]
17
- for item in types_of_queries:
18
- url = f"http://127.0.0.1:8000/policy"
19
- response = requests.post(url, json=payload)
20
- print("Status code:", response.status_code)
21
- try:
22
- response_json = response.json()
23
- print("Response JSON:", response_json)
24
- except Exception as e:
25
- print("Failed to parse JSON:", str(e))
26
-
27
-
28
-
29
-
30
- if __name__ == "__main__":
31
- queries = {
32
- "querystr": {
33
- "columns": ["logical_app","initiative_name"],
34
- "filters": [],
35
- "metrics": [],
36
- "groupby": [],
37
- "row_limit": 20
38
- }
39
- }
40
- '''
41
- ,
42
- "vulnerabilities": {
43
- "querystr": {
44
- "columns": ["logical_app", "vulnerability_id"],
45
- "filters": [],
46
- "metrics": [],
47
- "groupby": [],
48
- "row_limit": 20
49
- }
50
- },
51
- "products": {
52
- "querystr": {
53
- "columns": ["logical_app", "targets"],
54
- "filters": [],
55
- "metrics": [],
56
- "groupby": [],
57
- "row_limit": 20
58
- }
59
- },
60
- "lineage": {
61
- "querystr": {
62
- "columns": ["logical_app", "parent_name"],
63
- "filters": [],
64
- "metrics": [],
65
- "groupby": [],
66
- "row_limit": 20
67
- }
68
- },
69
- "risk": {
70
- "querystr": {
71
- "columns": ["logical_app", "target_risk"],
72
- "filters": [],
73
- "metrics": [],
74
- "groupby": [],
75
- "row_limit": 20
76
- }
77
- },
78
- "findings": {
79
- "querystr": {
80
- "columns": ["logical_app", "severity_order"],
81
- "filters": [],
82
- "metrics": [],
83
- "groupby": [],
84
- "row_limit": 20
85
- }
86
- }
87
- }
88
- '''
89
- queries1 = {
90
- "querystr": "{\"columns\": [\"vulnerability_id\", \"cvss_score\", \"epssProbability\", \"has_kev\"], \"filters\": [{\"col\": \"has_kev\", \"op\": \"==\", \"val\": true}, {\"col\": \"epssProbability\", \"op\": \">=\", \"val\": 0.1}], \"metrics\": [], \"orderby\": [[\"epssProbability\", false], [\"cvss_score\", false]], \"row_limit\": 5}",
91
- "question": "Query the vulnerabilities table for the top 5 risky CVEs - KEV vulnerabilities and vulnerabilities with highest EPSS scores"
92
- }
93
- queries2 = {
94
- "querystr": {
95
- "columns": ["vulnerability_id", "cvss_score", "epssProbability", "has_kev"],
96
- "filters": [{"col": "has_kev", "op": "==", "val": True}, {"col": "epssProbability", "op": ">=", "val": 0.1}],
97
- "metrics": [],
98
- "orderby": [["epssProbability", False], ["cvss_score", False]],
99
- "row_limit": 5}
100
- }
101
-
102
- input = {
103
- "question": "What are the assets of a product?",
104
- "function": "query_lineage",
105
- "querystr": "{\"columns\": [\"asset_name\", \"version_id\"], \"filters\": [{\"col\": \"logical_app\", \"op\": \"==\", \"val\": \"Astro-Analytics-Discovery\"}], \"groupby\": [], \"metrics\": [], \"orderby\": [[\"asset_type\", true],[\"asset_name\", true]], \"row_limit\": 50}"
106
- }
107
- input1 = {
108
- "columns": ["asset_name", "version_id"],
109
- "filters": [{"col": "logical_app", "op": "==", "val": "Astro-Analytics-Discovery"}],
110
- "metrics": [],
111
- "groupby": [],
112
- "orderby": [["asset_name", True]],
113
- "row_limit": 50
114
- }
115
-
116
- data1 = {
117
- "columns": ["logical_app", "vulnerability_id"],
118
- "filters": [],
119
- "metrics": [],
120
- "groupby": [],
121
- "row_limit": 20
122
- }
123
-
124
-
125
- with open(path1, "r") as f:
126
- data = json.load(f)
127
- test_queries(payload=data)
128
-
129
-
130
- #json.loads(query.querystr)
131
-
132
-
133
- #print(type(input["querystr"]))
134
- #print(type(json.dumps(queries2["querystr"])))
135
-
136
- #test = json.dumps(input["item"])
137
- #print(type(test))
138
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mcp_app/toolsDescriptions/functionDocumention.json DELETED
@@ -1,142 +0,0 @@
1
- {
2
- "name": "query_findings",
3
- "description": "Use this function to answer questions about security findings from tools, such as severities, CWE types, affected components, or file locations. Use it when asking about issues found in scans, their severity, tool origin, or impacted products.",
4
- "tableName": "Findings",
5
- "examples": {
6
- "1:": {
7
- "question": "What are the high-severity findings across all tools?",
8
- "function": "query_findings",
9
- "querystr": {
10
- "columns": [
11
- "title",
12
- "severity_string",
13
- "main_tool",
14
- "logical_app"
15
- ],
16
- "filters": [
17
- {
18
- "col": "severity_string",
19
- "op": "in",
20
- "val": [
21
- "HIGH",
22
- "CRITICAL"
23
- ]
24
- }
25
- ],
26
- "metrics": [],
27
- "groupby": [],
28
- "orderby": [
29
- [
30
- "severity_string",
31
- true
32
- ]
33
- ],
34
- "row_limit": 30
35
- }
36
- },
37
- "2": {
38
- "question": "How many findings exist for each product?",
39
- "function": "query_findings",
40
- "querystr": {
41
- "columns": [
42
- "logical_app"
43
- ],
44
- "filters": [],
45
- "metrics": [
46
- {
47
- "label": "finding_count",
48
- "expressionType": "SQL",
49
- "sqlExpression": "COUNT(*)"
50
- }
51
- ],
52
- "groupby": [
53
- "logical_app"
54
- ],
55
- "orderby": [
56
- [
57
- "finding_count",
58
- true
59
- ]
60
- ],
61
- "row_limit": 30
62
- }
63
- },
64
- "3": {
65
- "question": "Show me findings with a CVSS score above 7.",
66
- "function": "query_findings",
67
- "querystr": {
68
- "columns": [
69
- "title",
70
- "cvssv3",
71
- "logical_app",
72
- "component_name"
73
- ],
74
- "filters": [
75
- {
76
- "col": "cvssv3",
77
- "op": ">",
78
- "val": "7"
79
- }
80
- ],
81
- "metrics": [],
82
- "groupby": [],
83
- "orderby": [],
84
- "row_limit": 30
85
- }
86
- },
87
- "4": {
88
- "question": "Which tools produce the most findings?",
89
- "function": "query_findings",
90
- "querystr": {
91
- "columns": [
92
- "main_tool"
93
- ],
94
- "filters": [],
95
- "metrics": [
96
- {
97
- "label": "total_findings",
98
- "expressionType": "SQL",
99
- "sqlExpression": "COUNT(*)"
100
- }
101
- ],
102
- "groupby": [
103
- "main_tool"
104
- ],
105
- "orderby": [
106
- [
107
- "total_findings",
108
- true
109
- ]
110
- ],
111
- "row_limit": 30
112
- }
113
- },
114
- "5": {
115
- "question": "What types of CWEs are most commonly reported?",
116
- "function": "query_findings",
117
- "querystr": {
118
- "columns": [
119
- "cwe_id"
120
- ],
121
- "filters": [],
122
- "metrics": [
123
- {
124
- "label": "cwe_count",
125
- "expressionType": "SQL",
126
- "sqlExpression": "COUNT(*)"
127
- }
128
- ],
129
- "groupby": [
130
- "cwe_id"
131
- ],
132
- "orderby": [
133
- [
134
- "cwe_count",
135
- true
136
- ]
137
- ],
138
- "row_limit": 30
139
- }
140
- }
141
- }
142
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mcp_app/toolsDescriptions/queryDescription.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "query_lineage": "To answer software-factory related questions such as: What repos (or code repositories) are related/part of a product? or What are all the software-factory related components of a product (in this case query for asset_type and asset_name for the logical_app and logical_app_version)?",
3
- "query_policy_results": "To answer questions about policy evaluations like: What are the policy rules used? or Which of my products has SSDF policy violations? or List policy violations for a product.",
4
- "query_products": "To answer questions about products like: what are the/my products? What are the components of my product (the this case use the targetName column!)? What are the depdencieis of my product (search the component_name column)? Note that repositories and namespaces are part of the lineage table.",
5
- "query_risk": "To answer questions about products like: what are the/my products? What are the components of my product (the this case use the targetName column!)? What are the depdencieis of my product (search the component_name column)? Note that repositories and namespaces are part of the lineage table.",
6
- "query_vulnerabilities": "To answer questions about vulnerabilities like: What are the vulnerabilities of my product? What are the vulnerabilities of a specific component? What are the vulnerabilities of a specific version of a component? Which products have a specific vulnerability, or a vulnerability with a specificy characteristic (such as has_key)",
7
- "query_findings": "Use this function to answer questions about security findings from tools, such as severities, CWE types, affected components, or file locations. Use it when asking about issues found in scans, their severity, tool origin, or impacted products."
8
- }
 
 
 
 
 
 
 
 
 
mcp_app/toolsDescriptions/queryExamples.json DELETED
@@ -1,996 +0,0 @@
1
- {
2
- "query_lineage": [
3
- {
4
- "input": "Which platforms host the most assets?",
5
- "output": {
6
- "columns": [
7
- "platform_name"
8
- ],
9
- "metrics": [
10
- {
11
- "label": "asset_count",
12
- "expressionType": "SQL",
13
- "sqlExpression": "COUNT(*)"
14
- }
15
- ],
16
- "groupby": [
17
- "platform_name"
18
- ],
19
- "orderby": [
20
- [
21
- "asset_count",
22
- false
23
- ]
24
- ],
25
- "row_limit": 50
26
- }
27
- },
28
- {
29
- "input": "What are the organizations in my products and components?",
30
- "output": {
31
- "columns": [
32
- "asset_type",
33
- "asset_name"
34
- ],
35
- "filters": [
36
- {
37
- "col": "asset_type",
38
- "op": "==",
39
- "val": "organization"
40
- }
41
- ],
42
- "metrics": [],
43
- "orderby": [
44
- [
45
- "asset_name",
46
- true
47
- ]
48
- ],
49
- "row_limit": 30
50
- }
51
- },
52
- {
53
- "input": "What are the assets of a product?",
54
- "output": {
55
- "columns": [
56
- "asset_name ",
57
- "asset_type"
58
- ],
59
- "filters": [
60
- {
61
- "col": "logical_app",
62
- "op": "==",
63
- "val": "Hello_World_Github"
64
- }
65
- ],
66
- "groupby": [],
67
- "metrics": [],
68
- "orderby": [
69
- [
70
- "asset_type",
71
- true
72
- ],
73
- [
74
- "asset_name",
75
- true
76
- ]
77
- ],
78
- "row_limit": 50
79
- }
80
- },
81
- {
82
- "input": "What are the repositories in my products and components?",
83
- "output": {
84
- "columns": [
85
- "asset_type",
86
- "asset_name"
87
- ],
88
- "filters": [
89
- {
90
- "col": "asset_type",
91
- "op": "==",
92
- "val": "repo"
93
- }
94
- ],
95
- "metrics": [],
96
- "orderby": [
97
- [
98
- "asset_name",
99
- true
100
- ]
101
- ],
102
- "row_limit": 30
103
- }
104
- },
105
- {
106
- "input": "What are the most common types of assets recorded?",
107
- "output": {
108
- "columns": [
109
- "asset_type"
110
- ],
111
- "metrics": [
112
- {
113
- "label": "asset_count",
114
- "expressionType": "SQL",
115
- "sqlExpression": "COUNT(*)"
116
- }
117
- ],
118
- "groupby": [
119
- "asset_type"
120
- ],
121
- "orderby": [
122
- [
123
- "asset_count",
124
- false
125
- ]
126
- ],
127
- "row_limit": 50
128
- }
129
- }
130
- ],
131
- "query_policy_results": [
132
- {
133
- "input": "Which products implement the SSDF initiative?",
134
- "output": {
135
- "columns": [
136
- "logical_app"
137
- ],
138
- "filters": [
139
- {
140
- "col": "initiative_name",
141
- "op": "==",
142
- "val": "SSDF"
143
- }
144
- ],
145
- "metrics": [],
146
- "groupby": [],
147
- "row_limit": 20
148
- }
149
- },
150
- {
151
- "input": "Which policies are failing the most frequently?",
152
- "output": {
153
- "columns": [
154
- "rule_name"
155
- ],
156
- "metrics": [
157
- {
158
- "label": "failure_count",
159
- "expressionType": "SQL",
160
- "sqlExpression": "COUNT(*)"
161
- }
162
- ],
163
- "filters": [
164
- {
165
- "col": "message",
166
- "op": "==",
167
- "val": "fail"
168
- }
169
- ],
170
- "groupby": [
171
- "rule_name"
172
- ],
173
- "orderby": [
174
- [
175
- "failure_count",
176
- false
177
- ]
178
- ],
179
- "row_limit": 50
180
- }
181
- },
182
- {
183
- "input": "How has the rate of policy failures changed over time?",
184
- "output": {
185
- "columns": [
186
- "time_evaluated"
187
- ],
188
- "metrics": [
189
- {
190
- "label": "failure_count",
191
- "expressionType": "SQL",
192
- "sqlExpression": "COUNT(*)"
193
- }
194
- ],
195
- "filters": [
196
- {
197
- "col": "message",
198
- "op": "==",
199
- "val": "fail"
200
- }
201
- ],
202
- "groupby": [
203
- "time_evaluated"
204
- ],
205
- "orderby": [
206
- [
207
- "time_evaluated",
208
- true
209
- ]
210
- ],
211
- "row_limit": 50
212
- }
213
- },
214
- {
215
- "input": "Which targets are evaluated most frequently in policy checks?",
216
- "output": {
217
- "columns": [
218
- "asset_name"
219
- ],
220
- "metrics": [
221
- {
222
- "label": "evaluation_count",
223
- "expressionType": "SQL",
224
- "sqlExpression": "COUNT(*)"
225
- }
226
- ],
227
- "groupby": [
228
- "asset_name"
229
- ],
230
- "orderby": [
231
- [
232
- "evaluation_count",
233
- false
234
- ]
235
- ],
236
- "row_limit": 50
237
- }
238
- },
239
- {
240
- "input": "Which initiatives have the highest policy failure rates?",
241
- "output": {
242
- "columns": [
243
- "initiative_name"
244
- ],
245
- "metrics": [
246
- {
247
- "label": "failure_count",
248
- "expressionType": "SQL",
249
- "sqlExpression": "COUNT(*)"
250
- }
251
- ],
252
- "filters": [
253
- {
254
- "col": "message",
255
- "op": "==",
256
- "val": "fail"
257
- }
258
- ],
259
- "groupby": [
260
- "initiative_name"
261
- ],
262
- "orderby": [
263
- [
264
- "failure_count",
265
- false
266
- ]
267
- ],
268
- "row_limit": 50
269
- }
270
- },
271
- {
272
- "input": "At which gates do policies most commonly fail?",
273
- "output": {
274
- "columns": [],
275
- "metrics": [
276
- {
277
- "label": "failure_count",
278
- "expressionType": "SQL",
279
- "sqlExpression": "COUNT(*)"
280
- }
281
- ],
282
- "filters": [
283
- {
284
- "col": "message",
285
- "op": "==",
286
- "val": "fail"
287
- }
288
- ],
289
- "groupby": [],
290
- "orderby": [
291
- [
292
- "failure_count",
293
- false
294
- ]
295
- ],
296
- "row_limit": 50
297
- }
298
- },
299
- {
300
- "input": "What is the distribution of policy evaluation statuses?",
301
- "output": {
302
- "columns": [
303
- "message"
304
- ],
305
- "metrics": [
306
- {
307
- "label": "status_count",
308
- "expressionType": "SQL",
309
- "sqlExpression": "COUNT(*)"
310
- }
311
- ],
312
- "groupby": [
313
- "message"
314
- ],
315
- "row_limit": 50
316
- }
317
- },
318
- {
319
- "input": "Which product versions experience the most policy failures?",
320
- "output": {
321
- "columns": [
322
- "logical_app",
323
- "logical_app_version"
324
- ],
325
- "metrics": [
326
- {
327
- "label": "failure_count",
328
- "expressionType": "SQL",
329
- "sqlExpression": "COUNT(*)"
330
- }
331
- ],
332
- "filters": [
333
- {
334
- "col": "message",
335
- "op": "==",
336
- "val": "fail"
337
- }
338
- ],
339
- "groupby": [
340
- "logical_app",
341
- "logical_app_version"
342
- ],
343
- "orderby": [
344
- [
345
- "failure_count",
346
- false
347
- ]
348
- ],
349
- "row_limit": 50
350
- }
351
- },
352
- {
353
- "input": "Which general rules are failing the most?",
354
- "output": {
355
- "columns": [
356
- "rule_name"
357
- ],
358
- "metrics": [
359
- {
360
- "label": "failure_count",
361
- "expressionType": "SQL",
362
- "sqlExpression": "COUNT(*)"
363
- }
364
- ],
365
- "filters": [
366
- {
367
- "col": "message",
368
- "op": "==",
369
- "val": "fail"
370
- }
371
- ],
372
- "groupby": [
373
- "rule_name"
374
- ],
375
- "orderby": [
376
- [
377
- "failure_count",
378
- false
379
- ]
380
- ],
381
- "row_limit": 50
382
- }
383
- }
384
- ],
385
- "query_products": [
386
- {
387
- "input": "What python packages are in the base layers?",
388
- "output": {
389
- "columns": [
390
- "component_name",
391
- "component_purl",
392
- "base_layer"
393
- ],
394
- "filters": [
395
- {
396
- "col": "component_purl",
397
- "op": "like",
398
- "val": "%pypi%"
399
- },
400
- {
401
- "col": "base_layer",
402
- "op": "==",
403
- "val": "TRUE"
404
- }
405
- ],
406
- "metrics": [],
407
- "orderby": [
408
- [
409
- "component_name",
410
- true
411
- ]
412
- ],
413
- "row_limit": 30
414
- }
415
- },
416
- {
417
- "input": "What are the base layer values?",
418
- "output": {
419
- "columns": [
420
- "base_layer"
421
- ],
422
- "metrics": [
423
- {
424
- "label": "base_layer_count",
425
- "expressionType": "SQL",
426
- "sqlExpression": "COUNT(*)"
427
- }
428
- ],
429
- "groupby": [
430
- "base_layer"
431
- ],
432
- "row_limit": 30
433
- }
434
- },
435
- {
436
- "input": "What npm packages have non-permissive licenses?",
437
- "output": {
438
- "columns": [
439
- "component_name",
440
- "component_purl",
441
- "license_expression"
442
- ],
443
- "filters": [
444
- {
445
- "col": "component_purl",
446
- "op": "like",
447
- "val": "%pkg:npm%"
448
- },
449
- {
450
- "col": "license_expression",
451
- "op": "like",
452
- "val": "%GPL%"
453
- }
454
- ],
455
- "metrics": [],
456
- "orderby": [
457
- [
458
- "component_name",
459
- true
460
- ]
461
- ],
462
- "row_limit": 30
463
- }
464
- },
465
- {
466
- "input": "How many npm packages are in my products?",
467
- "output": {
468
- "columns": [],
469
- "filters": [
470
- {
471
- "col": "component_purl",
472
- "op": "like",
473
- "val": "%pkg:npm%"
474
- }
475
- ],
476
- "metrics": [
477
- {
478
- "label": "npm_component_count",
479
- "expressionType": "SQL",
480
- "sqlExpression": "COUNT(*)"
481
- }
482
- ],
483
- "orderby": [],
484
- "row_limit": 1
485
- }
486
- },
487
- {
488
- "input": "What are the high-level components of a product?",
489
- "output": {
490
- "columns": [
491
- "targetName"
492
- ],
493
- "filters": [
494
- {
495
- "col": "logical_app",
496
- "op": "==",
497
- "val": "Scribot"
498
- }
499
- ],
500
- "metrics": [],
501
- "orderby": [
502
- [
503
- "targetName",
504
- true
505
- ]
506
- ],
507
- "row_limit": 10
508
- }
509
- },
510
- {
511
- "input": "What are all the components that have the requests package?",
512
- "output": {
513
- "columns": [
514
- "targetName"
515
- ],
516
- "filters": [
517
- {
518
- "col": "component_name",
519
- "op": "==",
520
- "val": "requests"
521
- }
522
- ],
523
- "metrics": [],
524
- "orderby": [
525
- [
526
- "targetName",
527
- true
528
- ]
529
- ],
530
- "row_limit": 30
531
- }
532
- },
533
- {
534
- "input": "What are the labels in my products and components?",
535
- "output": {
536
- "columns": [
537
- "labels"
538
- ],
539
- "filters": [],
540
- "metrics": [],
541
- "orderby": [
542
- [
543
- "labels",
544
- true
545
- ]
546
- ],
547
- "row_limit": 30
548
- }
549
- }
550
- ],
551
- "query_vulnerabilities": [
552
- {
553
- "input": "Which components or modules in our software are most frequently associated with vulnerabilities?",
554
- "output": {
555
- "columns": [
556
- "logical_app",
557
- "logical_app_version",
558
- "version_timestamp",
559
- "component_name"
560
- ],
561
- "filters": [
562
- {
563
- "col": "is_latest_logical_version",
564
- "op": "==",
565
- "val": true
566
- }
567
- ],
568
- "metrics": [
569
- {
570
- "label": "vulnerability_count",
571
- "expressionType": "SQL",
572
- "sqlExpression": "COUNT()"
573
- }
574
- ],
575
- "orderby": [
576
- [
577
- "vulnerability_count",
578
- false
579
- ]
580
- ],
581
- "row_limit": 50
582
- }
583
- },
584
- {
585
- "input": "How many vulnerabilities that have a patch?",
586
- "output": {
587
- "columns": [
588
- "logical_app",
589
- "logical_app_version"
590
- ],
591
- "filters": [
592
- {
593
- "col": "is_latest_logical_version",
594
- "op": "==",
595
- "val": true
596
- },
597
- {
598
- "col": "has_fix",
599
- "op": "==",
600
- "val": true
601
- }
602
- ],
603
- "metrics": [
604
- {
605
- "label": "patchable_vulnerabilities",
606
- "expressionType": "SQL",
607
- "sqlExpression": "COUNT()"
608
- }
609
- ],
610
- "orderby": [
611
- [
612
- "unpatchable_vulnerabilities",
613
- true
614
- ]
615
- ],
616
- "row_limit": 30
617
- }
618
- },
619
- {
620
- "input": "Which package has most vulnerabilities that the vendor will not fix?",
621
- "output": {
622
- "columns": [
623
- "component_name",
624
- "component_version"
625
- ],
626
- "filters": [
627
- {
628
- "col": "is_latest_logical_version",
629
- "op": "==",
630
- "val": true
631
- },
632
- {
633
- "col": "will_not_fix",
634
- "op": "==",
635
- "val": true
636
- }
637
- ],
638
- "metrics": [
639
- {
640
- "label": "not_to_be_fixed_vulnerabilities",
641
- "expressionType": "SQL",
642
- "sqlExpression": "COUNT(*)"
643
- }
644
- ],
645
- "groupby": [
646
- "logical_app",
647
- "logical_app_version",
648
- "component_name"
649
- ],
650
- "orderby": [
651
- [
652
- "unpatchable_vulnerabilities",
653
- false
654
- ]
655
- ],
656
- "row_limit": 30
657
- }
658
- },
659
- {
660
- "input": "Which of my products have a KEV / exploitable vulnerability?",
661
- "output": {
662
- "columns": [
663
- "logical_app",
664
- "vulnerability_id"
665
- ],
666
- "filters": [
667
- {
668
- "col": "is_latest_logical_version",
669
- "op": "==",
670
- "val": true
671
- },
672
- {
673
- "col": "has_kev",
674
- "op": "==",
675
- "val": true
676
- }
677
- ],
678
- "metrics": [],
679
- "groupby": [],
680
- "orderby": [],
681
- "row_limit": 30
682
- }
683
- },
684
- {
685
- "input": "Which vulnerabilities affect the most of my products?",
686
- "output": {
687
- "columns": [
688
- "vulnerability_id",
689
- "final_severity"
690
- ],
691
- "filters": [
692
- {
693
- "col": "is_latest_logical_version",
694
- "op": "==",
695
- "val": true
696
- }
697
- ],
698
- "metrics": [
699
- {
700
- "label": "product_count",
701
- "expressionType": "SQL",
702
- "sqlExpression": "COUNT(distinct logical_app)"
703
- }
704
- ],
705
- "groupby": [],
706
- "orderby": [
707
- [
708
- "final_severity",
709
- false
710
- ],
711
- [
712
- "product_count",
713
- false
714
- ]
715
- ],
716
- "row_limit": 30
717
- }
718
- },
719
- {
720
- "input": "Which vulnerabilities have an Attack Vector: Network (Can be exploited over the network)?",
721
- "output": {
722
- "columns": [
723
- "logical_app",
724
- "vulnerability_id",
725
- "vector"
726
- ],
727
- "filters": [
728
- {
729
- "col": "is_latest_logical_version",
730
- "op": "==",
731
- "val": true
732
- },
733
- {
734
- "col": "vector",
735
- "op": "like",
736
- "val": "%AV:N%"
737
- }
738
- ],
739
- "metrics": [],
740
- "groupby": [],
741
- "orderby": [],
742
- "row_limit": 30
743
- }
744
- }
745
- ],
746
- "query_risk": [
747
- {
748
- "input": "Which product versions have the highest total risk?",
749
- "output": {
750
- "columns": [
751
- "logical_app_version",
752
- "logical_app",
753
- "total_risk"
754
- ],
755
- "filters": [],
756
- "metrics": [],
757
- "groupby": [],
758
- "orderby": [
759
- [
760
- "total_risk",
761
- true
762
- ]
763
- ],
764
- "row_limit": 30
765
- }
766
- },
767
- {
768
- "input": "How many fixable CVEs exist in each component?",
769
- "output": {
770
- "columns": [
771
- "target"
772
- ],
773
- "filters": [],
774
- "metrics": [
775
- {
776
- "label": "fixable_cves",
777
- "expressionType": "SQL",
778
- "sqlExpression": "SUM(target_fixables)"
779
- }
780
- ],
781
- "groupby": [
782
- "target"
783
- ],
784
- "orderby": [
785
- [
786
- "fixable_cves",
787
- true
788
- ]
789
- ],
790
- "row_limit": 30
791
- }
792
- },
793
- {
794
- "input": "List the top 10 products by weighted CVE risk.",
795
- "output": {
796
- "columns": [
797
- "logical_app",
798
- "weighted_cve_risk"
799
- ],
800
- "filters": [],
801
- "metrics": [],
802
- "groupby": [],
803
- "orderby": [
804
- [
805
- "weighted_cve_risk",
806
- true
807
- ]
808
- ],
809
- "row_limit": 10
810
- }
811
- },
812
- {
813
- "input": "Show total exploitables grouped by product version.",
814
- "output": {
815
- "columns": [
816
- "logical_app_version"
817
- ],
818
- "filters": [],
819
- "metrics": [
820
- {
821
- "label": "exploitables",
822
- "expressionType": "SQL",
823
- "sqlExpression": "SUM(logical_app_version_exploitables)"
824
- }
825
- ],
826
- "groupby": [
827
- "logical_app_version"
828
- ],
829
- "orderby": [
830
- [
831
- "exploitables",
832
- true
833
- ]
834
- ],
835
- "row_limit": 30
836
- }
837
- },
838
- {
839
- "input": "Which components have KEVs and are in the base image?",
840
- "output": {
841
- "columns": [
842
- "target",
843
- "vulnerability_id"
844
- ],
845
- "filters": [
846
- {
847
- "col": "has_kev",
848
- "op": "==",
849
- "val": true
850
- },
851
- {
852
- "col": "in_base_image",
853
- "op": "==",
854
- "val": true
855
- }
856
- ],
857
- "metrics": [],
858
- "groupby": [],
859
- "orderby": [],
860
- "row_limit": 30
861
- }
862
- }
863
- ],
864
- "query_findings": [
865
- {
866
- "input": "What are the high-severity findings across all tools?",
867
- "output": {
868
- "columns": [
869
- "title",
870
- "severity_string",
871
- "main_tool",
872
- "logical_app"
873
- ],
874
- "filters": [
875
- {
876
- "col": "severity_string",
877
- "op": "in",
878
- "val": [
879
- "HIGH",
880
- "CRITICAL"
881
- ]
882
- }
883
- ],
884
- "metrics": [],
885
- "groupby": [],
886
- "orderby": [
887
- [
888
- "severity_string",
889
- true
890
- ]
891
- ],
892
- "row_limit": 30
893
- }
894
- },
895
- {
896
- "input": "How many findings exist for each product?",
897
- "output": {
898
- "columns": [
899
- "logical_app"
900
- ],
901
- "filters": [],
902
- "metrics": [
903
- {
904
- "label": "finding_count",
905
- "expressionType": "SQL",
906
- "sqlExpression": "COUNT(*)"
907
- }
908
- ],
909
- "groupby": [
910
- "logical_app"
911
- ],
912
- "orderby": [
913
- [
914
- "finding_count",
915
- true
916
- ]
917
- ],
918
- "row_limit": 30
919
- }
920
- },
921
- {
922
- "input": "Show me findings with a CVSS score above 7.",
923
- "output": {
924
- "columns": [
925
- "title",
926
- "cvssv3",
927
- "logical_app",
928
- "component_name"
929
- ],
930
- "filters": [
931
- {
932
- "col": "cvssv3",
933
- "op": ">",
934
- "val": "7"
935
- }
936
- ],
937
- "metrics": [],
938
- "groupby": [],
939
- "orderby": [],
940
- "row_limit": 30
941
- }
942
- },
943
- {
944
- "input": "Which tools produce the most findings?",
945
- "output": {
946
- "columns": [
947
- "main_tool"
948
- ],
949
- "filters": [],
950
- "metrics": [
951
- {
952
- "label": "total_findings",
953
- "expressionType": "SQL",
954
- "sqlExpression": "COUNT(*)"
955
- }
956
- ],
957
- "groupby": [
958
- "main_tool"
959
- ],
960
- "orderby": [
961
- [
962
- "total_findings",
963
- true
964
- ]
965
- ],
966
- "row_limit": 30
967
- }
968
- },
969
- {
970
- "input": "What types of CWEs are most commonly reported?",
971
- "output": {
972
- "columns": [
973
- "cwe_id"
974
- ],
975
- "filters": [],
976
- "metrics": [
977
- {
978
- "label": "cwe_count",
979
- "expressionType": "SQL",
980
- "sqlExpression": "COUNT(*)"
981
- }
982
- ],
983
- "groupby": [
984
- "cwe_id"
985
- ],
986
- "orderby": [
987
- [
988
- "cwe_count",
989
- true
990
- ]
991
- ],
992
- "row_limit": 30
993
- }
994
- }
995
- ]
996
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mcp_app/toolsDescriptions/queryParams.json DELETED
@@ -1,147 +0,0 @@
1
-
2
- {
3
- "input_parameters": [
4
- {
5
- "name": "question",
6
- "type": "string",
7
- "description": "Human readable question about information in teh company database",
8
- "required": true
9
- }
10
- ],
11
- "output_schema": {
12
- "type": "object",
13
- "properties": {
14
- "columns": {
15
- "type": "array",
16
- "items": {
17
- "type": "string"
18
- },
19
- "description": "Only include necessary columns. Each column must match the columnTable documentation. DO NOT invent columns."
20
- },
21
- "filters": {
22
- "type": "array",
23
- "items": {
24
- "type": "object",
25
- "properties": {
26
- "col": {
27
- "type": "string"
28
- },
29
- "op": {
30
- "type": "string"
31
- },
32
- "val": {}
33
- },
34
- "required": [
35
- "col",
36
- "op",
37
- "val"
38
- ]
39
- },
40
- "description": "Use operators: ==, !=, >, <, >=, <=, in, not in, is null, is not null. Use 'extras' key for like/ilike."
41
- },
42
- "metrics": {
43
- "type": "array",
44
- "minItems": 0,
45
- "items": {
46
- "type": "object",
47
- "properties": {
48
- "label": {
49
- "type": "string",
50
- "description": "Name of the output column for the metric"
51
- },
52
- "expressionType": {
53
- "type": "string",
54
- "enum": [
55
- "SQL",
56
- "SIMPLE"
57
- ],
58
- "description": "Type of expression used. Typically 'SQL'."
59
- },
60
- "sqlExpression": {
61
- "type": "string",
62
- "description": "SQL expression to calculate the metric, such as 'COUNT(*)' or 'AVG(score)'"
63
- }
64
- },
65
- "required": [
66
- "label",
67
- "expressionType",
68
- "sqlExpression"
69
- ]
70
- },
71
- "description": "Either an empty array, or an array of expression objects with 'label', 'expressionType', and 'sqlExpression'."
72
- },
73
- "orderby": {
74
- "type": "array",
75
- "minItems": 0,
76
- "items": {
77
- "type": "array",
78
- "items": [
79
- {
80
- "type": "string",
81
- "description": "Column name"
82
- },
83
- {
84
- "type": "boolean",
85
- "description": "Column name. To sort in acending order use False and in decending order use True"
86
- }
87
- ],
88
- "minItems": 2,
89
- "maxItems": 2
90
- },
91
- "description": "Either an empty array, or a list of [column_name, is_ascending] pairs. Column must be in 'columns'."
92
- },
93
- "groupby": {
94
- "type": "array",
95
- "description": "Optional list of column names to group results by. Grouping is used to aggregate rows that share the same values in the specified columns, often used in combination with metrics.",
96
- "minItems": 0,
97
- "items": {
98
- "type": "string",
99
- "description": "A column name to group by, should be one or more of theß columns used in the columns item"
100
- }
101
- },
102
- "row_limit": {
103
- "type": "integer",
104
- "default": 10,
105
- "description": "Default: 10, max: 30."
106
- }
107
- },
108
- "required": [
109
- "columns",
110
- "filters",
111
- "metrics",
112
- "orderby",
113
- "grouby",
114
- "row_limit"
115
- ]
116
- },
117
- "example": {
118
- "input": "Human readable question",
119
- "output": {
120
- "columns": [
121
- "column_name1",
122
- "column_name2"
123
- ],
124
- "filters": [
125
- {
126
- "col": "column_name",
127
- "op": "operator",
128
- "val": "value"
129
- }
130
- ],
131
- "metrics": [
132
- {
133
- "label": "column_name",
134
- "expressionType": "expression",
135
- "sqlExpression": "SQL expression to calculate the metric"
136
- }
137
- ],
138
- "orderby": [
139
- [
140
- "column_name",
141
- "(true) or (false)"
142
- ]
143
- ],
144
- "row_limit": 10
145
- }
146
- }
147
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mcp_app/toolsDescriptions/queryTables.json DELETED
@@ -1,1358 +0,0 @@
1
- {
2
- "query_lineage": {
3
- "columns": [
4
- {
5
- "column_name": "prent_bloack",
6
- "type": "",
7
- "label": "Parent",
8
- "description": ""
9
- },
10
- {
11
- "column_name": "more",
12
- "type": "",
13
- "label": " More",
14
- "description": ""
15
- },
16
- {
17
- "column_name": "asset_block",
18
- "type": "",
19
- "label": "Asset",
20
- "description": ""
21
- },
22
- {
23
- "column_name": "g-source",
24
- "type": "STRING",
25
- "label": "G-Source",
26
- "description": ""
27
- },
28
- {
29
- "column_name": "g-target",
30
- "type": "STRING",
31
- "label": "G-Target",
32
- "description": ""
33
- },
34
- {
35
- "column_name": "tooltip",
36
- "type": "STRING",
37
- "label": "Tooltip",
38
- "description": ""
39
- },
40
- {
41
- "column_name": "parent_external_id",
42
- "type": "STRING",
43
- "label": "Parent External ID",
44
- "description": ""
45
- },
46
- {
47
- "column_name": "product_id",
48
- "type": "LONGINTEGER",
49
- "label": "Product ID",
50
- "description": ""
51
- },
52
- {
53
- "column_name": "external_id",
54
- "type": "STRING",
55
- "label": "External ID",
56
- "description": ""
57
- },
58
- {
59
- "column_name": "parent_name",
60
- "type": "STRING",
61
- "label": "Parent Name",
62
- "description": ""
63
- },
64
- {
65
- "column_name": "parent_type",
66
- "type": "STRING",
67
- "label": "Parent Type",
68
- "description": ""
69
- },
70
- {
71
- "column_name": "platform_type",
72
- "type": "STRING",
73
- "label": "Platform Type",
74
- "description": ""
75
- },
76
- {
77
- "column_name": "timestamp",
78
- "type": "DATETIME",
79
- "label": "Updated",
80
- "description": ""
81
- },
82
- {
83
- "column_name": "asset_name",
84
- "type": "STRING",
85
- "label": "Asset",
86
- "description": ""
87
- },
88
- {
89
- "column_name": "properties",
90
- "type": "JSONB",
91
- "label": "Info",
92
- "description": ""
93
- },
94
- {
95
- "column_name": "uri",
96
- "type": "STRING",
97
- "label": "URI",
98
- "description": ""
99
- },
100
- {
101
- "column_name": "owner",
102
- "type": "STRING",
103
- "label": "Owner",
104
- "description": ""
105
- },
106
- {
107
- "column_name": "platform_name",
108
- "type": "STRING",
109
- "label": "Platform",
110
- "description": ""
111
- },
112
- {
113
- "column_name": "logical_app",
114
- "type": "STRING",
115
- "label": "Product",
116
- "description": ""
117
- },
118
- {
119
- "column_name": "path",
120
- "type": "STRING",
121
- "label": "Path",
122
- "description": ""
123
- },
124
- {
125
- "column_name": "asset_type",
126
- "type": "STRING",
127
- "label": "Type",
128
- "description": ""
129
- },
130
- {
131
- "column_name": "logical_app_version",
132
- "type": "STRING",
133
- "label": "Version",
134
- "description": ""
135
- },
136
- {
137
- "column_name": "parent_id",
138
- "type": "LONGINTEGER",
139
- "label": "Parent Id",
140
- "description": ""
141
- },
142
- {
143
- "column_name": "child_id",
144
- "type": "LONGINTEGER",
145
- "label": "Child Id",
146
- "description": ""
147
- },
148
- {
149
- "column_name": "version_id",
150
- "type": "LONGINTEGER",
151
- "label": "Version Id",
152
- "description": ""
153
- },
154
- {
155
- "column_name": "teamId",
156
- "type": "INTEGER",
157
- "label": "Teamid",
158
- "description": ""
159
- }
160
- ]
161
- },
162
- "query_policy_results": {
163
- "columns": [
164
- {
165
- "column_name": "is_latest_logical_version",
166
- "type": "BOOLEAN",
167
- "label": "Latest Product Version",
168
- "description": ""
169
- },
170
- {
171
- "column_name": "asset",
172
- "type": "STRING",
173
- "label": "Asset (Type)",
174
- "description": ""
175
- },
176
- {
177
- "column_name": "control_name",
178
- "type": "STRING",
179
- "label": "Policy Control",
180
- "description": ""
181
- },
182
- {
183
- "column_name": "initiative_hash",
184
- "type": "STRING",
185
- "label": "Initiative Hash",
186
- "description": ""
187
- },
188
- {
189
- "column_name": "initiative_name",
190
- "type": "STRING",
191
- "label": "Policy Initiative",
192
- "description": ""
193
- },
194
- {
195
- "column_name": "rule_name",
196
- "type": "STRING",
197
- "label": "Policy Rule",
198
- "description": ""
199
- },
200
- {
201
- "column_name": "time_evaluated",
202
- "type": "DATETIMETZ",
203
- "label": "Time",
204
- "description": ""
205
- },
206
- {
207
- "column_name": "date",
208
- "type": "DATE",
209
- "label": "Evaluated",
210
- "description": ""
211
- },
212
- {
213
- "column_name": "count",
214
- "type": "LONGINTEGER",
215
- "label": "Count",
216
- "description": ""
217
- },
218
- {
219
- "column_name": "message",
220
- "type": "STRING",
221
- "label": "Message",
222
- "description": ""
223
- },
224
- {
225
- "column_name": "logical_app",
226
- "type": "STRING",
227
- "label": "Product",
228
- "description": ""
229
- },
230
- {
231
- "column_name": "logical_app_version",
232
- "type": "STRING",
233
- "label": "Version",
234
- "description": ""
235
- },
236
- {
237
- "column_name": "formatted_msg",
238
- "type": "STRING",
239
- "label": "Formatted Msg",
240
- "description": ""
241
- },
242
- {
243
- "column_name": "more_json",
244
- "type": "JSONB",
245
- "label": "More Json",
246
- "description": ""
247
- },
248
- {
249
- "column_name": "evaluations",
250
- "type": "JSONB",
251
- "label": "Evaluations",
252
- "description": ""
253
- },
254
- {
255
- "column_name": "teamId",
256
- "type": "LONGINTEGER",
257
- "label": "Teamid",
258
- "description": ""
259
- },
260
- {
261
- "column_name": "product_id",
262
- "type": "LONGINTEGER",
263
- "label": "Product Id",
264
- "description": ""
265
- },
266
- {
267
- "column_name": "version_id",
268
- "type": "LONGINTEGER",
269
- "label": "Version Id",
270
- "description": ""
271
- },
272
- {
273
- "column_name": "asset_name",
274
- "type": "STRING",
275
- "label": "Asset Name",
276
- "description": ""
277
- },
278
- {
279
- "column_name": "asset_id",
280
- "type": "STRING",
281
- "label": "Asset Id",
282
- "description": ""
283
- },
284
- {
285
- "column_name": "gate_type",
286
- "type": "STRING",
287
- "label": "Gate Type",
288
- "description": ""
289
- },
290
- {
291
- "column_name": "asset_type",
292
- "type": "STRING",
293
- "label": "Asset Type",
294
- "description": ""
295
- },
296
- {
297
- "column_name": "rule_id",
298
- "type": "STRING",
299
- "label": "Rule Id",
300
- "description": ""
301
- },
302
- {
303
- "column_name": "status",
304
- "type": "STRING",
305
- "label": "Status",
306
- "description": ""
307
- },
308
- {
309
- "column_name": "status_icon",
310
- "type": "",
311
- "label": "Status",
312
- "description": ""
313
- },
314
- {
315
- "column_name": "details",
316
- "type": "",
317
- "label": "Details",
318
- "description": ""
319
- },
320
- {
321
- "column_name": "gate",
322
- "type": "STRING",
323
- "label": "Gate (Type)",
324
- "description": ""
325
- },
326
- {
327
- "column_name": "gate_name",
328
- "type": "STRING",
329
- "label": "Gate Name",
330
- "description": ""
331
- }
332
- ]
333
- },
334
- "query_products": {
335
- "columns": [
336
- {
337
- "column_name": "logical_app",
338
- "type": "STRING",
339
- "label": "Product",
340
- "description": ""
341
- },
342
- {
343
- "column_name": "base_layer",
344
- "type": "BOOLEAN",
345
- "label": "Base Image",
346
- "description": "is dependency coming from a an image layer that is a known base layer"
347
- },
348
- {
349
- "column_name": "component_publisher",
350
- "type": "STRING",
351
- "label": "Component Publisher",
352
- "description": ""
353
- },
354
- {
355
- "column_name": "component_description",
356
- "type": "STRING",
357
- "label": "Component Description",
358
- "description": ""
359
- },
360
- {
361
- "column_name": "tools",
362
- "type": "STRING",
363
- "label": "Tools",
364
- "description": ""
365
- },
366
- {
367
- "column_name": "licenses",
368
- "type": "STRING",
369
- "label": "Licenses",
370
- "description": ""
371
- },
372
- {
373
- "column_name": "latest_version",
374
- "type": "STRING",
375
- "label": "Dep latest ver",
376
- "description": ""
377
- },
378
- {
379
- "column_name": "high_severity_cves",
380
- "type": "INTEGER",
381
- "label": "C+H Vulns",
382
- "description": ""
383
- },
384
- {
385
- "column_name": "license_is_permissive",
386
- "type": "BOOLEAN",
387
- "label": "Is permissive",
388
- "description": ""
389
- },
390
- {
391
- "column_name": "scorecard_score",
392
- "type": "FLOAT",
393
- "label": "OpenSSF score",
394
- "description": ""
395
- },
396
- {
397
- "column_name": "targets",
398
- "type": "STRING",
399
- "label": "SBOM Type",
400
- "description": ""
401
- },
402
- {
403
- "column_name": "component_type",
404
- "type": "STRING",
405
- "label": "Component type",
406
- "description": ""
407
- },
408
- {
409
- "column_name": "tag",
410
- "type": "STRING",
411
- "label": "Component version",
412
- "description": ""
413
- },
414
- {
415
- "column_name": "component_version",
416
- "type": "STRING",
417
- "label": "Dep version",
418
- "description": ""
419
- },
420
- {
421
- "column_name": "maintenance_score_int",
422
- "type": "INTEGER",
423
- "label": "Maintenance Score",
424
- "description": ""
425
- },
426
- {
427
- "column_name": "license_expression",
428
- "type": "STRING",
429
- "label": "Licesne expression",
430
- "description": ""
431
- },
432
- {
433
- "column_name": "pkg",
434
- "type": "STRING",
435
- "label": "Package Manager",
436
- "description": ""
437
- },
438
- {
439
- "column_name": "rstatus",
440
- "type": "STRING",
441
- "label": "Version Status",
442
- "description": ""
443
- },
444
- {
445
- "column_name": "version_is_up_to_date",
446
- "type": "BOOLEAN",
447
- "label": "Up-to-date",
448
- "description": ""
449
- },
450
- {
451
- "column_name": "maintenance_score",
452
- "type": "STRING",
453
- "label": "--",
454
- "description": ""
455
- },
456
- {
457
- "column_name": "component_dependency_type",
458
- "type": "STRINGARRAY",
459
- "label": "Component Dependency Type",
460
- "description": ""
461
- },
462
- {
463
- "column_name": "targetName",
464
- "type": "STRING",
465
- "label": "Component",
466
- "description": ""
467
- },
468
- {
469
- "column_name": "labels",
470
- "type": "STRING",
471
- "label": "Labels",
472
- "description": ""
473
- },
474
- {
475
- "column_name": "component_purl",
476
- "type": "STRING",
477
- "label": "PURL",
478
- "description": ""
479
- },
480
- {
481
- "column_name": "source_layer",
482
- "type": "STRING",
483
- "label": "Layer",
484
- "description": ""
485
- },
486
- {
487
- "column_name": "logical_app_version",
488
- "type": "STRING",
489
- "label": "Version",
490
- "description": ""
491
- },
492
- {
493
- "column_name": "component_name",
494
- "type": "STRING",
495
- "label": "Component Name",
496
- "description": ""
497
- },
498
- {
499
- "column_name": "component_group",
500
- "type": "STRING",
501
- "label": "Component Group",
502
- "description": ""
503
- },
504
- {
505
- "column_name": "attestation_ids",
506
- "type": "LONGINTEGERARRAY",
507
- "label": "Attestation Ids",
508
- "description": ""
509
- },
510
- {
511
- "column_name": "dependency_parents",
512
- "type": "STRINGARRAY",
513
- "label": "Dependency Parents",
514
- "description": ""
515
- },
516
- {
517
- "column_name": "dependency_children",
518
- "type": "STRINGARRAY",
519
- "label": "Dependency Children",
520
- "description": ""
521
- },
522
- {
523
- "column_name": "license_is_permissive_na",
524
- "type": "BOOLEAN",
525
- "label": "License Is Permissive Na",
526
- "description": ""
527
- },
528
- {
529
- "column_name": "version_timestamp",
530
- "type": "DATETIMETZ",
531
- "label": "Version Timestamp",
532
- "description": ""
533
- },
534
- {
535
- "column_name": "component_locations",
536
- "type": "JSONB",
537
- "label": "Component Locations",
538
- "description": ""
539
- },
540
- {
541
- "column_name": "scorecard_id",
542
- "type": "LONGINTEGER",
543
- "label": "Scorecard Id",
544
- "description": ""
545
- },
546
- {
547
- "column_name": "attestation_ids_cnt",
548
- "type": "INTEGER",
549
- "label": "Attestation Ids Cnt",
550
- "description": ""
551
- },
552
- {
553
- "column_name": "teamId",
554
- "type": "LONGINTEGER",
555
- "label": "Teamid",
556
- "description": ""
557
- },
558
- {
559
- "column_name": "pipeline_run_id",
560
- "type": "LONGINTEGER",
561
- "label": "Pipeline Run Id",
562
- "description": ""
563
- },
564
- {
565
- "column_name": "product_id",
566
- "type": "LONGINTEGER",
567
- "label": "Product Id",
568
- "description": ""
569
- },
570
- {
571
- "column_name": "component_id",
572
- "type": "LONGINTEGER",
573
- "label": "Component Id",
574
- "description": ""
575
- },
576
- {
577
- "column_name": "id",
578
- "type": "LONGINTEGER",
579
- "label": "Id",
580
- "description": ""
581
- },
582
- {
583
- "column_name": "component_external_ref",
584
- "type": "STRING",
585
- "label": "Component External Ref",
586
- "description": ""
587
- },
588
- {
589
- "column_name": "license_expression_na",
590
- "type": "STRING",
591
- "label": "License Expression Na",
592
- "description": ""
593
- },
594
- {
595
- "column_name": "attestation_name",
596
- "type": "STRING",
597
- "label": "Attestation Name",
598
- "description": ""
599
- },
600
- {
601
- "column_name": "component_author",
602
- "type": "STRING",
603
- "label": "Component Author",
604
- "description": ""
605
- },
606
- {
607
- "column_name": "more",
608
- "type": "",
609
- "label": " ",
610
- "description": ""
611
- },
612
- {
613
- "column_name": "block",
614
- "type": "",
615
- "label": "Dependency",
616
- "description": ""
617
- },
618
- {
619
- "column_name": "relation",
620
- "type": "",
621
- "label": "Relation",
622
- "description": ""
623
- },
624
- {
625
- "column_name": "targets_translated",
626
- "type": "",
627
- "label": "SBOM Type Translated",
628
- "description": ""
629
- },
630
- {
631
- "column_name": "main_tool",
632
- "type": "",
633
- "label": "Main Tool",
634
- "description": ""
635
- }
636
- ]
637
- },
638
- "query_risk": {
639
- "columns": [
640
- {
641
- "column_name": "totals_badge",
642
- "type": "STRING",
643
- "label": "Totals",
644
- "description": ""
645
- },
646
- {
647
- "column_name": "logical_app_badges",
648
- "type": "STRING",
649
- "label": "Info",
650
- "description": ""
651
- },
652
- {
653
- "column_name": "target_badges",
654
- "type": "STRING",
655
- "label": "Info",
656
- "description": ""
657
- },
658
- {
659
- "column_name": "cve_badges",
660
- "type": "STRING",
661
- "label": "Info",
662
- "description": ""
663
- },
664
- {
665
- "column_name": "logical_app",
666
- "type": "STRING",
667
- "label": "Product",
668
- "description": "Name of Product in ScribeHub. A product is made of components (e.g. a few docker images)"
669
- },
670
- {
671
- "column_name": "has_fix",
672
- "type": "BOOLEAN",
673
- "label": "Has Fix",
674
- "description": "True if there is a fix for this vulnerability (usually an udate for the vulnerable dependency)"
675
- },
676
- {
677
- "column_name": "weighted_cve_risk",
678
- "type": "DECIMAL",
679
- "label": "Weighted Cve Risk",
680
- "description": "Risk imposed by the CVE, taking into account weights (business criticality, public facing, publicly available)"
681
- },
682
- {
683
- "column_name": "total_cves_in_base_image",
684
- "type": "DECIMAL",
685
- "label": "Total Cves In Base Image",
686
- "description": "Total number of CVEs that are in a base image, across the team"
687
- },
688
- {
689
- "column_name": "in_base_image",
690
- "type": "BOOLEAN",
691
- "label": "In Base Image",
692
- "description": "True if the vulnerability is in the base layer of a Docker image"
693
- },
694
- {
695
- "column_name": "total_fixables",
696
- "type": "DECIMAL",
697
- "label": "Total Fixables",
698
- "description": "Total number of CVEs with a fix in the team"
699
- },
700
- {
701
- "column_name": "weight",
702
- "type": "FLOAT",
703
- "label": "Weight",
704
- "description": "the is the accumulated weight for this Componen (Target)"
705
- },
706
- {
707
- "column_name": "has_kev",
708
- "type": "BOOLEAN",
709
- "label": "Has Kev",
710
- "description": "True if this CVE is a Known Exploitable Vulnerability"
711
- },
712
- {
713
- "column_name": "target_risk",
714
- "type": "DECIMAL",
715
- "label": "Component Risk",
716
- "description": "Total risk for this component of the product"
717
- },
718
- {
719
- "column_name": "logical_app_version_cves_in_base_image",
720
- "type": "DECIMAL",
721
- "label": "Logical App Version Cves In Base Image",
722
- "description": "Total CVEs in base image for this product version"
723
- },
724
- {
725
- "column_name": "total_risk",
726
- "type": "DECIMAL",
727
- "label": "Total Risk",
728
- "description": "Total risk for this team (across all product-versions)"
729
- },
730
- {
731
- "column_name": "total_exploitables",
732
- "type": "DECIMAL",
733
- "label": "Total Exploitables",
734
- "description": "Total number of exploitable CVEs in the team"
735
- },
736
- {
737
- "column_name": "target_fixables",
738
- "type": "LONGINTEGER",
739
- "label": "Target Fixables",
740
- "description": "Number of fixable risky CVEs of the component"
741
- },
742
- {
743
- "column_name": "target",
744
- "type": "STRING",
745
- "label": "Component",
746
- "description": "The component (usually a Docker image name:tag)"
747
- },
748
- {
749
- "column_name": "logical_app_version_risk",
750
- "type": "DECIMAL",
751
- "label": "Product Risk",
752
- "description": "Total risk for this Product Version"
753
- },
754
- {
755
- "column_name": "logical_app_version_fixables",
756
- "type": "DECIMAL",
757
- "label": "Logical App Version Fixables",
758
- "description": "Number of Fixable CVEs in the product-version"
759
- },
760
- {
761
- "column_name": "logical_app_version_exploitables",
762
- "type": "DECIMAL",
763
- "label": "Logical App Version Exploitables",
764
- "description": "Number of exploitable CVEs in the Product-Version"
765
- },
766
- {
767
- "column_name": "target_cves_in_base_image",
768
- "type": "LONGINTEGER",
769
- "label": "Target Cves In Base Image",
770
- "description": "Number of CVEs in Component Base Image"
771
- },
772
- {
773
- "column_name": "target_exploitables",
774
- "type": "LONGINTEGER",
775
- "label": "Target Exploitables",
776
- "description": "Number of Exploitable CVEs in the component"
777
- },
778
- {
779
- "column_name": "vulnerability_id",
780
- "type": "STRING",
781
- "label": "CVE ID",
782
- "description": "CVE ID for this line"
783
- },
784
- {
785
- "column_name": "num_targets",
786
- "type": "LONGINTEGER",
787
- "label": "Num Targets",
788
- "description": "Number of Components in the Product"
789
- },
790
- {
791
- "column_name": "teamId",
792
- "type": "LONGINTEGER",
793
- "label": "Teamid",
794
- "description": "ID of the team within Scribe"
795
- },
796
- {
797
- "column_name": "logical_app_version",
798
- "type": "STRING",
799
- "label": "Version",
800
- "description": "Version of Product in ScribeHub"
801
- },
802
- {
803
- "column_name": "total_completion",
804
- "type": "",
805
- "label": "Safe",
806
- "description": ""
807
- }
808
- ]
809
- },
810
- "query_vulnerabilities": {
811
- "columns": [
812
- {
813
- "column_name": "cwe_array",
814
- "type": "",
815
- "label": "CWEs",
816
- "description": ""
817
- },
818
- {
819
- "column_name": "dependency_analysis",
820
- "type": "JSONB",
821
- "label": "Dependency Analysis",
822
- "description": "Details on how the dependency was introduced: direct or transitive (dependent library of a library), through source (e.g. package.json) or image (e.g. Dockerfile)"
823
- },
824
- {
825
- "column_name": "advisory_link",
826
- "type": "",
827
- "label": "Advisory",
828
- "description": ""
829
- },
830
- {
831
- "column_name": "has_fix",
832
- "type": "BOOLEAN",
833
- "label": "Has Fix",
834
- "description": ""
835
- },
836
- {
837
- "column_name": "vul_component_fixed_in_versions",
838
- "type": "STRINGARRAY",
839
- "label": "Vulnerability Fix Version",
840
- "description": ""
841
- },
842
- {
843
- "column_name": "will_not_fix",
844
- "type": "BOOLEAN",
845
- "label": "Will Not Fix",
846
- "description": ""
847
- },
848
- {
849
- "column_name": "is_latest_logical_version",
850
- "type": "BOOLEAN",
851
- "label": "Latest product version",
852
- "description": ""
853
- },
854
- {
855
- "column_name": "vul_date_changed",
856
- "type": "DATETIMETZ",
857
- "label": "Vulnerability Last Change",
858
- "description": ""
859
- },
860
- {
861
- "column_name": "latest_package_version",
862
- "type": "STRING",
863
- "label": "Dependency Latest Version",
864
- "description": ""
865
- },
866
- {
867
- "column_name": "attestation_ids",
868
- "type": "LONGINTEGERARRAY",
869
- "label": "Attestation IDs",
870
- "description": ""
871
- },
872
- {
873
- "column_name": "cpes",
874
- "type": "STRINGARRAY",
875
- "label": "Dependency CPEs",
876
- "description": ""
877
- },
878
- {
879
- "column_name": "advisory_modified",
880
- "type": "DATETIMETZ",
881
- "label": "Advisory Modified",
882
- "description": ""
883
- },
884
- {
885
- "column_name": "hyper_links",
886
- "type": "STRINGARRAY",
887
- "label": "Hyper Links",
888
- "description": ""
889
- },
890
- {
891
- "column_name": "has_kev",
892
- "type": "BOOLEAN",
893
- "label": "Has KEV",
894
- "description": ""
895
- },
896
- {
897
- "column_name": "base_score",
898
- "type": "FLOAT",
899
- "label": "Base Score",
900
- "description": ""
901
- },
902
- {
903
- "column_name": "vul_component_created",
904
- "type": "DATETIMETZ",
905
- "label": "Dependency Date",
906
- "description": ""
907
- },
908
- {
909
- "column_name": "version_timestamp",
910
- "type": "DATETIMETZ",
911
- "label": "Version Timestamp",
912
- "description": ""
913
- },
914
- {
915
- "column_name": "advisory_justification",
916
- "type": "STRING",
917
- "label": "Advisory Justification",
918
- "description": ""
919
- },
920
- {
921
- "column_name": "attestation_name",
922
- "type": "STRING",
923
- "label": "Attestation Name",
924
- "description": ""
925
- },
926
- {
927
- "column_name": "advisory_status",
928
- "type": "STRING",
929
- "label": "Advisory Status",
930
- "description": ""
931
- },
932
- {
933
- "column_name": "advisory_text",
934
- "type": "STRING",
935
- "label": "Advisory Text",
936
- "description": ""
937
- },
938
- {
939
- "column_name": "tag",
940
- "type": "STRING",
941
- "label": "Component Version",
942
- "description": ""
943
- },
944
- {
945
- "column_name": "component_id",
946
- "type": "LONGINTEGER",
947
- "label": "Dependency ID",
948
- "description": ""
949
- },
950
- {
951
- "column_name": "component_purl",
952
- "type": "STRING",
953
- "label": "Dependency PURL",
954
- "description": ""
955
- },
956
- {
957
- "column_name": "component_locations",
958
- "type": "STRING",
959
- "label": "Dependency Locations",
960
- "description": ""
961
- },
962
- {
963
- "column_name": "component_version",
964
- "type": "STRING",
965
- "label": "Dependency Version",
966
- "description": ""
967
- },
968
- {
969
- "column_name": "final_severity",
970
- "type": "INTEGER",
971
- "label": "Final Severity",
972
- "description": ""
973
- },
974
- {
975
- "column_name": "severity",
976
- "type": "INTEGER",
977
- "label": "Original Severity",
978
- "description": ""
979
- },
980
- {
981
- "column_name": "main_tool",
982
- "type": "STRING",
983
- "label": "Main Tool",
984
- "description": ""
985
- },
986
- {
987
- "column_name": "cvss_score",
988
- "type": "FLOAT",
989
- "label": "CVSS",
990
- "description": ""
991
- },
992
- {
993
- "column_name": "vul_published_on",
994
- "type": "DATETIMETZ",
995
- "label": "Published",
996
- "description": ""
997
- },
998
- {
999
- "column_name": "epssProbability",
1000
- "type": "FLOAT",
1001
- "label": "EPSS",
1002
- "description": ""
1003
- },
1004
- {
1005
- "column_name": "cwes",
1006
- "type": "JSONB",
1007
- "label": "CWE_Object",
1008
- "description": ""
1009
- },
1010
- {
1011
- "column_name": "vendor",
1012
- "type": "JSONB",
1013
- "label": "Vendor",
1014
- "description": ""
1015
- },
1016
- {
1017
- "column_name": "targetName",
1018
- "type": "STRING",
1019
- "label": "Component",
1020
- "description": ""
1021
- },
1022
- {
1023
- "column_name": "vulnerability_id",
1024
- "type": "STRING",
1025
- "label": "ID",
1026
- "description": ""
1027
- },
1028
- {
1029
- "column_name": "component_name",
1030
- "type": "STRING",
1031
- "label": "Dependency",
1032
- "description": ""
1033
- },
1034
- {
1035
- "column_name": "product_id",
1036
- "type": "LONGINTEGER",
1037
- "label": "Product Id",
1038
- "description": ""
1039
- },
1040
- {
1041
- "column_name": "source_layer",
1042
- "type": "STRING",
1043
- "label": "Layer",
1044
- "description": ""
1045
- },
1046
- {
1047
- "column_name": "labels",
1048
- "type": "STRING",
1049
- "label": "Labels",
1050
- "description": ""
1051
- },
1052
- {
1053
- "column_name": "logical_app",
1054
- "type": "STRING",
1055
- "label": "Product",
1056
- "description": ""
1057
- },
1058
- {
1059
- "column_name": "vul_hyperlinks",
1060
- "type": "STRING",
1061
- "label": "References",
1062
- "description": ""
1063
- },
1064
- {
1065
- "column_name": "vul_source",
1066
- "type": "STRING",
1067
- "label": "Source",
1068
- "description": ""
1069
- },
1070
- {
1071
- "column_name": "targets",
1072
- "type": "STRING",
1073
- "label": "Targets",
1074
- "description": ""
1075
- },
1076
- {
1077
- "column_name": "text",
1078
- "type": "STRING",
1079
- "label": "Text",
1080
- "description": ""
1081
- },
1082
- {
1083
- "column_name": "tool",
1084
- "type": "STRING",
1085
- "label": "Tool",
1086
- "description": ""
1087
- },
1088
- {
1089
- "column_name": "logical_app_version",
1090
- "type": "STRING",
1091
- "label": "Version",
1092
- "description": ""
1093
- },
1094
- {
1095
- "column_name": "vector",
1096
- "type": "STRING",
1097
- "label": "Vector",
1098
- "description": ""
1099
- },
1100
- {
1101
- "column_name": "component_dependency_type",
1102
- "type": "STRINGARRAY",
1103
- "label": "Component Dependency Type",
1104
- "description": ""
1105
- },
1106
- {
1107
- "column_name": "update",
1108
- "type": "BOOLEAN",
1109
- "label": "Update",
1110
- "description": ""
1111
- },
1112
- {
1113
- "column_name": "epssScoreDate",
1114
- "type": "DATETIMETZ",
1115
- "label": "Epssscoredate",
1116
- "description": ""
1117
- },
1118
- {
1119
- "column_name": "epssPercentile",
1120
- "type": "FLOAT",
1121
- "label": "Epsspercentile",
1122
- "description": ""
1123
- },
1124
- {
1125
- "column_name": "teamId",
1126
- "type": "LONGINTEGER",
1127
- "label": "Teamid",
1128
- "description": ""
1129
- },
1130
- {
1131
- "column_name": "vul_adv_id",
1132
- "type": "LONGINTEGER",
1133
- "label": "Vul Adv Id",
1134
- "description": ""
1135
- },
1136
- {
1137
- "column_name": "pipeline_run_id",
1138
- "type": "LONGINTEGER",
1139
- "label": "Pipeline Run Id",
1140
- "description": ""
1141
- },
1142
- {
1143
- "column_name": "id",
1144
- "type": "LONGINTEGER",
1145
- "label": "Id",
1146
- "description": ""
1147
- },
1148
- {
1149
- "column_name": "base_severity_string",
1150
- "type": "STRING",
1151
- "label": "Base Severity String",
1152
- "description": ""
1153
- },
1154
- {
1155
- "column_name": "severity_string",
1156
- "type": "STRING",
1157
- "label": "Severity String",
1158
- "description": ""
1159
- },
1160
- {
1161
- "column_name": "pkg",
1162
- "type": "STRING",
1163
- "label": "Pkg",
1164
- "description": ""
1165
- }
1166
- ]
1167
- },
1168
- "query_findings": {
1169
- "columns": [
1170
- {
1171
- "column_name": "more",
1172
- "type": "",
1173
- "label": " ",
1174
- "description": ""
1175
- },
1176
- {
1177
- "column_name": "severity_order",
1178
- "type": "STRING",
1179
- "label": "Severity Order",
1180
- "description": ""
1181
- },
1182
- {
1183
- "column_name": "attack_vector",
1184
- "type": "",
1185
- "label": "Attack Vector",
1186
- "description": ""
1187
- },
1188
- {
1189
- "column_name": "availability_impact",
1190
- "type": "",
1191
- "label": "Availability Impact",
1192
- "description": ""
1193
- },
1194
- {
1195
- "column_name": "confidentiality_impact",
1196
- "type": "",
1197
- "label": "Confidentiality Impact",
1198
- "description": ""
1199
- },
1200
- {
1201
- "column_name": "integrity_impact",
1202
- "type": "",
1203
- "label": "Integrity Impact",
1204
- "description": ""
1205
- },
1206
- {
1207
- "column_name": "Severity",
1208
- "type": "",
1209
- "label": "Severity",
1210
- "description": ""
1211
- },
1212
- {
1213
- "column_name": "attack_complexity",
1214
- "type": "",
1215
- "label": "Attack Complexity",
1216
- "description": ""
1217
- },
1218
- {
1219
- "column_name": "attestation_id",
1220
- "type": "LONGINTEGER",
1221
- "label": "Evidence ID",
1222
- "description": ""
1223
- },
1224
- {
1225
- "column_name": "cvssv3",
1226
- "type": "STRING",
1227
- "label": "CVSSv3",
1228
- "description": ""
1229
- },
1230
- {
1231
- "column_name": "created",
1232
- "type": "DATETIMETZ",
1233
- "label": "Created",
1234
- "description": ""
1235
- },
1236
- {
1237
- "column_name": "cwe_id",
1238
- "type": "STRING",
1239
- "label": "CWE",
1240
- "description": ""
1241
- },
1242
- {
1243
- "column_name": "targetName",
1244
- "type": "STRING",
1245
- "label": "Component",
1246
- "description": ""
1247
- },
1248
- {
1249
- "column_name": "id",
1250
- "type": "LONGINTEGER",
1251
- "label": "ID",
1252
- "description": ""
1253
- },
1254
- {
1255
- "column_name": "component_name",
1256
- "type": "STRING",
1257
- "label": "Dependency",
1258
- "description": ""
1259
- },
1260
- {
1261
- "column_name": "description",
1262
- "type": "STRING",
1263
- "label": "Description",
1264
- "description": ""
1265
- },
1266
- {
1267
- "column_name": "line",
1268
- "type": "INTEGER",
1269
- "label": "Line",
1270
- "description": ""
1271
- },
1272
- {
1273
- "column_name": "severity",
1274
- "type": "INTEGER",
1275
- "label": "Severity",
1276
- "description": ""
1277
- },
1278
- {
1279
- "column_name": "parser",
1280
- "type": "STRING",
1281
- "label": "Parser",
1282
- "description": ""
1283
- },
1284
- {
1285
- "column_name": "logical_app",
1286
- "type": "STRING",
1287
- "label": "Product",
1288
- "description": ""
1289
- },
1290
- {
1291
- "column_name": "file_path",
1292
- "type": "STRING",
1293
- "label": "Path",
1294
- "description": ""
1295
- },
1296
- {
1297
- "column_name": "severity_string",
1298
- "type": "STRING",
1299
- "label": "Severity",
1300
- "description": ""
1301
- },
1302
- {
1303
- "column_name": "main_tool",
1304
- "type": "STRING",
1305
- "label": "Tool",
1306
- "description": ""
1307
- },
1308
- {
1309
- "column_name": "title",
1310
- "type": "STRING",
1311
- "label": "Title",
1312
- "description": ""
1313
- },
1314
- {
1315
- "column_name": "logical_app_version",
1316
- "type": "STRING",
1317
- "label": "Version",
1318
- "description": ""
1319
- },
1320
- {
1321
- "column_name": "finding",
1322
- "type": "JSONB",
1323
- "label": "Finding",
1324
- "description": ""
1325
- },
1326
- {
1327
- "column_name": "context",
1328
- "type": "JSONB",
1329
- "label": "Context",
1330
- "description": ""
1331
- },
1332
- {
1333
- "column_name": "teamId",
1334
- "type": "LONGINTEGER",
1335
- "label": "Teamid",
1336
- "description": ""
1337
- },
1338
- {
1339
- "column_name": "original_attestation_id",
1340
- "type": "LONGINTEGER",
1341
- "label": "Original Attestation Id",
1342
- "description": ""
1343
- },
1344
- {
1345
- "column_name": "product_id",
1346
- "type": "LONGINTEGER",
1347
- "label": "Product Id",
1348
- "description": ""
1349
- },
1350
- {
1351
- "column_name": "pipeline_id",
1352
- "type": "LONGINTEGER",
1353
- "label": "Pipeline Id",
1354
- "description": ""
1355
- }
1356
- ]
1357
- }
1358
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mcp_app/toolsDescriptions/tool_docs.json DELETED
@@ -1,3312 +0,0 @@
1
- {
2
- "query_lineage": [
3
- {
4
- "name": "query_lineage"
5
- },
6
- {
7
- "description": "To answer software-factory related questions such as: What repos (or code repositories) are related/part of a product? or What are all the software-factory related components of a product (in this case query for asset_type and asset_name for the logical_app and logical_app_version)?"
8
- },
9
- {
10
- "params": {
11
- "input_parameters": [
12
- {
13
- "name": "question",
14
- "type": "string",
15
- "description": "Human readable question about information in teh company database",
16
- "required": true
17
- }
18
- ],
19
- "output_schema": {
20
- "type": "object",
21
- "properties": {
22
- "columns": {
23
- "type": "array",
24
- "items": {
25
- "type": "string"
26
- },
27
- "description": "Only include necessary columns. Each column must match the columnTable documentation. DO NOT invent columns."
28
- },
29
- "filters": {
30
- "type": "array",
31
- "items": {
32
- "type": "object",
33
- "properties": {
34
- "col": {
35
- "type": "string"
36
- },
37
- "op": {
38
- "type": "string"
39
- },
40
- "val": {}
41
- },
42
- "required": [
43
- "col",
44
- "op",
45
- "val"
46
- ]
47
- },
48
- "description": "Use operators: ==, !=, >, <, >=, <=, in, not in, is null, is not null. Use 'extras' key for like/ilike."
49
- },
50
- "metrics": {
51
- "type": "array",
52
- "minItems": 0,
53
- "items": {
54
- "type": "object",
55
- "properties": {
56
- "label": {
57
- "type": "string",
58
- "description": "Name of the output column for the metric"
59
- },
60
- "expressionType": {
61
- "type": "string",
62
- "enum": [
63
- "SQL",
64
- "SIMPLE"
65
- ],
66
- "description": "Type of expression used. Typically 'SQL'."
67
- },
68
- "sqlExpression": {
69
- "type": "string",
70
- "description": "SQL expression to calculate the metric, such as 'COUNT(*)' or 'AVG(score)'"
71
- }
72
- },
73
- "required": [
74
- "label",
75
- "expressionType",
76
- "sqlExpression"
77
- ]
78
- },
79
- "description": "Either an empty array, or an array of expression objects with 'label', 'expressionType', and 'sqlExpression'."
80
- },
81
- "orderby": {
82
- "type": "array",
83
- "minItems": 0,
84
- "items": {
85
- "type": "array",
86
- "items": [
87
- {
88
- "type": "string",
89
- "description": "Column name"
90
- },
91
- {
92
- "type": "boolean",
93
- "description": "Column name. To sort in acending order use False and in decending order use True"
94
- }
95
- ],
96
- "minItems": 2,
97
- "maxItems": 2
98
- },
99
- "description": "Either an empty array, or a list of [column_name, is_ascending] pairs. Column must be in 'columns'."
100
- },
101
- "groupby": {
102
- "type": "array",
103
- "description": "Optional list of column names to group results by. Grouping is used to aggregate rows that share the same values in the specified columns, often used in combination with metrics.",
104
- "minItems": 0,
105
- "items": {
106
- "type": "string",
107
- "description": "A column name to group by, should be one or more of the\u00df columns used in the columns item"
108
- }
109
- },
110
- "row_limit": {
111
- "type": "integer",
112
- "default": 10,
113
- "description": "Default: 10, max: 30."
114
- }
115
- },
116
- "required": [
117
- "columns",
118
- "filters",
119
- "metrics",
120
- "orderby",
121
- "grouby",
122
- "row_limit"
123
- ]
124
- },
125
- "example": {
126
- "input": "Human readable question",
127
- "output": {
128
- "columns": [
129
- "column_name1",
130
- "column_name2"
131
- ],
132
- "filters": [
133
- {
134
- "col": "column_name",
135
- "op": "operator",
136
- "val": "value"
137
- }
138
- ],
139
- "metrics": [
140
- {
141
- "label": "column_name",
142
- "expressionType": "expression",
143
- "sqlExpression": "SQL expression to calculate the metric"
144
- }
145
- ],
146
- "orderby": [
147
- [
148
- "column_name",
149
- "(true) or (false)"
150
- ]
151
- ],
152
- "row_limit": 10
153
- }
154
- }
155
- }
156
- },
157
- {
158
- "examples": [
159
- {
160
- "input": "Which platforms host the most assets?",
161
- "output": {
162
- "columns": [
163
- "platform_name"
164
- ],
165
- "metrics": [
166
- {
167
- "label": "asset_count",
168
- "expressionType": "SQL",
169
- "sqlExpression": "COUNT(*)"
170
- }
171
- ],
172
- "groupby": [
173
- "platform_name"
174
- ],
175
- "orderby": [
176
- [
177
- "asset_count",
178
- false
179
- ]
180
- ],
181
- "row_limit": 50
182
- }
183
- },
184
- {
185
- "input": "What are the organizations in my products and components?",
186
- "output": {
187
- "columns": [
188
- "asset_type",
189
- "asset_name"
190
- ],
191
- "filters": [
192
- {
193
- "col": "asset_type",
194
- "op": "==",
195
- "val": "organization"
196
- }
197
- ],
198
- "metrics": [],
199
- "orderby": [
200
- [
201
- "asset_name",
202
- true
203
- ]
204
- ],
205
- "row_limit": 30
206
- }
207
- },
208
- {
209
- "input": "What are the assets of a product?",
210
- "output": {
211
- "columns": [
212
- "asset_name ",
213
- "asset_type"
214
- ],
215
- "filters": [
216
- {
217
- "col": "logical_app",
218
- "op": "==",
219
- "val": "Hello_World_Github"
220
- }
221
- ],
222
- "groupby": [],
223
- "metrics": [],
224
- "orderby": [
225
- [
226
- "asset_type",
227
- true
228
- ],
229
- [
230
- "asset_name",
231
- true
232
- ]
233
- ],
234
- "row_limit": 50
235
- }
236
- },
237
- {
238
- "input": "What are the repositories in my products and components?",
239
- "output": {
240
- "columns": [
241
- "asset_type",
242
- "asset_name"
243
- ],
244
- "filters": [
245
- {
246
- "col": "asset_type",
247
- "op": "==",
248
- "val": "repo"
249
- }
250
- ],
251
- "metrics": [],
252
- "orderby": [
253
- [
254
- "asset_name",
255
- true
256
- ]
257
- ],
258
- "row_limit": 30
259
- }
260
- },
261
- {
262
- "input": "What are the most common types of assets recorded?",
263
- "output": {
264
- "columns": [
265
- "asset_type"
266
- ],
267
- "metrics": [
268
- {
269
- "label": "asset_count",
270
- "expressionType": "SQL",
271
- "sqlExpression": "COUNT(*)"
272
- }
273
- ],
274
- "groupby": [
275
- "asset_type"
276
- ],
277
- "orderby": [
278
- [
279
- "asset_count",
280
- false
281
- ]
282
- ],
283
- "row_limit": 50
284
- }
285
- }
286
- ]
287
- },
288
- {
289
- "ColumnTables": {
290
- "columns": [
291
- {
292
- "column_name": "prent_bloack",
293
- "type": "",
294
- "label": "Parent",
295
- "description": ""
296
- },
297
- {
298
- "column_name": "more",
299
- "type": "",
300
- "label": " More",
301
- "description": ""
302
- },
303
- {
304
- "column_name": "asset_block",
305
- "type": "",
306
- "label": "Asset",
307
- "description": ""
308
- },
309
- {
310
- "column_name": "g-source",
311
- "type": "STRING",
312
- "label": "G-Source",
313
- "description": ""
314
- },
315
- {
316
- "column_name": "g-target",
317
- "type": "STRING",
318
- "label": "G-Target",
319
- "description": ""
320
- },
321
- {
322
- "column_name": "tooltip",
323
- "type": "STRING",
324
- "label": "Tooltip",
325
- "description": ""
326
- },
327
- {
328
- "column_name": "parent_external_id",
329
- "type": "STRING",
330
- "label": "Parent External ID",
331
- "description": ""
332
- },
333
- {
334
- "column_name": "product_id",
335
- "type": "LONGINTEGER",
336
- "label": "Product ID",
337
- "description": ""
338
- },
339
- {
340
- "column_name": "external_id",
341
- "type": "STRING",
342
- "label": "External ID",
343
- "description": ""
344
- },
345
- {
346
- "column_name": "parent_name",
347
- "type": "STRING",
348
- "label": "Parent Name",
349
- "description": ""
350
- },
351
- {
352
- "column_name": "parent_type",
353
- "type": "STRING",
354
- "label": "Parent Type",
355
- "description": ""
356
- },
357
- {
358
- "column_name": "platform_type",
359
- "type": "STRING",
360
- "label": "Platform Type",
361
- "description": ""
362
- },
363
- {
364
- "column_name": "timestamp",
365
- "type": "DATETIME",
366
- "label": "Updated",
367
- "description": ""
368
- },
369
- {
370
- "column_name": "asset_name",
371
- "type": "STRING",
372
- "label": "Asset",
373
- "description": ""
374
- },
375
- {
376
- "column_name": "properties",
377
- "type": "JSONB",
378
- "label": "Info",
379
- "description": ""
380
- },
381
- {
382
- "column_name": "uri",
383
- "type": "STRING",
384
- "label": "URI",
385
- "description": ""
386
- },
387
- {
388
- "column_name": "owner",
389
- "type": "STRING",
390
- "label": "Owner",
391
- "description": ""
392
- },
393
- {
394
- "column_name": "platform_name",
395
- "type": "STRING",
396
- "label": "Platform",
397
- "description": ""
398
- },
399
- {
400
- "column_name": "logical_app",
401
- "type": "STRING",
402
- "label": "Product",
403
- "description": ""
404
- },
405
- {
406
- "column_name": "path",
407
- "type": "STRING",
408
- "label": "Path",
409
- "description": ""
410
- },
411
- {
412
- "column_name": "asset_type",
413
- "type": "STRING",
414
- "label": "Type",
415
- "description": ""
416
- },
417
- {
418
- "column_name": "logical_app_version",
419
- "type": "STRING",
420
- "label": "Version",
421
- "description": ""
422
- },
423
- {
424
- "column_name": "parent_id",
425
- "type": "LONGINTEGER",
426
- "label": "Parent Id",
427
- "description": ""
428
- },
429
- {
430
- "column_name": "child_id",
431
- "type": "LONGINTEGER",
432
- "label": "Child Id",
433
- "description": ""
434
- },
435
- {
436
- "column_name": "version_id",
437
- "type": "LONGINTEGER",
438
- "label": "Version Id",
439
- "description": ""
440
- },
441
- {
442
- "column_name": "teamId",
443
- "type": "INTEGER",
444
- "label": "Teamid",
445
- "description": ""
446
- }
447
- ]
448
- }
449
- }
450
- ],
451
- "query_policy_results": [
452
- {
453
- "name": "query_policy_results"
454
- },
455
- {
456
- "description": "To answer questions about policy evaluations like: What are the policy rules used? or Which of my products has SSDF policy violations? or List policy violations for a product."
457
- },
458
- {
459
- "params": {
460
- "input_parameters": [
461
- {
462
- "name": "question",
463
- "type": "string",
464
- "description": "Human readable question about information in teh company database",
465
- "required": true
466
- }
467
- ],
468
- "output_schema": {
469
- "type": "object",
470
- "properties": {
471
- "columns": {
472
- "type": "array",
473
- "items": {
474
- "type": "string"
475
- },
476
- "description": "Only include necessary columns. Each column must match the columnTable documentation. DO NOT invent columns."
477
- },
478
- "filters": {
479
- "type": "array",
480
- "items": {
481
- "type": "object",
482
- "properties": {
483
- "col": {
484
- "type": "string"
485
- },
486
- "op": {
487
- "type": "string"
488
- },
489
- "val": {}
490
- },
491
- "required": [
492
- "col",
493
- "op",
494
- "val"
495
- ]
496
- },
497
- "description": "Use operators: ==, !=, >, <, >=, <=, in, not in, is null, is not null. Use 'extras' key for like/ilike."
498
- },
499
- "metrics": {
500
- "type": "array",
501
- "minItems": 0,
502
- "items": {
503
- "type": "object",
504
- "properties": {
505
- "label": {
506
- "type": "string",
507
- "description": "Name of the output column for the metric"
508
- },
509
- "expressionType": {
510
- "type": "string",
511
- "enum": [
512
- "SQL",
513
- "SIMPLE"
514
- ],
515
- "description": "Type of expression used. Typically 'SQL'."
516
- },
517
- "sqlExpression": {
518
- "type": "string",
519
- "description": "SQL expression to calculate the metric, such as 'COUNT(*)' or 'AVG(score)'"
520
- }
521
- },
522
- "required": [
523
- "label",
524
- "expressionType",
525
- "sqlExpression"
526
- ]
527
- },
528
- "description": "Either an empty array, or an array of expression objects with 'label', 'expressionType', and 'sqlExpression'."
529
- },
530
- "orderby": {
531
- "type": "array",
532
- "minItems": 0,
533
- "items": {
534
- "type": "array",
535
- "items": [
536
- {
537
- "type": "string",
538
- "description": "Column name"
539
- },
540
- {
541
- "type": "boolean",
542
- "description": "Column name. To sort in acending order use False and in decending order use True"
543
- }
544
- ],
545
- "minItems": 2,
546
- "maxItems": 2
547
- },
548
- "description": "Either an empty array, or a list of [column_name, is_ascending] pairs. Column must be in 'columns'."
549
- },
550
- "groupby": {
551
- "type": "array",
552
- "description": "Optional list of column names to group results by. Grouping is used to aggregate rows that share the same values in the specified columns, often used in combination with metrics.",
553
- "minItems": 0,
554
- "items": {
555
- "type": "string",
556
- "description": "A column name to group by, should be one or more of the\u00df columns used in the columns item"
557
- }
558
- },
559
- "row_limit": {
560
- "type": "integer",
561
- "default": 10,
562
- "description": "Default: 10, max: 30."
563
- }
564
- },
565
- "required": [
566
- "columns",
567
- "filters",
568
- "metrics",
569
- "orderby",
570
- "grouby",
571
- "row_limit"
572
- ]
573
- },
574
- "example": {
575
- "input": "Human readable question",
576
- "output": {
577
- "columns": [
578
- "column_name1",
579
- "column_name2"
580
- ],
581
- "filters": [
582
- {
583
- "col": "column_name",
584
- "op": "operator",
585
- "val": "value"
586
- }
587
- ],
588
- "metrics": [
589
- {
590
- "label": "column_name",
591
- "expressionType": "expression",
592
- "sqlExpression": "SQL expression to calculate the metric"
593
- }
594
- ],
595
- "orderby": [
596
- [
597
- "column_name",
598
- "(true) or (false)"
599
- ]
600
- ],
601
- "row_limit": 10
602
- }
603
- }
604
- }
605
- },
606
- {
607
- "examples": [
608
- {
609
- "input": "Which products implement the SSDF initiative?",
610
- "output": {
611
- "columns": [
612
- "logical_app"
613
- ],
614
- "filters": [
615
- {
616
- "col": "initiative_name",
617
- "op": "==",
618
- "val": "SSDF"
619
- }
620
- ],
621
- "metrics": [],
622
- "groupby": [],
623
- "row_limit": 20
624
- }
625
- },
626
- {
627
- "input": "Which policies are failing the most frequently?",
628
- "output": {
629
- "columns": [
630
- "rule_name"
631
- ],
632
- "metrics": [
633
- {
634
- "label": "failure_count",
635
- "expressionType": "SQL",
636
- "sqlExpression": "COUNT(*)"
637
- }
638
- ],
639
- "filters": [
640
- {
641
- "col": "message",
642
- "op": "==",
643
- "val": "fail"
644
- }
645
- ],
646
- "groupby": [
647
- "rule_name"
648
- ],
649
- "orderby": [
650
- [
651
- "failure_count",
652
- false
653
- ]
654
- ],
655
- "row_limit": 50
656
- }
657
- },
658
- {
659
- "input": "How has the rate of policy failures changed over time?",
660
- "output": {
661
- "columns": [
662
- "time_evaluated"
663
- ],
664
- "metrics": [
665
- {
666
- "label": "failure_count",
667
- "expressionType": "SQL",
668
- "sqlExpression": "COUNT(*)"
669
- }
670
- ],
671
- "filters": [
672
- {
673
- "col": "message",
674
- "op": "==",
675
- "val": "fail"
676
- }
677
- ],
678
- "groupby": [
679
- "time_evaluated"
680
- ],
681
- "orderby": [
682
- [
683
- "time_evaluated",
684
- true
685
- ]
686
- ],
687
- "row_limit": 50
688
- }
689
- },
690
- {
691
- "input": "Which targets are evaluated most frequently in policy checks?",
692
- "output": {
693
- "columns": [
694
- "asset_name"
695
- ],
696
- "metrics": [
697
- {
698
- "label": "evaluation_count",
699
- "expressionType": "SQL",
700
- "sqlExpression": "COUNT(*)"
701
- }
702
- ],
703
- "groupby": [
704
- "asset_name"
705
- ],
706
- "orderby": [
707
- [
708
- "evaluation_count",
709
- false
710
- ]
711
- ],
712
- "row_limit": 50
713
- }
714
- },
715
- {
716
- "input": "Which initiatives have the highest policy failure rates?",
717
- "output": {
718
- "columns": [
719
- "initiative_name"
720
- ],
721
- "metrics": [
722
- {
723
- "label": "failure_count",
724
- "expressionType": "SQL",
725
- "sqlExpression": "COUNT(*)"
726
- }
727
- ],
728
- "filters": [
729
- {
730
- "col": "message",
731
- "op": "==",
732
- "val": "fail"
733
- }
734
- ],
735
- "groupby": [
736
- "initiative_name"
737
- ],
738
- "orderby": [
739
- [
740
- "failure_count",
741
- false
742
- ]
743
- ],
744
- "row_limit": 50
745
- }
746
- },
747
- {
748
- "input": "At which gates do policies most commonly fail?",
749
- "output": {
750
- "columns": [],
751
- "metrics": [
752
- {
753
- "label": "failure_count",
754
- "expressionType": "SQL",
755
- "sqlExpression": "COUNT(*)"
756
- }
757
- ],
758
- "filters": [
759
- {
760
- "col": "message",
761
- "op": "==",
762
- "val": "fail"
763
- }
764
- ],
765
- "groupby": [],
766
- "orderby": [
767
- [
768
- "failure_count",
769
- false
770
- ]
771
- ],
772
- "row_limit": 50
773
- }
774
- },
775
- {
776
- "input": "What is the distribution of policy evaluation statuses?",
777
- "output": {
778
- "columns": [
779
- "message"
780
- ],
781
- "metrics": [
782
- {
783
- "label": "status_count",
784
- "expressionType": "SQL",
785
- "sqlExpression": "COUNT(*)"
786
- }
787
- ],
788
- "groupby": [
789
- "message"
790
- ],
791
- "row_limit": 50
792
- }
793
- },
794
- {
795
- "input": "Which product versions experience the most policy failures?",
796
- "output": {
797
- "columns": [
798
- "logical_app",
799
- "logical_app_version"
800
- ],
801
- "metrics": [
802
- {
803
- "label": "failure_count",
804
- "expressionType": "SQL",
805
- "sqlExpression": "COUNT(*)"
806
- }
807
- ],
808
- "filters": [
809
- {
810
- "col": "message",
811
- "op": "==",
812
- "val": "fail"
813
- }
814
- ],
815
- "groupby": [
816
- "logical_app",
817
- "logical_app_version"
818
- ],
819
- "orderby": [
820
- [
821
- "failure_count",
822
- false
823
- ]
824
- ],
825
- "row_limit": 50
826
- }
827
- },
828
- {
829
- "input": "Which general rules are failing the most?",
830
- "output": {
831
- "columns": [
832
- "rule_name"
833
- ],
834
- "metrics": [
835
- {
836
- "label": "failure_count",
837
- "expressionType": "SQL",
838
- "sqlExpression": "COUNT(*)"
839
- }
840
- ],
841
- "filters": [
842
- {
843
- "col": "message",
844
- "op": "==",
845
- "val": "fail"
846
- }
847
- ],
848
- "groupby": [
849
- "rule_name"
850
- ],
851
- "orderby": [
852
- [
853
- "failure_count",
854
- false
855
- ]
856
- ],
857
- "row_limit": 50
858
- }
859
- }
860
- ]
861
- },
862
- {
863
- "ColumnTables": {
864
- "columns": [
865
- {
866
- "column_name": "is_latest_logical_version",
867
- "type": "BOOLEAN",
868
- "label": "Latest Product Version",
869
- "description": ""
870
- },
871
- {
872
- "column_name": "asset",
873
- "type": "STRING",
874
- "label": "Asset (Type)",
875
- "description": ""
876
- },
877
- {
878
- "column_name": "control_name",
879
- "type": "STRING",
880
- "label": "Policy Control",
881
- "description": ""
882
- },
883
- {
884
- "column_name": "initiative_hash",
885
- "type": "STRING",
886
- "label": "Initiative Hash",
887
- "description": ""
888
- },
889
- {
890
- "column_name": "initiative_name",
891
- "type": "STRING",
892
- "label": "Policy Initiative",
893
- "description": ""
894
- },
895
- {
896
- "column_name": "rule_name",
897
- "type": "STRING",
898
- "label": "Policy Rule",
899
- "description": ""
900
- },
901
- {
902
- "column_name": "time_evaluated",
903
- "type": "DATETIMETZ",
904
- "label": "Time",
905
- "description": ""
906
- },
907
- {
908
- "column_name": "date",
909
- "type": "DATE",
910
- "label": "Evaluated",
911
- "description": ""
912
- },
913
- {
914
- "column_name": "count",
915
- "type": "LONGINTEGER",
916
- "label": "Count",
917
- "description": ""
918
- },
919
- {
920
- "column_name": "message",
921
- "type": "STRING",
922
- "label": "Message",
923
- "description": ""
924
- },
925
- {
926
- "column_name": "logical_app",
927
- "type": "STRING",
928
- "label": "Product",
929
- "description": ""
930
- },
931
- {
932
- "column_name": "logical_app_version",
933
- "type": "STRING",
934
- "label": "Version",
935
- "description": ""
936
- },
937
- {
938
- "column_name": "formatted_msg",
939
- "type": "STRING",
940
- "label": "Formatted Msg",
941
- "description": ""
942
- },
943
- {
944
- "column_name": "more_json",
945
- "type": "JSONB",
946
- "label": "More Json",
947
- "description": ""
948
- },
949
- {
950
- "column_name": "evaluations",
951
- "type": "JSONB",
952
- "label": "Evaluations",
953
- "description": ""
954
- },
955
- {
956
- "column_name": "teamId",
957
- "type": "LONGINTEGER",
958
- "label": "Teamid",
959
- "description": ""
960
- },
961
- {
962
- "column_name": "product_id",
963
- "type": "LONGINTEGER",
964
- "label": "Product Id",
965
- "description": ""
966
- },
967
- {
968
- "column_name": "version_id",
969
- "type": "LONGINTEGER",
970
- "label": "Version Id",
971
- "description": ""
972
- },
973
- {
974
- "column_name": "asset_name",
975
- "type": "STRING",
976
- "label": "Asset Name",
977
- "description": ""
978
- },
979
- {
980
- "column_name": "asset_id",
981
- "type": "STRING",
982
- "label": "Asset Id",
983
- "description": ""
984
- },
985
- {
986
- "column_name": "gate_type",
987
- "type": "STRING",
988
- "label": "Gate Type",
989
- "description": ""
990
- },
991
- {
992
- "column_name": "asset_type",
993
- "type": "STRING",
994
- "label": "Asset Type",
995
- "description": ""
996
- },
997
- {
998
- "column_name": "rule_id",
999
- "type": "STRING",
1000
- "label": "Rule Id",
1001
- "description": ""
1002
- },
1003
- {
1004
- "column_name": "status",
1005
- "type": "STRING",
1006
- "label": "Status",
1007
- "description": ""
1008
- },
1009
- {
1010
- "column_name": "status_icon",
1011
- "type": "",
1012
- "label": "Status",
1013
- "description": ""
1014
- },
1015
- {
1016
- "column_name": "details",
1017
- "type": "",
1018
- "label": "Details",
1019
- "description": ""
1020
- },
1021
- {
1022
- "column_name": "gate",
1023
- "type": "STRING",
1024
- "label": "Gate (Type)",
1025
- "description": ""
1026
- },
1027
- {
1028
- "column_name": "gate_name",
1029
- "type": "STRING",
1030
- "label": "Gate Name",
1031
- "description": ""
1032
- }
1033
- ]
1034
- }
1035
- }
1036
- ],
1037
- "query_products": [
1038
- {
1039
- "name": "query_products"
1040
- },
1041
- {
1042
- "description": "To answer questions about products like: what are the/my products? What are the components of my product (the this case use the targetName column!)? What are the depdencieis of my product (search the component_name column)? Note that repositories and namespaces are part of the lineage table."
1043
- },
1044
- {
1045
- "params": {
1046
- "input_parameters": [
1047
- {
1048
- "name": "question",
1049
- "type": "string",
1050
- "description": "Human readable question about information in teh company database",
1051
- "required": true
1052
- }
1053
- ],
1054
- "output_schema": {
1055
- "type": "object",
1056
- "properties": {
1057
- "columns": {
1058
- "type": "array",
1059
- "items": {
1060
- "type": "string"
1061
- },
1062
- "description": "Only include necessary columns. Each column must match the columnTable documentation. DO NOT invent columns."
1063
- },
1064
- "filters": {
1065
- "type": "array",
1066
- "items": {
1067
- "type": "object",
1068
- "properties": {
1069
- "col": {
1070
- "type": "string"
1071
- },
1072
- "op": {
1073
- "type": "string"
1074
- },
1075
- "val": {}
1076
- },
1077
- "required": [
1078
- "col",
1079
- "op",
1080
- "val"
1081
- ]
1082
- },
1083
- "description": "Use operators: ==, !=, >, <, >=, <=, in, not in, is null, is not null. Use 'extras' key for like/ilike."
1084
- },
1085
- "metrics": {
1086
- "type": "array",
1087
- "minItems": 0,
1088
- "items": {
1089
- "type": "object",
1090
- "properties": {
1091
- "label": {
1092
- "type": "string",
1093
- "description": "Name of the output column for the metric"
1094
- },
1095
- "expressionType": {
1096
- "type": "string",
1097
- "enum": [
1098
- "SQL",
1099
- "SIMPLE"
1100
- ],
1101
- "description": "Type of expression used. Typically 'SQL'."
1102
- },
1103
- "sqlExpression": {
1104
- "type": "string",
1105
- "description": "SQL expression to calculate the metric, such as 'COUNT(*)' or 'AVG(score)'"
1106
- }
1107
- },
1108
- "required": [
1109
- "label",
1110
- "expressionType",
1111
- "sqlExpression"
1112
- ]
1113
- },
1114
- "description": "Either an empty array, or an array of expression objects with 'label', 'expressionType', and 'sqlExpression'."
1115
- },
1116
- "orderby": {
1117
- "type": "array",
1118
- "minItems": 0,
1119
- "items": {
1120
- "type": "array",
1121
- "items": [
1122
- {
1123
- "type": "string",
1124
- "description": "Column name"
1125
- },
1126
- {
1127
- "type": "boolean",
1128
- "description": "Column name. To sort in acending order use False and in decending order use True"
1129
- }
1130
- ],
1131
- "minItems": 2,
1132
- "maxItems": 2
1133
- },
1134
- "description": "Either an empty array, or a list of [column_name, is_ascending] pairs. Column must be in 'columns'."
1135
- },
1136
- "groupby": {
1137
- "type": "array",
1138
- "description": "Optional list of column names to group results by. Grouping is used to aggregate rows that share the same values in the specified columns, often used in combination with metrics.",
1139
- "minItems": 0,
1140
- "items": {
1141
- "type": "string",
1142
- "description": "A column name to group by, should be one or more of the\u00df columns used in the columns item"
1143
- }
1144
- },
1145
- "row_limit": {
1146
- "type": "integer",
1147
- "default": 10,
1148
- "description": "Default: 10, max: 30."
1149
- }
1150
- },
1151
- "required": [
1152
- "columns",
1153
- "filters",
1154
- "metrics",
1155
- "orderby",
1156
- "grouby",
1157
- "row_limit"
1158
- ]
1159
- },
1160
- "example": {
1161
- "input": "Human readable question",
1162
- "output": {
1163
- "columns": [
1164
- "column_name1",
1165
- "column_name2"
1166
- ],
1167
- "filters": [
1168
- {
1169
- "col": "column_name",
1170
- "op": "operator",
1171
- "val": "value"
1172
- }
1173
- ],
1174
- "metrics": [
1175
- {
1176
- "label": "column_name",
1177
- "expressionType": "expression",
1178
- "sqlExpression": "SQL expression to calculate the metric"
1179
- }
1180
- ],
1181
- "orderby": [
1182
- [
1183
- "column_name",
1184
- "(true) or (false)"
1185
- ]
1186
- ],
1187
- "row_limit": 10
1188
- }
1189
- }
1190
- }
1191
- },
1192
- {
1193
- "examples": [
1194
- {
1195
- "input": "What python packages are in the base layers?",
1196
- "output": {
1197
- "columns": [
1198
- "component_name",
1199
- "component_purl",
1200
- "base_layer"
1201
- ],
1202
- "filters": [
1203
- {
1204
- "col": "component_purl",
1205
- "op": "like",
1206
- "val": "%pypi%"
1207
- },
1208
- {
1209
- "col": "base_layer",
1210
- "op": "==",
1211
- "val": "TRUE"
1212
- }
1213
- ],
1214
- "metrics": [],
1215
- "orderby": [
1216
- [
1217
- "component_name",
1218
- true
1219
- ]
1220
- ],
1221
- "row_limit": 30
1222
- }
1223
- },
1224
- {
1225
- "input": "What are the base layer values?",
1226
- "output": {
1227
- "columns": [
1228
- "base_layer"
1229
- ],
1230
- "metrics": [
1231
- {
1232
- "label": "base_layer_count",
1233
- "expressionType": "SQL",
1234
- "sqlExpression": "COUNT(*)"
1235
- }
1236
- ],
1237
- "groupby": [
1238
- "base_layer"
1239
- ],
1240
- "row_limit": 30
1241
- }
1242
- },
1243
- {
1244
- "input": "What npm packages have non-permissive licenses?",
1245
- "output": {
1246
- "columns": [
1247
- "component_name",
1248
- "component_purl",
1249
- "license_expression"
1250
- ],
1251
- "filters": [
1252
- {
1253
- "col": "component_purl",
1254
- "op": "like",
1255
- "val": "%pkg:npm%"
1256
- },
1257
- {
1258
- "col": "license_expression",
1259
- "op": "like",
1260
- "val": "%GPL%"
1261
- }
1262
- ],
1263
- "metrics": [],
1264
- "orderby": [
1265
- [
1266
- "component_name",
1267
- true
1268
- ]
1269
- ],
1270
- "row_limit": 30
1271
- }
1272
- },
1273
- {
1274
- "input": "How many npm packages are in my products?",
1275
- "output": {
1276
- "columns": [],
1277
- "filters": [
1278
- {
1279
- "col": "component_purl",
1280
- "op": "like",
1281
- "val": "%pkg:npm%"
1282
- }
1283
- ],
1284
- "metrics": [
1285
- {
1286
- "label": "npm_component_count",
1287
- "expressionType": "SQL",
1288
- "sqlExpression": "COUNT(*)"
1289
- }
1290
- ],
1291
- "orderby": [],
1292
- "row_limit": 1
1293
- }
1294
- },
1295
- {
1296
- "input": "What are the high-level components of a product?",
1297
- "output": {
1298
- "columns": [
1299
- "targetName"
1300
- ],
1301
- "filters": [
1302
- {
1303
- "col": "logical_app",
1304
- "op": "==",
1305
- "val": "Scribot"
1306
- }
1307
- ],
1308
- "metrics": [],
1309
- "orderby": [
1310
- [
1311
- "targetName",
1312
- true
1313
- ]
1314
- ],
1315
- "row_limit": 10
1316
- }
1317
- },
1318
- {
1319
- "input": "What are all the components that have the requests package?",
1320
- "output": {
1321
- "columns": [
1322
- "targetName"
1323
- ],
1324
- "filters": [
1325
- {
1326
- "col": "component_name",
1327
- "op": "==",
1328
- "val": "requests"
1329
- }
1330
- ],
1331
- "metrics": [],
1332
- "orderby": [
1333
- [
1334
- "targetName",
1335
- true
1336
- ]
1337
- ],
1338
- "row_limit": 30
1339
- }
1340
- },
1341
- {
1342
- "input": "What are the labels in my products and components?",
1343
- "output": {
1344
- "columns": [
1345
- "labels"
1346
- ],
1347
- "filters": [],
1348
- "metrics": [],
1349
- "orderby": [
1350
- [
1351
- "labels",
1352
- true
1353
- ]
1354
- ],
1355
- "row_limit": 30
1356
- }
1357
- }
1358
- ]
1359
- },
1360
- {
1361
- "ColumnTables": {
1362
- "columns": [
1363
- {
1364
- "column_name": "logical_app",
1365
- "type": "STRING",
1366
- "label": "Product",
1367
- "description": ""
1368
- },
1369
- {
1370
- "column_name": "base_layer",
1371
- "type": "BOOLEAN",
1372
- "label": "Base Image",
1373
- "description": "is dependency coming from a an image layer that is a known base layer"
1374
- },
1375
- {
1376
- "column_name": "component_publisher",
1377
- "type": "STRING",
1378
- "label": "Component Publisher",
1379
- "description": ""
1380
- },
1381
- {
1382
- "column_name": "component_description",
1383
- "type": "STRING",
1384
- "label": "Component Description",
1385
- "description": ""
1386
- },
1387
- {
1388
- "column_name": "tools",
1389
- "type": "STRING",
1390
- "label": "Tools",
1391
- "description": ""
1392
- },
1393
- {
1394
- "column_name": "licenses",
1395
- "type": "STRING",
1396
- "label": "Licenses",
1397
- "description": ""
1398
- },
1399
- {
1400
- "column_name": "latest_version",
1401
- "type": "STRING",
1402
- "label": "Dep latest ver",
1403
- "description": ""
1404
- },
1405
- {
1406
- "column_name": "high_severity_cves",
1407
- "type": "INTEGER",
1408
- "label": "C+H Vulns",
1409
- "description": ""
1410
- },
1411
- {
1412
- "column_name": "license_is_permissive",
1413
- "type": "BOOLEAN",
1414
- "label": "Is permissive",
1415
- "description": ""
1416
- },
1417
- {
1418
- "column_name": "scorecard_score",
1419
- "type": "FLOAT",
1420
- "label": "OpenSSF score",
1421
- "description": ""
1422
- },
1423
- {
1424
- "column_name": "targets",
1425
- "type": "STRING",
1426
- "label": "SBOM Type",
1427
- "description": ""
1428
- },
1429
- {
1430
- "column_name": "component_type",
1431
- "type": "STRING",
1432
- "label": "Component type",
1433
- "description": ""
1434
- },
1435
- {
1436
- "column_name": "tag",
1437
- "type": "STRING",
1438
- "label": "Component version",
1439
- "description": ""
1440
- },
1441
- {
1442
- "column_name": "component_version",
1443
- "type": "STRING",
1444
- "label": "Dep version",
1445
- "description": ""
1446
- },
1447
- {
1448
- "column_name": "maintenance_score_int",
1449
- "type": "INTEGER",
1450
- "label": "Maintenance Score",
1451
- "description": ""
1452
- },
1453
- {
1454
- "column_name": "license_expression",
1455
- "type": "STRING",
1456
- "label": "Licesne expression",
1457
- "description": ""
1458
- },
1459
- {
1460
- "column_name": "pkg",
1461
- "type": "STRING",
1462
- "label": "Package Manager",
1463
- "description": ""
1464
- },
1465
- {
1466
- "column_name": "rstatus",
1467
- "type": "STRING",
1468
- "label": "Version Status",
1469
- "description": ""
1470
- },
1471
- {
1472
- "column_name": "version_is_up_to_date",
1473
- "type": "BOOLEAN",
1474
- "label": "Up-to-date",
1475
- "description": ""
1476
- },
1477
- {
1478
- "column_name": "maintenance_score",
1479
- "type": "STRING",
1480
- "label": "--",
1481
- "description": ""
1482
- },
1483
- {
1484
- "column_name": "component_dependency_type",
1485
- "type": "STRINGARRAY",
1486
- "label": "Component Dependency Type",
1487
- "description": ""
1488
- },
1489
- {
1490
- "column_name": "targetName",
1491
- "type": "STRING",
1492
- "label": "Component",
1493
- "description": ""
1494
- },
1495
- {
1496
- "column_name": "labels",
1497
- "type": "STRING",
1498
- "label": "Labels",
1499
- "description": ""
1500
- },
1501
- {
1502
- "column_name": "component_purl",
1503
- "type": "STRING",
1504
- "label": "PURL",
1505
- "description": ""
1506
- },
1507
- {
1508
- "column_name": "source_layer",
1509
- "type": "STRING",
1510
- "label": "Layer",
1511
- "description": ""
1512
- },
1513
- {
1514
- "column_name": "logical_app_version",
1515
- "type": "STRING",
1516
- "label": "Version",
1517
- "description": ""
1518
- },
1519
- {
1520
- "column_name": "component_name",
1521
- "type": "STRING",
1522
- "label": "Component Name",
1523
- "description": ""
1524
- },
1525
- {
1526
- "column_name": "component_group",
1527
- "type": "STRING",
1528
- "label": "Component Group",
1529
- "description": ""
1530
- },
1531
- {
1532
- "column_name": "attestation_ids",
1533
- "type": "LONGINTEGERARRAY",
1534
- "label": "Attestation Ids",
1535
- "description": ""
1536
- },
1537
- {
1538
- "column_name": "dependency_parents",
1539
- "type": "STRINGARRAY",
1540
- "label": "Dependency Parents",
1541
- "description": ""
1542
- },
1543
- {
1544
- "column_name": "dependency_children",
1545
- "type": "STRINGARRAY",
1546
- "label": "Dependency Children",
1547
- "description": ""
1548
- },
1549
- {
1550
- "column_name": "license_is_permissive_na",
1551
- "type": "BOOLEAN",
1552
- "label": "License Is Permissive Na",
1553
- "description": ""
1554
- },
1555
- {
1556
- "column_name": "version_timestamp",
1557
- "type": "DATETIMETZ",
1558
- "label": "Version Timestamp",
1559
- "description": ""
1560
- },
1561
- {
1562
- "column_name": "component_locations",
1563
- "type": "JSONB",
1564
- "label": "Component Locations",
1565
- "description": ""
1566
- },
1567
- {
1568
- "column_name": "scorecard_id",
1569
- "type": "LONGINTEGER",
1570
- "label": "Scorecard Id",
1571
- "description": ""
1572
- },
1573
- {
1574
- "column_name": "attestation_ids_cnt",
1575
- "type": "INTEGER",
1576
- "label": "Attestation Ids Cnt",
1577
- "description": ""
1578
- },
1579
- {
1580
- "column_name": "teamId",
1581
- "type": "LONGINTEGER",
1582
- "label": "Teamid",
1583
- "description": ""
1584
- },
1585
- {
1586
- "column_name": "pipeline_run_id",
1587
- "type": "LONGINTEGER",
1588
- "label": "Pipeline Run Id",
1589
- "description": ""
1590
- },
1591
- {
1592
- "column_name": "product_id",
1593
- "type": "LONGINTEGER",
1594
- "label": "Product Id",
1595
- "description": ""
1596
- },
1597
- {
1598
- "column_name": "component_id",
1599
- "type": "LONGINTEGER",
1600
- "label": "Component Id",
1601
- "description": ""
1602
- },
1603
- {
1604
- "column_name": "id",
1605
- "type": "LONGINTEGER",
1606
- "label": "Id",
1607
- "description": ""
1608
- },
1609
- {
1610
- "column_name": "component_external_ref",
1611
- "type": "STRING",
1612
- "label": "Component External Ref",
1613
- "description": ""
1614
- },
1615
- {
1616
- "column_name": "license_expression_na",
1617
- "type": "STRING",
1618
- "label": "License Expression Na",
1619
- "description": ""
1620
- },
1621
- {
1622
- "column_name": "attestation_name",
1623
- "type": "STRING",
1624
- "label": "Attestation Name",
1625
- "description": ""
1626
- },
1627
- {
1628
- "column_name": "component_author",
1629
- "type": "STRING",
1630
- "label": "Component Author",
1631
- "description": ""
1632
- },
1633
- {
1634
- "column_name": "more",
1635
- "type": "",
1636
- "label": " ",
1637
- "description": ""
1638
- },
1639
- {
1640
- "column_name": "block",
1641
- "type": "",
1642
- "label": "Dependency",
1643
- "description": ""
1644
- },
1645
- {
1646
- "column_name": "relation",
1647
- "type": "",
1648
- "label": "Relation",
1649
- "description": ""
1650
- },
1651
- {
1652
- "column_name": "targets_translated",
1653
- "type": "",
1654
- "label": "SBOM Type Translated",
1655
- "description": ""
1656
- },
1657
- {
1658
- "column_name": "main_tool",
1659
- "type": "",
1660
- "label": "Main Tool",
1661
- "description": ""
1662
- }
1663
- ]
1664
- }
1665
- }
1666
- ],
1667
- "query_risk": [
1668
- {
1669
- "name": "query_risk"
1670
- },
1671
- {
1672
- "description": "To answer questions about products like: what are the/my products? What are the components of my product (the this case use the targetName column!)? What are the depdencieis of my product (search the component_name column)? Note that repositories and namespaces are part of the lineage table."
1673
- },
1674
- {
1675
- "params": {
1676
- "input_parameters": [
1677
- {
1678
- "name": "question",
1679
- "type": "string",
1680
- "description": "Human readable question about information in teh company database",
1681
- "required": true
1682
- }
1683
- ],
1684
- "output_schema": {
1685
- "type": "object",
1686
- "properties": {
1687
- "columns": {
1688
- "type": "array",
1689
- "items": {
1690
- "type": "string"
1691
- },
1692
- "description": "Only include necessary columns. Each column must match the columnTable documentation. DO NOT invent columns."
1693
- },
1694
- "filters": {
1695
- "type": "array",
1696
- "items": {
1697
- "type": "object",
1698
- "properties": {
1699
- "col": {
1700
- "type": "string"
1701
- },
1702
- "op": {
1703
- "type": "string"
1704
- },
1705
- "val": {}
1706
- },
1707
- "required": [
1708
- "col",
1709
- "op",
1710
- "val"
1711
- ]
1712
- },
1713
- "description": "Use operators: ==, !=, >, <, >=, <=, in, not in, is null, is not null. Use 'extras' key for like/ilike."
1714
- },
1715
- "metrics": {
1716
- "type": "array",
1717
- "minItems": 0,
1718
- "items": {
1719
- "type": "object",
1720
- "properties": {
1721
- "label": {
1722
- "type": "string",
1723
- "description": "Name of the output column for the metric"
1724
- },
1725
- "expressionType": {
1726
- "type": "string",
1727
- "enum": [
1728
- "SQL",
1729
- "SIMPLE"
1730
- ],
1731
- "description": "Type of expression used. Typically 'SQL'."
1732
- },
1733
- "sqlExpression": {
1734
- "type": "string",
1735
- "description": "SQL expression to calculate the metric, such as 'COUNT(*)' or 'AVG(score)'"
1736
- }
1737
- },
1738
- "required": [
1739
- "label",
1740
- "expressionType",
1741
- "sqlExpression"
1742
- ]
1743
- },
1744
- "description": "Either an empty array, or an array of expression objects with 'label', 'expressionType', and 'sqlExpression'."
1745
- },
1746
- "orderby": {
1747
- "type": "array",
1748
- "minItems": 0,
1749
- "items": {
1750
- "type": "array",
1751
- "items": [
1752
- {
1753
- "type": "string",
1754
- "description": "Column name"
1755
- },
1756
- {
1757
- "type": "boolean",
1758
- "description": "Column name. To sort in acending order use False and in decending order use True"
1759
- }
1760
- ],
1761
- "minItems": 2,
1762
- "maxItems": 2
1763
- },
1764
- "description": "Either an empty array, or a list of [column_name, is_ascending] pairs. Column must be in 'columns'."
1765
- },
1766
- "groupby": {
1767
- "type": "array",
1768
- "description": "Optional list of column names to group results by. Grouping is used to aggregate rows that share the same values in the specified columns, often used in combination with metrics.",
1769
- "minItems": 0,
1770
- "items": {
1771
- "type": "string",
1772
- "description": "A column name to group by, should be one or more of the\u00df columns used in the columns item"
1773
- }
1774
- },
1775
- "row_limit": {
1776
- "type": "integer",
1777
- "default": 10,
1778
- "description": "Default: 10, max: 30."
1779
- }
1780
- },
1781
- "required": [
1782
- "columns",
1783
- "filters",
1784
- "metrics",
1785
- "orderby",
1786
- "grouby",
1787
- "row_limit"
1788
- ]
1789
- },
1790
- "example": {
1791
- "input": "Human readable question",
1792
- "output": {
1793
- "columns": [
1794
- "column_name1",
1795
- "column_name2"
1796
- ],
1797
- "filters": [
1798
- {
1799
- "col": "column_name",
1800
- "op": "operator",
1801
- "val": "value"
1802
- }
1803
- ],
1804
- "metrics": [
1805
- {
1806
- "label": "column_name",
1807
- "expressionType": "expression",
1808
- "sqlExpression": "SQL expression to calculate the metric"
1809
- }
1810
- ],
1811
- "orderby": [
1812
- [
1813
- "column_name",
1814
- "(true) or (false)"
1815
- ]
1816
- ],
1817
- "row_limit": 10
1818
- }
1819
- }
1820
- }
1821
- },
1822
- {
1823
- "examples": [
1824
- {
1825
- "input": "Which product versions have the highest total risk?",
1826
- "output": {
1827
- "columns": [
1828
- "logical_app_version",
1829
- "logical_app",
1830
- "total_risk"
1831
- ],
1832
- "filters": [],
1833
- "metrics": [],
1834
- "groupby": [],
1835
- "orderby": [
1836
- [
1837
- "total_risk",
1838
- true
1839
- ]
1840
- ],
1841
- "row_limit": 30
1842
- }
1843
- },
1844
- {
1845
- "input": "How many fixable CVEs exist in each component?",
1846
- "output": {
1847
- "columns": [
1848
- "target"
1849
- ],
1850
- "filters": [],
1851
- "metrics": [
1852
- {
1853
- "label": "fixable_cves",
1854
- "expressionType": "SQL",
1855
- "sqlExpression": "SUM(target_fixables)"
1856
- }
1857
- ],
1858
- "groupby": [
1859
- "target"
1860
- ],
1861
- "orderby": [
1862
- [
1863
- "fixable_cves",
1864
- true
1865
- ]
1866
- ],
1867
- "row_limit": 30
1868
- }
1869
- },
1870
- {
1871
- "input": "List the top 10 products by weighted CVE risk.",
1872
- "output": {
1873
- "columns": [
1874
- "logical_app",
1875
- "weighted_cve_risk"
1876
- ],
1877
- "filters": [],
1878
- "metrics": [],
1879
- "groupby": [],
1880
- "orderby": [
1881
- [
1882
- "weighted_cve_risk",
1883
- true
1884
- ]
1885
- ],
1886
- "row_limit": 10
1887
- }
1888
- },
1889
- {
1890
- "input": "Show total exploitables grouped by product version.",
1891
- "output": {
1892
- "columns": [
1893
- "logical_app_version"
1894
- ],
1895
- "filters": [],
1896
- "metrics": [
1897
- {
1898
- "label": "exploitables",
1899
- "expressionType": "SQL",
1900
- "sqlExpression": "SUM(logical_app_version_exploitables)"
1901
- }
1902
- ],
1903
- "groupby": [
1904
- "logical_app_version"
1905
- ],
1906
- "orderby": [
1907
- [
1908
- "exploitables",
1909
- true
1910
- ]
1911
- ],
1912
- "row_limit": 30
1913
- }
1914
- },
1915
- {
1916
- "input": "Which components have KEVs and are in the base image?",
1917
- "output": {
1918
- "columns": [
1919
- "target",
1920
- "vulnerability_id"
1921
- ],
1922
- "filters": [
1923
- {
1924
- "col": "has_kev",
1925
- "op": "==",
1926
- "val": true
1927
- },
1928
- {
1929
- "col": "in_base_image",
1930
- "op": "==",
1931
- "val": true
1932
- }
1933
- ],
1934
- "metrics": [],
1935
- "groupby": [],
1936
- "orderby": [],
1937
- "row_limit": 30
1938
- }
1939
- }
1940
- ]
1941
- },
1942
- {
1943
- "ColumnTables": {
1944
- "columns": [
1945
- {
1946
- "column_name": "totals_badge",
1947
- "type": "STRING",
1948
- "label": "Totals",
1949
- "description": ""
1950
- },
1951
- {
1952
- "column_name": "logical_app_badges",
1953
- "type": "STRING",
1954
- "label": "Info",
1955
- "description": ""
1956
- },
1957
- {
1958
- "column_name": "target_badges",
1959
- "type": "STRING",
1960
- "label": "Info",
1961
- "description": ""
1962
- },
1963
- {
1964
- "column_name": "cve_badges",
1965
- "type": "STRING",
1966
- "label": "Info",
1967
- "description": ""
1968
- },
1969
- {
1970
- "column_name": "logical_app",
1971
- "type": "STRING",
1972
- "label": "Product",
1973
- "description": "Name of Product in ScribeHub. A product is made of components (e.g. a few docker images)"
1974
- },
1975
- {
1976
- "column_name": "has_fix",
1977
- "type": "BOOLEAN",
1978
- "label": "Has Fix",
1979
- "description": "True if there is a fix for this vulnerability (usually an udate for the vulnerable dependency)"
1980
- },
1981
- {
1982
- "column_name": "weighted_cve_risk",
1983
- "type": "DECIMAL",
1984
- "label": "Weighted Cve Risk",
1985
- "description": "Risk imposed by the CVE, taking into account weights (business criticality, public facing, publicly available)"
1986
- },
1987
- {
1988
- "column_name": "total_cves_in_base_image",
1989
- "type": "DECIMAL",
1990
- "label": "Total Cves In Base Image",
1991
- "description": "Total number of CVEs that are in a base image, across the team"
1992
- },
1993
- {
1994
- "column_name": "in_base_image",
1995
- "type": "BOOLEAN",
1996
- "label": "In Base Image",
1997
- "description": "True if the vulnerability is in the base layer of a Docker image"
1998
- },
1999
- {
2000
- "column_name": "total_fixables",
2001
- "type": "DECIMAL",
2002
- "label": "Total Fixables",
2003
- "description": "Total number of CVEs with a fix in the team"
2004
- },
2005
- {
2006
- "column_name": "weight",
2007
- "type": "FLOAT",
2008
- "label": "Weight",
2009
- "description": "the is the accumulated weight for this Componen (Target)"
2010
- },
2011
- {
2012
- "column_name": "has_kev",
2013
- "type": "BOOLEAN",
2014
- "label": "Has Kev",
2015
- "description": "True if this CVE is a Known Exploitable Vulnerability"
2016
- },
2017
- {
2018
- "column_name": "target_risk",
2019
- "type": "DECIMAL",
2020
- "label": "Component Risk",
2021
- "description": "Total risk for this component of the product"
2022
- },
2023
- {
2024
- "column_name": "logical_app_version_cves_in_base_image",
2025
- "type": "DECIMAL",
2026
- "label": "Logical App Version Cves In Base Image",
2027
- "description": "Total CVEs in base image for this product version"
2028
- },
2029
- {
2030
- "column_name": "total_risk",
2031
- "type": "DECIMAL",
2032
- "label": "Total Risk",
2033
- "description": "Total risk for this team (across all product-versions)"
2034
- },
2035
- {
2036
- "column_name": "total_exploitables",
2037
- "type": "DECIMAL",
2038
- "label": "Total Exploitables",
2039
- "description": "Total number of exploitable CVEs in the team"
2040
- },
2041
- {
2042
- "column_name": "target_fixables",
2043
- "type": "LONGINTEGER",
2044
- "label": "Target Fixables",
2045
- "description": "Number of fixable risky CVEs of the component"
2046
- },
2047
- {
2048
- "column_name": "target",
2049
- "type": "STRING",
2050
- "label": "Component",
2051
- "description": "The component (usually a Docker image name:tag)"
2052
- },
2053
- {
2054
- "column_name": "logical_app_version_risk",
2055
- "type": "DECIMAL",
2056
- "label": "Product Risk",
2057
- "description": "Total risk for this Product Version"
2058
- },
2059
- {
2060
- "column_name": "logical_app_version_fixables",
2061
- "type": "DECIMAL",
2062
- "label": "Logical App Version Fixables",
2063
- "description": "Number of Fixable CVEs in the product-version"
2064
- },
2065
- {
2066
- "column_name": "logical_app_version_exploitables",
2067
- "type": "DECIMAL",
2068
- "label": "Logical App Version Exploitables",
2069
- "description": "Number of exploitable CVEs in the Product-Version"
2070
- },
2071
- {
2072
- "column_name": "target_cves_in_base_image",
2073
- "type": "LONGINTEGER",
2074
- "label": "Target Cves In Base Image",
2075
- "description": "Number of CVEs in Component Base Image"
2076
- },
2077
- {
2078
- "column_name": "target_exploitables",
2079
- "type": "LONGINTEGER",
2080
- "label": "Target Exploitables",
2081
- "description": "Number of Exploitable CVEs in the component"
2082
- },
2083
- {
2084
- "column_name": "vulnerability_id",
2085
- "type": "STRING",
2086
- "label": "CVE ID",
2087
- "description": "CVE ID for this line"
2088
- },
2089
- {
2090
- "column_name": "num_targets",
2091
- "type": "LONGINTEGER",
2092
- "label": "Num Targets",
2093
- "description": "Number of Components in the Product"
2094
- },
2095
- {
2096
- "column_name": "teamId",
2097
- "type": "LONGINTEGER",
2098
- "label": "Teamid",
2099
- "description": "ID of the team within Scribe"
2100
- },
2101
- {
2102
- "column_name": "logical_app_version",
2103
- "type": "STRING",
2104
- "label": "Version",
2105
- "description": "Version of Product in ScribeHub"
2106
- },
2107
- {
2108
- "column_name": "total_completion",
2109
- "type": "",
2110
- "label": "Safe",
2111
- "description": ""
2112
- }
2113
- ]
2114
- }
2115
- }
2116
- ],
2117
- "query_vulnerabilities": [
2118
- {
2119
- "name": "query_vulnerabilities"
2120
- },
2121
- {
2122
- "description": "To answer questions about vulnerabilities like: What are the vulnerabilities of my product? What are the vulnerabilities of a specific component? What are the vulnerabilities of a specific version of a component? Which products have a specific vulnerability, or a vulnerability with a specificy characteristic (such as has_key)"
2123
- },
2124
- {
2125
- "params": {
2126
- "input_parameters": [
2127
- {
2128
- "name": "question",
2129
- "type": "string",
2130
- "description": "Human readable question about information in teh company database",
2131
- "required": true
2132
- }
2133
- ],
2134
- "output_schema": {
2135
- "type": "object",
2136
- "properties": {
2137
- "columns": {
2138
- "type": "array",
2139
- "items": {
2140
- "type": "string"
2141
- },
2142
- "description": "Only include necessary columns. Each column must match the columnTable documentation. DO NOT invent columns."
2143
- },
2144
- "filters": {
2145
- "type": "array",
2146
- "items": {
2147
- "type": "object",
2148
- "properties": {
2149
- "col": {
2150
- "type": "string"
2151
- },
2152
- "op": {
2153
- "type": "string"
2154
- },
2155
- "val": {}
2156
- },
2157
- "required": [
2158
- "col",
2159
- "op",
2160
- "val"
2161
- ]
2162
- },
2163
- "description": "Use operators: ==, !=, >, <, >=, <=, in, not in, is null, is not null. Use 'extras' key for like/ilike."
2164
- },
2165
- "metrics": {
2166
- "type": "array",
2167
- "minItems": 0,
2168
- "items": {
2169
- "type": "object",
2170
- "properties": {
2171
- "label": {
2172
- "type": "string",
2173
- "description": "Name of the output column for the metric"
2174
- },
2175
- "expressionType": {
2176
- "type": "string",
2177
- "enum": [
2178
- "SQL",
2179
- "SIMPLE"
2180
- ],
2181
- "description": "Type of expression used. Typically 'SQL'."
2182
- },
2183
- "sqlExpression": {
2184
- "type": "string",
2185
- "description": "SQL expression to calculate the metric, such as 'COUNT(*)' or 'AVG(score)'"
2186
- }
2187
- },
2188
- "required": [
2189
- "label",
2190
- "expressionType",
2191
- "sqlExpression"
2192
- ]
2193
- },
2194
- "description": "Either an empty array, or an array of expression objects with 'label', 'expressionType', and 'sqlExpression'."
2195
- },
2196
- "orderby": {
2197
- "type": "array",
2198
- "minItems": 0,
2199
- "items": {
2200
- "type": "array",
2201
- "items": [
2202
- {
2203
- "type": "string",
2204
- "description": "Column name"
2205
- },
2206
- {
2207
- "type": "boolean",
2208
- "description": "Column name. To sort in acending order use False and in decending order use True"
2209
- }
2210
- ],
2211
- "minItems": 2,
2212
- "maxItems": 2
2213
- },
2214
- "description": "Either an empty array, or a list of [column_name, is_ascending] pairs. Column must be in 'columns'."
2215
- },
2216
- "groupby": {
2217
- "type": "array",
2218
- "description": "Optional list of column names to group results by. Grouping is used to aggregate rows that share the same values in the specified columns, often used in combination with metrics.",
2219
- "minItems": 0,
2220
- "items": {
2221
- "type": "string",
2222
- "description": "A column name to group by, should be one or more of the\u00df columns used in the columns item"
2223
- }
2224
- },
2225
- "row_limit": {
2226
- "type": "integer",
2227
- "default": 10,
2228
- "description": "Default: 10, max: 30."
2229
- }
2230
- },
2231
- "required": [
2232
- "columns",
2233
- "filters",
2234
- "metrics",
2235
- "orderby",
2236
- "grouby",
2237
- "row_limit"
2238
- ]
2239
- },
2240
- "example": {
2241
- "input": "Human readable question",
2242
- "output": {
2243
- "columns": [
2244
- "column_name1",
2245
- "column_name2"
2246
- ],
2247
- "filters": [
2248
- {
2249
- "col": "column_name",
2250
- "op": "operator",
2251
- "val": "value"
2252
- }
2253
- ],
2254
- "metrics": [
2255
- {
2256
- "label": "column_name",
2257
- "expressionType": "expression",
2258
- "sqlExpression": "SQL expression to calculate the metric"
2259
- }
2260
- ],
2261
- "orderby": [
2262
- [
2263
- "column_name",
2264
- "(true) or (false)"
2265
- ]
2266
- ],
2267
- "row_limit": 10
2268
- }
2269
- }
2270
- }
2271
- },
2272
- {
2273
- "examples": [
2274
- {
2275
- "input": "Which components or modules in our software are most frequently associated with vulnerabilities?",
2276
- "output": {
2277
- "columns": [
2278
- "logical_app",
2279
- "logical_app_version",
2280
- "version_timestamp",
2281
- "component_name"
2282
- ],
2283
- "filters": [
2284
- {
2285
- "col": "is_latest_logical_version",
2286
- "op": "==",
2287
- "val": true
2288
- }
2289
- ],
2290
- "metrics": [
2291
- {
2292
- "label": "vulnerability_count",
2293
- "expressionType": "SQL",
2294
- "sqlExpression": "COUNT()"
2295
- }
2296
- ],
2297
- "orderby": [
2298
- [
2299
- "vulnerability_count",
2300
- false
2301
- ]
2302
- ],
2303
- "row_limit": 50
2304
- }
2305
- },
2306
- {
2307
- "input": "How many vulnerabilities that have a patch?",
2308
- "output": {
2309
- "columns": [
2310
- "logical_app",
2311
- "logical_app_version"
2312
- ],
2313
- "filters": [
2314
- {
2315
- "col": "is_latest_logical_version",
2316
- "op": "==",
2317
- "val": true
2318
- },
2319
- {
2320
- "col": "has_fix",
2321
- "op": "==",
2322
- "val": true
2323
- }
2324
- ],
2325
- "metrics": [
2326
- {
2327
- "label": "patchable_vulnerabilities",
2328
- "expressionType": "SQL",
2329
- "sqlExpression": "COUNT()"
2330
- }
2331
- ],
2332
- "orderby": [
2333
- [
2334
- "unpatchable_vulnerabilities",
2335
- true
2336
- ]
2337
- ],
2338
- "row_limit": 30
2339
- }
2340
- },
2341
- {
2342
- "input": "Which package has most vulnerabilities that the vendor will not fix?",
2343
- "output": {
2344
- "columns": [
2345
- "component_name",
2346
- "component_version"
2347
- ],
2348
- "filters": [
2349
- {
2350
- "col": "is_latest_logical_version",
2351
- "op": "==",
2352
- "val": true
2353
- },
2354
- {
2355
- "col": "will_not_fix",
2356
- "op": "==",
2357
- "val": true
2358
- }
2359
- ],
2360
- "metrics": [
2361
- {
2362
- "label": "not_to_be_fixed_vulnerabilities",
2363
- "expressionType": "SQL",
2364
- "sqlExpression": "COUNT(*)"
2365
- }
2366
- ],
2367
- "groupby": [
2368
- "logical_app",
2369
- "logical_app_version",
2370
- "component_name"
2371
- ],
2372
- "orderby": [
2373
- [
2374
- "unpatchable_vulnerabilities",
2375
- false
2376
- ]
2377
- ],
2378
- "row_limit": 30
2379
- }
2380
- },
2381
- {
2382
- "input": "Which of my products have a KEV / exploitable vulnerability?",
2383
- "output": {
2384
- "columns": [
2385
- "logical_app",
2386
- "vulnerability_id"
2387
- ],
2388
- "filters": [
2389
- {
2390
- "col": "is_latest_logical_version",
2391
- "op": "==",
2392
- "val": true
2393
- },
2394
- {
2395
- "col": "has_kev",
2396
- "op": "==",
2397
- "val": true
2398
- }
2399
- ],
2400
- "metrics": [],
2401
- "groupby": [],
2402
- "orderby": [],
2403
- "row_limit": 30
2404
- }
2405
- },
2406
- {
2407
- "input": "Which vulnerabilities affect the most of my products?",
2408
- "output": {
2409
- "columns": [
2410
- "vulnerability_id",
2411
- "final_severity"
2412
- ],
2413
- "filters": [
2414
- {
2415
- "col": "is_latest_logical_version",
2416
- "op": "==",
2417
- "val": true
2418
- }
2419
- ],
2420
- "metrics": [
2421
- {
2422
- "label": "product_count",
2423
- "expressionType": "SQL",
2424
- "sqlExpression": "COUNT(distinct logical_app)"
2425
- }
2426
- ],
2427
- "groupby": [],
2428
- "orderby": [
2429
- [
2430
- "final_severity",
2431
- false
2432
- ],
2433
- [
2434
- "product_count",
2435
- false
2436
- ]
2437
- ],
2438
- "row_limit": 30
2439
- }
2440
- },
2441
- {
2442
- "input": "Which vulnerabilities have an Attack Vector: Network (Can be exploited over the network)?",
2443
- "output": {
2444
- "columns": [
2445
- "logical_app",
2446
- "vulnerability_id",
2447
- "vector"
2448
- ],
2449
- "filters": [
2450
- {
2451
- "col": "is_latest_logical_version",
2452
- "op": "==",
2453
- "val": true
2454
- },
2455
- {
2456
- "col": "vector",
2457
- "op": "like",
2458
- "val": "%AV:N%"
2459
- }
2460
- ],
2461
- "metrics": [],
2462
- "groupby": [],
2463
- "orderby": [],
2464
- "row_limit": 30
2465
- }
2466
- }
2467
- ]
2468
- },
2469
- {
2470
- "ColumnTables": {
2471
- "columns": [
2472
- {
2473
- "column_name": "cwe_array",
2474
- "type": "",
2475
- "label": "CWEs",
2476
- "description": ""
2477
- },
2478
- {
2479
- "column_name": "dependency_analysis",
2480
- "type": "JSONB",
2481
- "label": "Dependency Analysis",
2482
- "description": "Details on how the dependency was introduced: direct or transitive (dependent library of a library), through source (e.g. package.json) or image (e.g. Dockerfile)"
2483
- },
2484
- {
2485
- "column_name": "advisory_link",
2486
- "type": "",
2487
- "label": "Advisory",
2488
- "description": ""
2489
- },
2490
- {
2491
- "column_name": "has_fix",
2492
- "type": "BOOLEAN",
2493
- "label": "Has Fix",
2494
- "description": ""
2495
- },
2496
- {
2497
- "column_name": "vul_component_fixed_in_versions",
2498
- "type": "STRINGARRAY",
2499
- "label": "Vulnerability Fix Version",
2500
- "description": ""
2501
- },
2502
- {
2503
- "column_name": "will_not_fix",
2504
- "type": "BOOLEAN",
2505
- "label": "Will Not Fix",
2506
- "description": ""
2507
- },
2508
- {
2509
- "column_name": "is_latest_logical_version",
2510
- "type": "BOOLEAN",
2511
- "label": "Latest product version",
2512
- "description": ""
2513
- },
2514
- {
2515
- "column_name": "vul_date_changed",
2516
- "type": "DATETIMETZ",
2517
- "label": "Vulnerability Last Change",
2518
- "description": ""
2519
- },
2520
- {
2521
- "column_name": "latest_package_version",
2522
- "type": "STRING",
2523
- "label": "Dependency Latest Version",
2524
- "description": ""
2525
- },
2526
- {
2527
- "column_name": "attestation_ids",
2528
- "type": "LONGINTEGERARRAY",
2529
- "label": "Attestation IDs",
2530
- "description": ""
2531
- },
2532
- {
2533
- "column_name": "cpes",
2534
- "type": "STRINGARRAY",
2535
- "label": "Dependency CPEs",
2536
- "description": ""
2537
- },
2538
- {
2539
- "column_name": "advisory_modified",
2540
- "type": "DATETIMETZ",
2541
- "label": "Advisory Modified",
2542
- "description": ""
2543
- },
2544
- {
2545
- "column_name": "hyper_links",
2546
- "type": "STRINGARRAY",
2547
- "label": "Hyper Links",
2548
- "description": ""
2549
- },
2550
- {
2551
- "column_name": "has_kev",
2552
- "type": "BOOLEAN",
2553
- "label": "Has KEV",
2554
- "description": ""
2555
- },
2556
- {
2557
- "column_name": "base_score",
2558
- "type": "FLOAT",
2559
- "label": "Base Score",
2560
- "description": ""
2561
- },
2562
- {
2563
- "column_name": "vul_component_created",
2564
- "type": "DATETIMETZ",
2565
- "label": "Dependency Date",
2566
- "description": ""
2567
- },
2568
- {
2569
- "column_name": "version_timestamp",
2570
- "type": "DATETIMETZ",
2571
- "label": "Version Timestamp",
2572
- "description": ""
2573
- },
2574
- {
2575
- "column_name": "advisory_justification",
2576
- "type": "STRING",
2577
- "label": "Advisory Justification",
2578
- "description": ""
2579
- },
2580
- {
2581
- "column_name": "attestation_name",
2582
- "type": "STRING",
2583
- "label": "Attestation Name",
2584
- "description": ""
2585
- },
2586
- {
2587
- "column_name": "advisory_status",
2588
- "type": "STRING",
2589
- "label": "Advisory Status",
2590
- "description": ""
2591
- },
2592
- {
2593
- "column_name": "advisory_text",
2594
- "type": "STRING",
2595
- "label": "Advisory Text",
2596
- "description": ""
2597
- },
2598
- {
2599
- "column_name": "tag",
2600
- "type": "STRING",
2601
- "label": "Component Version",
2602
- "description": ""
2603
- },
2604
- {
2605
- "column_name": "component_id",
2606
- "type": "LONGINTEGER",
2607
- "label": "Dependency ID",
2608
- "description": ""
2609
- },
2610
- {
2611
- "column_name": "component_purl",
2612
- "type": "STRING",
2613
- "label": "Dependency PURL",
2614
- "description": ""
2615
- },
2616
- {
2617
- "column_name": "component_locations",
2618
- "type": "STRING",
2619
- "label": "Dependency Locations",
2620
- "description": ""
2621
- },
2622
- {
2623
- "column_name": "component_version",
2624
- "type": "STRING",
2625
- "label": "Dependency Version",
2626
- "description": ""
2627
- },
2628
- {
2629
- "column_name": "final_severity",
2630
- "type": "INTEGER",
2631
- "label": "Final Severity",
2632
- "description": ""
2633
- },
2634
- {
2635
- "column_name": "severity",
2636
- "type": "INTEGER",
2637
- "label": "Original Severity",
2638
- "description": ""
2639
- },
2640
- {
2641
- "column_name": "main_tool",
2642
- "type": "STRING",
2643
- "label": "Main Tool",
2644
- "description": ""
2645
- },
2646
- {
2647
- "column_name": "cvss_score",
2648
- "type": "FLOAT",
2649
- "label": "CVSS",
2650
- "description": ""
2651
- },
2652
- {
2653
- "column_name": "vul_published_on",
2654
- "type": "DATETIMETZ",
2655
- "label": "Published",
2656
- "description": ""
2657
- },
2658
- {
2659
- "column_name": "epssProbability",
2660
- "type": "FLOAT",
2661
- "label": "EPSS",
2662
- "description": ""
2663
- },
2664
- {
2665
- "column_name": "cwes",
2666
- "type": "JSONB",
2667
- "label": "CWE_Object",
2668
- "description": ""
2669
- },
2670
- {
2671
- "column_name": "vendor",
2672
- "type": "JSONB",
2673
- "label": "Vendor",
2674
- "description": ""
2675
- },
2676
- {
2677
- "column_name": "targetName",
2678
- "type": "STRING",
2679
- "label": "Component",
2680
- "description": ""
2681
- },
2682
- {
2683
- "column_name": "vulnerability_id",
2684
- "type": "STRING",
2685
- "label": "ID",
2686
- "description": ""
2687
- },
2688
- {
2689
- "column_name": "component_name",
2690
- "type": "STRING",
2691
- "label": "Dependency",
2692
- "description": ""
2693
- },
2694
- {
2695
- "column_name": "product_id",
2696
- "type": "LONGINTEGER",
2697
- "label": "Product Id",
2698
- "description": ""
2699
- },
2700
- {
2701
- "column_name": "source_layer",
2702
- "type": "STRING",
2703
- "label": "Layer",
2704
- "description": ""
2705
- },
2706
- {
2707
- "column_name": "labels",
2708
- "type": "STRING",
2709
- "label": "Labels",
2710
- "description": ""
2711
- },
2712
- {
2713
- "column_name": "logical_app",
2714
- "type": "STRING",
2715
- "label": "Product",
2716
- "description": ""
2717
- },
2718
- {
2719
- "column_name": "vul_hyperlinks",
2720
- "type": "STRING",
2721
- "label": "References",
2722
- "description": ""
2723
- },
2724
- {
2725
- "column_name": "vul_source",
2726
- "type": "STRING",
2727
- "label": "Source",
2728
- "description": ""
2729
- },
2730
- {
2731
- "column_name": "targets",
2732
- "type": "STRING",
2733
- "label": "Targets",
2734
- "description": ""
2735
- },
2736
- {
2737
- "column_name": "text",
2738
- "type": "STRING",
2739
- "label": "Text",
2740
- "description": ""
2741
- },
2742
- {
2743
- "column_name": "tool",
2744
- "type": "STRING",
2745
- "label": "Tool",
2746
- "description": ""
2747
- },
2748
- {
2749
- "column_name": "logical_app_version",
2750
- "type": "STRING",
2751
- "label": "Version",
2752
- "description": ""
2753
- },
2754
- {
2755
- "column_name": "vector",
2756
- "type": "STRING",
2757
- "label": "Vector",
2758
- "description": ""
2759
- },
2760
- {
2761
- "column_name": "component_dependency_type",
2762
- "type": "STRINGARRAY",
2763
- "label": "Component Dependency Type",
2764
- "description": ""
2765
- },
2766
- {
2767
- "column_name": "update",
2768
- "type": "BOOLEAN",
2769
- "label": "Update",
2770
- "description": ""
2771
- },
2772
- {
2773
- "column_name": "epssScoreDate",
2774
- "type": "DATETIMETZ",
2775
- "label": "Epssscoredate",
2776
- "description": ""
2777
- },
2778
- {
2779
- "column_name": "epssPercentile",
2780
- "type": "FLOAT",
2781
- "label": "Epsspercentile",
2782
- "description": ""
2783
- },
2784
- {
2785
- "column_name": "teamId",
2786
- "type": "LONGINTEGER",
2787
- "label": "Teamid",
2788
- "description": ""
2789
- },
2790
- {
2791
- "column_name": "vul_adv_id",
2792
- "type": "LONGINTEGER",
2793
- "label": "Vul Adv Id",
2794
- "description": ""
2795
- },
2796
- {
2797
- "column_name": "pipeline_run_id",
2798
- "type": "LONGINTEGER",
2799
- "label": "Pipeline Run Id",
2800
- "description": ""
2801
- },
2802
- {
2803
- "column_name": "id",
2804
- "type": "LONGINTEGER",
2805
- "label": "Id",
2806
- "description": ""
2807
- },
2808
- {
2809
- "column_name": "base_severity_string",
2810
- "type": "STRING",
2811
- "label": "Base Severity String",
2812
- "description": ""
2813
- },
2814
- {
2815
- "column_name": "severity_string",
2816
- "type": "STRING",
2817
- "label": "Severity String",
2818
- "description": ""
2819
- },
2820
- {
2821
- "column_name": "pkg",
2822
- "type": "STRING",
2823
- "label": "Pkg",
2824
- "description": ""
2825
- }
2826
- ]
2827
- }
2828
- }
2829
- ],
2830
- "query_findings": [
2831
- {
2832
- "name": "query_findings"
2833
- },
2834
- {
2835
- "description": "Use this function to answer questions about security findings from tools, such as severities, CWE types, affected components, or file locations. Use it when asking about issues found in scans, their severity, tool origin, or impacted products."
2836
- },
2837
- {
2838
- "params": {
2839
- "input_parameters": [
2840
- {
2841
- "name": "question",
2842
- "type": "string",
2843
- "description": "Human readable question about information in teh company database",
2844
- "required": true
2845
- }
2846
- ],
2847
- "output_schema": {
2848
- "type": "object",
2849
- "properties": {
2850
- "columns": {
2851
- "type": "array",
2852
- "items": {
2853
- "type": "string"
2854
- },
2855
- "description": "Only include necessary columns. Each column must match the columnTable documentation. DO NOT invent columns."
2856
- },
2857
- "filters": {
2858
- "type": "array",
2859
- "items": {
2860
- "type": "object",
2861
- "properties": {
2862
- "col": {
2863
- "type": "string"
2864
- },
2865
- "op": {
2866
- "type": "string"
2867
- },
2868
- "val": {}
2869
- },
2870
- "required": [
2871
- "col",
2872
- "op",
2873
- "val"
2874
- ]
2875
- },
2876
- "description": "Use operators: ==, !=, >, <, >=, <=, in, not in, is null, is not null. Use 'extras' key for like/ilike."
2877
- },
2878
- "metrics": {
2879
- "type": "array",
2880
- "minItems": 0,
2881
- "items": {
2882
- "type": "object",
2883
- "properties": {
2884
- "label": {
2885
- "type": "string",
2886
- "description": "Name of the output column for the metric"
2887
- },
2888
- "expressionType": {
2889
- "type": "string",
2890
- "enum": [
2891
- "SQL",
2892
- "SIMPLE"
2893
- ],
2894
- "description": "Type of expression used. Typically 'SQL'."
2895
- },
2896
- "sqlExpression": {
2897
- "type": "string",
2898
- "description": "SQL expression to calculate the metric, such as 'COUNT(*)' or 'AVG(score)'"
2899
- }
2900
- },
2901
- "required": [
2902
- "label",
2903
- "expressionType",
2904
- "sqlExpression"
2905
- ]
2906
- },
2907
- "description": "Either an empty array, or an array of expression objects with 'label', 'expressionType', and 'sqlExpression'."
2908
- },
2909
- "orderby": {
2910
- "type": "array",
2911
- "minItems": 0,
2912
- "items": {
2913
- "type": "array",
2914
- "items": [
2915
- {
2916
- "type": "string",
2917
- "description": "Column name"
2918
- },
2919
- {
2920
- "type": "boolean",
2921
- "description": "Column name. To sort in acending order use False and in decending order use True"
2922
- }
2923
- ],
2924
- "minItems": 2,
2925
- "maxItems": 2
2926
- },
2927
- "description": "Either an empty array, or a list of [column_name, is_ascending] pairs. Column must be in 'columns'."
2928
- },
2929
- "groupby": {
2930
- "type": "array",
2931
- "description": "Optional list of column names to group results by. Grouping is used to aggregate rows that share the same values in the specified columns, often used in combination with metrics.",
2932
- "minItems": 0,
2933
- "items": {
2934
- "type": "string",
2935
- "description": "A column name to group by, should be one or more of the\u00df columns used in the columns item"
2936
- }
2937
- },
2938
- "row_limit": {
2939
- "type": "integer",
2940
- "default": 10,
2941
- "description": "Default: 10, max: 30."
2942
- }
2943
- },
2944
- "required": [
2945
- "columns",
2946
- "filters",
2947
- "metrics",
2948
- "orderby",
2949
- "grouby",
2950
- "row_limit"
2951
- ]
2952
- },
2953
- "example": {
2954
- "input": "Human readable question",
2955
- "output": {
2956
- "columns": [
2957
- "column_name1",
2958
- "column_name2"
2959
- ],
2960
- "filters": [
2961
- {
2962
- "col": "column_name",
2963
- "op": "operator",
2964
- "val": "value"
2965
- }
2966
- ],
2967
- "metrics": [
2968
- {
2969
- "label": "column_name",
2970
- "expressionType": "expression",
2971
- "sqlExpression": "SQL expression to calculate the metric"
2972
- }
2973
- ],
2974
- "orderby": [
2975
- [
2976
- "column_name",
2977
- "(true) or (false)"
2978
- ]
2979
- ],
2980
- "row_limit": 10
2981
- }
2982
- }
2983
- }
2984
- },
2985
- {
2986
- "examples": [
2987
- {
2988
- "input": "What are the high-severity findings across all tools?",
2989
- "output": {
2990
- "columns": [
2991
- "title",
2992
- "severity_string",
2993
- "main_tool",
2994
- "logical_app"
2995
- ],
2996
- "filters": [
2997
- {
2998
- "col": "severity_string",
2999
- "op": "in",
3000
- "val": [
3001
- "HIGH",
3002
- "CRITICAL"
3003
- ]
3004
- }
3005
- ],
3006
- "metrics": [],
3007
- "groupby": [],
3008
- "orderby": [
3009
- [
3010
- "severity_string",
3011
- true
3012
- ]
3013
- ],
3014
- "row_limit": 30
3015
- }
3016
- },
3017
- {
3018
- "input": "How many findings exist for each product?",
3019
- "output": {
3020
- "columns": [
3021
- "logical_app"
3022
- ],
3023
- "filters": [],
3024
- "metrics": [
3025
- {
3026
- "label": "finding_count",
3027
- "expressionType": "SQL",
3028
- "sqlExpression": "COUNT(*)"
3029
- }
3030
- ],
3031
- "groupby": [
3032
- "logical_app"
3033
- ],
3034
- "orderby": [
3035
- [
3036
- "finding_count",
3037
- true
3038
- ]
3039
- ],
3040
- "row_limit": 30
3041
- }
3042
- },
3043
- {
3044
- "input": "Show me findings with a CVSS score above 7.",
3045
- "output": {
3046
- "columns": [
3047
- "title",
3048
- "cvssv3",
3049
- "logical_app",
3050
- "component_name"
3051
- ],
3052
- "filters": [
3053
- {
3054
- "col": "cvssv3",
3055
- "op": ">",
3056
- "val": "7"
3057
- }
3058
- ],
3059
- "metrics": [],
3060
- "groupby": [],
3061
- "orderby": [],
3062
- "row_limit": 30
3063
- }
3064
- },
3065
- {
3066
- "input": "Which tools produce the most findings?",
3067
- "output": {
3068
- "columns": [
3069
- "main_tool"
3070
- ],
3071
- "filters": [],
3072
- "metrics": [
3073
- {
3074
- "label": "total_findings",
3075
- "expressionType": "SQL",
3076
- "sqlExpression": "COUNT(*)"
3077
- }
3078
- ],
3079
- "groupby": [
3080
- "main_tool"
3081
- ],
3082
- "orderby": [
3083
- [
3084
- "total_findings",
3085
- true
3086
- ]
3087
- ],
3088
- "row_limit": 30
3089
- }
3090
- },
3091
- {
3092
- "input": "What types of CWEs are most commonly reported?",
3093
- "output": {
3094
- "columns": [
3095
- "cwe_id"
3096
- ],
3097
- "filters": [],
3098
- "metrics": [
3099
- {
3100
- "label": "cwe_count",
3101
- "expressionType": "SQL",
3102
- "sqlExpression": "COUNT(*)"
3103
- }
3104
- ],
3105
- "groupby": [
3106
- "cwe_id"
3107
- ],
3108
- "orderby": [
3109
- [
3110
- "cwe_count",
3111
- true
3112
- ]
3113
- ],
3114
- "row_limit": 30
3115
- }
3116
- }
3117
- ]
3118
- },
3119
- {
3120
- "ColumnTables": {
3121
- "columns": [
3122
- {
3123
- "column_name": "more",
3124
- "type": "",
3125
- "label": " ",
3126
- "description": ""
3127
- },
3128
- {
3129
- "column_name": "severity_order",
3130
- "type": "STRING",
3131
- "label": "Severity Order",
3132
- "description": ""
3133
- },
3134
- {
3135
- "column_name": "attack_vector",
3136
- "type": "",
3137
- "label": "Attack Vector",
3138
- "description": ""
3139
- },
3140
- {
3141
- "column_name": "availability_impact",
3142
- "type": "",
3143
- "label": "Availability Impact",
3144
- "description": ""
3145
- },
3146
- {
3147
- "column_name": "confidentiality_impact",
3148
- "type": "",
3149
- "label": "Confidentiality Impact",
3150
- "description": ""
3151
- },
3152
- {
3153
- "column_name": "integrity_impact",
3154
- "type": "",
3155
- "label": "Integrity Impact",
3156
- "description": ""
3157
- },
3158
- {
3159
- "column_name": "Severity",
3160
- "type": "",
3161
- "label": "Severity",
3162
- "description": ""
3163
- },
3164
- {
3165
- "column_name": "attack_complexity",
3166
- "type": "",
3167
- "label": "Attack Complexity",
3168
- "description": ""
3169
- },
3170
- {
3171
- "column_name": "attestation_id",
3172
- "type": "LONGINTEGER",
3173
- "label": "Evidence ID",
3174
- "description": ""
3175
- },
3176
- {
3177
- "column_name": "cvssv3",
3178
- "type": "STRING",
3179
- "label": "CVSSv3",
3180
- "description": ""
3181
- },
3182
- {
3183
- "column_name": "created",
3184
- "type": "DATETIMETZ",
3185
- "label": "Created",
3186
- "description": ""
3187
- },
3188
- {
3189
- "column_name": "cwe_id",
3190
- "type": "STRING",
3191
- "label": "CWE",
3192
- "description": ""
3193
- },
3194
- {
3195
- "column_name": "targetName",
3196
- "type": "STRING",
3197
- "label": "Component",
3198
- "description": ""
3199
- },
3200
- {
3201
- "column_name": "id",
3202
- "type": "LONGINTEGER",
3203
- "label": "ID",
3204
- "description": ""
3205
- },
3206
- {
3207
- "column_name": "component_name",
3208
- "type": "STRING",
3209
- "label": "Dependency",
3210
- "description": ""
3211
- },
3212
- {
3213
- "column_name": "description",
3214
- "type": "STRING",
3215
- "label": "Description",
3216
- "description": ""
3217
- },
3218
- {
3219
- "column_name": "line",
3220
- "type": "INTEGER",
3221
- "label": "Line",
3222
- "description": ""
3223
- },
3224
- {
3225
- "column_name": "severity",
3226
- "type": "INTEGER",
3227
- "label": "Severity",
3228
- "description": ""
3229
- },
3230
- {
3231
- "column_name": "parser",
3232
- "type": "STRING",
3233
- "label": "Parser",
3234
- "description": ""
3235
- },
3236
- {
3237
- "column_name": "logical_app",
3238
- "type": "STRING",
3239
- "label": "Product",
3240
- "description": ""
3241
- },
3242
- {
3243
- "column_name": "file_path",
3244
- "type": "STRING",
3245
- "label": "Path",
3246
- "description": ""
3247
- },
3248
- {
3249
- "column_name": "severity_string",
3250
- "type": "STRING",
3251
- "label": "Severity",
3252
- "description": ""
3253
- },
3254
- {
3255
- "column_name": "main_tool",
3256
- "type": "STRING",
3257
- "label": "Tool",
3258
- "description": ""
3259
- },
3260
- {
3261
- "column_name": "title",
3262
- "type": "STRING",
3263
- "label": "Title",
3264
- "description": ""
3265
- },
3266
- {
3267
- "column_name": "logical_app_version",
3268
- "type": "STRING",
3269
- "label": "Version",
3270
- "description": ""
3271
- },
3272
- {
3273
- "column_name": "finding",
3274
- "type": "JSONB",
3275
- "label": "Finding",
3276
- "description": ""
3277
- },
3278
- {
3279
- "column_name": "context",
3280
- "type": "JSONB",
3281
- "label": "Context",
3282
- "description": ""
3283
- },
3284
- {
3285
- "column_name": "teamId",
3286
- "type": "LONGINTEGER",
3287
- "label": "Teamid",
3288
- "description": ""
3289
- },
3290
- {
3291
- "column_name": "original_attestation_id",
3292
- "type": "LONGINTEGER",
3293
- "label": "Original Attestation Id",
3294
- "description": ""
3295
- },
3296
- {
3297
- "column_name": "product_id",
3298
- "type": "LONGINTEGER",
3299
- "label": "Product Id",
3300
- "description": ""
3301
- },
3302
- {
3303
- "column_name": "pipeline_id",
3304
- "type": "LONGINTEGER",
3305
- "label": "Pipeline Id",
3306
- "description": ""
3307
- }
3308
- ]
3309
- }
3310
- }
3311
- ]
3312
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mcp_app/toolsDescriptions/updateToolDocs.py DELETED
@@ -1,86 +0,0 @@
1
- from collections import defaultdict
2
- from pathlib import Path
3
- import json
4
-
5
-
6
- writeDocumention = Path(__file__).parent / "tool_docs.json"
7
- queryExamples = Path(__file__).parent / "queryExamples.json"
8
- queryParams = Path(__file__).parent / "queryParams.json"
9
- queryDescription = Path(__file__).parent / "queryDescription.json"
10
- queryTables = Path(__file__).parent / "queryTables.json"
11
- functionDocumention = Path(__file__).parent / "functionDocumention.json"
12
- retrieveTables = Path(__file__).parent.parent.parent / "docs/dataset_tables.json"
13
-
14
- endpoints = {"query_lineage": "extended_lineage_new", "query_policy_results": "policy_initiative","query_products": "asbom_filtered","query_risk": "product_risk_1.0", "query_vulnerabilities": "API Vulnerabilities", "query_findings": "Findings"}
15
-
16
-
17
- """
18
- The function can accept querystr as either a JSON object (dict) or a string. If using a JSON object, set format="json"; otherwise, the default is to treat querystr as a plain string.
19
- """
20
- def addExample(function: str, question: str, querystr):
21
- try:
22
- with open(queryExamples, "r+") as f:
23
- data = json.load(f)
24
- except:
25
- data = {}
26
- if function not in endpoints.keys(): raise "Not a valid function"
27
- try:
28
- querystr = json.loads(querystr)
29
- except:
30
- pass
31
- if function not in data: data[function] = []
32
- for i in range(len(data[function])):
33
- if data[function][i]["input"] == question: return
34
- data[function].append({"input": question,"output": querystr})
35
- with open(queryExamples, "w") as f:
36
- json.dump(data, fp=f, indent=2)
37
-
38
- def addDescription(function: str, description: str):
39
- with open(queryDescription, "r+") as f:
40
- data = json.load(f)
41
- data[function] = description
42
- with open(queryDescription, "w") as f:
43
- json.dump(data, fp=f, indent=2)
44
-
45
- def updateTables():
46
- with open(retrieveTables, "r") as f:
47
- data = json.load(f)
48
- tables = {}
49
- for key, value in endpoints.items():
50
- del data[value]["md"]
51
- tables[key] = data[value]
52
- with open(queryTables, "w") as f:
53
- json.dump(tables, fp=f, indent=2)
54
-
55
- def updateToolDescription():
56
- with open(queryExamples, "r") as f:
57
- examples = json.load(f)
58
- with open(queryParams, "r") as f:
59
- params = json.load(f)
60
- with open(queryDescription, "r") as f:
61
- descriptions = json.load(f)
62
- with open(queryTables, "r") as f:
63
- tables = json.load(f)
64
- endpointDocumention = defaultdict(list)
65
- with open(writeDocumention, "w") as f:
66
- for endpoint in endpoints.keys():
67
- endpointDocumention[endpoint].append({"name": endpoint})
68
- endpointDocumention[endpoint].append({"description": descriptions[endpoint]})
69
- endpointDocumention[endpoint].append({"params": params})
70
- endpointDocumention[endpoint].append({"examples": examples[endpoint]})
71
- endpointDocumention[endpoint].append({"ColumnTables": tables[endpoint]})
72
- json.dump(endpointDocumention, fp=f, indent=2)
73
-
74
- def parseDoc():
75
- with open(functionDocumention, "r") as f:
76
- data = json.load(f)
77
- name, description, tableName = data["name"], data["description"], data["tableName"]
78
- endpoints[name] = tableName
79
- for item in data["examples"].values():
80
- addExample(function=name, question=item["question"], querystr=item["querystr"])
81
- addDescription(name, description=description)
82
- updateTables()
83
- updateToolDescription()
84
-
85
- if __name__ == "__main__":
86
- updateToolDescription()