@@ -102,6 +102,7 @@ class TestOutputEngine(unittest.TestCase):
102
102
cvss_version = 2 ,
103
103
cvss_vector = "C:H" ,
104
104
data_source = "NVD" ,
105
+ last_modified = "01-05-2019" ,
105
106
),
106
107
CVE (
107
108
"CVE-1234-1234" ,
@@ -110,6 +111,7 @@ class TestOutputEngine(unittest.TestCase):
110
111
cvss_version = 2 ,
111
112
cvss_vector = "CVSS2.0/C:H" ,
112
113
data_source = "NVD" ,
114
+ last_modified = "11-11-2021" ,
113
115
),
114
116
],
115
117
paths = {"" },
@@ -123,6 +125,7 @@ class TestOutputEngine(unittest.TestCase):
123
125
cvss_version = 3 ,
124
126
cvss_vector = "CVSS3.0/C:H/I:L/A:M" ,
125
127
data_source = "NVD" ,
128
+ last_modified = "12-12-2020" ,
126
129
)
127
130
],
128
131
paths = {"" },
@@ -135,7 +138,8 @@ class TestOutputEngine(unittest.TestCase):
135
138
score = 7.5 ,
136
139
cvss_version = 2 ,
137
140
cvss_vector = "C:H/I:L/A:M" ,
138
- data_source = "NVD" ,
141
+ data_source = "OSV" ,
142
+ last_modified = "20-10-2012" ,
139
143
)
140
144
],
141
145
paths = {"" },
@@ -340,7 +344,7 @@ class TestOutputEngine(unittest.TestCase):
340
344
"product" : "product1" ,
341
345
"version" : "3.2.1.0" ,
342
346
"cve_number" : "CVE-1234-1234" ,
343
- "source" : "NVD " ,
347
+ "source" : "OSV " ,
344
348
"severity" : "HIGH" ,
345
349
"score" : "7.5" ,
346
350
"cvss_version" : "2" ,
@@ -610,6 +614,9 @@ class TestOutputEngine(unittest.TestCase):
610
614
"vulnerabilities" : [
611
615
{
612
616
"id" : "CVE-1234-1234" ,
617
+ "created" : "NOT_KNOWN" ,
618
+ "published" : "NOT_KNOWN" ,
619
+ "recommendation" : "" ,
613
620
"source" : {
614
621
"name" : "NVD" ,
615
622
"url" : "https://nvd.nist.gov/vuln/detail/CVE-1234-1234" ,
@@ -626,22 +633,21 @@ class TestOutputEngine(unittest.TestCase):
626
633
"vector" : "C:H" ,
627
634
}
628
635
],
629
- "cwes" : [],
630
636
"description" : "" ,
631
- "recommendation" : "" ,
632
637
"advisories" : [],
633
- "created" : "NOT_KNOWN" ,
634
- "published" : "NOT_KNOWN" ,
635
- "updated" : "NOT_KNOWN" ,
638
+ "updated" : "01-05-2019" ,
636
639
"analysis" : {
637
640
"state" : "in_triage" ,
638
641
"response" : [],
639
642
"detail" : "NewFound" ,
640
643
},
641
- "affects" : [{"ref" : "urn:cdx:NOTKNOWN/1 #product0-1.0" }],
644
+ "affects" : [{"ref" : "urn:cbt:1/vendor0 #product0-1.0" }],
642
645
},
643
646
{
644
647
"id" : "CVE-1234-1234" ,
648
+ "created" : "NOT_KNOWN" ,
649
+ "published" : "NOT_KNOWN" ,
650
+ "recommendation" : "" ,
645
651
"source" : {
646
652
"name" : "NVD" ,
647
653
"url" : "https://nvd.nist.gov/vuln/detail/CVE-1234-1234" ,
@@ -658,22 +664,21 @@ class TestOutputEngine(unittest.TestCase):
658
664
"vector" : "CVSS2.0/C:H" ,
659
665
}
660
666
],
661
- "cwes" : [],
662
667
"description" : "" ,
663
- "recommendation" : "" ,
664
668
"advisories" : [],
665
- "created" : "NOT_KNOWN" ,
666
- "published" : "NOT_KNOWN" ,
667
- "updated" : "NOT_KNOWN" ,
669
+ "updated" : "11-11-2021" ,
668
670
"analysis" : {
669
671
"state" : "in_triage" ,
670
672
"response" : [],
671
673
"detail" : "NewFound" ,
672
674
},
673
- "affects" : [{"ref" : "urn:cdx:NOTKNOWN/1 #product0-1.0" }],
675
+ "affects" : [{"ref" : "urn:cbt:1/vendor0 #product0-1.0" }],
674
676
},
675
677
{
676
678
"id" : "CVE-1234-1234" ,
679
+ "created" : "NOT_KNOWN" ,
680
+ "published" : "NOT_KNOWN" ,
681
+ "recommendation" : "" ,
677
682
"source" : {
678
683
"name" : "NVD" ,
679
684
"url" : "https://nvd.nist.gov/vuln/detail/CVE-1234-1234" ,
@@ -690,25 +695,24 @@ class TestOutputEngine(unittest.TestCase):
690
695
"vector" : "CVSS3.0/C:H/I:L/A:M" ,
691
696
}
692
697
],
693
- "cwes" : [],
694
698
"description" : "" ,
695
- "recommendation" : "" ,
696
699
"advisories" : [],
697
- "created" : "NOT_KNOWN" ,
698
- "published" : "NOT_KNOWN" ,
699
- "updated" : "NOT_KNOWN" ,
700
+ "updated" : "12-12-2020" ,
700
701
"analysis" : {
701
702
"state" : "in_triage" ,
702
703
"response" : [],
703
704
"detail" : "NewFound" ,
704
705
},
705
- "affects" : [{"ref" : "urn:cdx:NOTKNOWN/1 #product0-2.8.6" }],
706
+ "affects" : [{"ref" : "urn:cbt:1/vendor0 #product0-2.8.6" }],
706
707
},
707
708
{
708
709
"id" : "CVE-1234-1234" ,
710
+ "created" : "NOT_KNOWN" ,
711
+ "published" : "NOT_KNOWN" ,
712
+ "recommendation" : "" ,
709
713
"source" : {
710
- "name" : "NVD " ,
711
- "url" : "https://nvd.nist.gov/vuln/detail/ CVE-1234-1234" ,
714
+ "name" : "OSV " ,
715
+ "url" : "https://osv.dev/list?ecosystem=&q= CVE-1234-1234" ,
712
716
},
713
717
"ratings" : [
714
718
{
@@ -722,19 +726,15 @@ class TestOutputEngine(unittest.TestCase):
722
726
"vector" : "C:H/I:L/A:M" ,
723
727
}
724
728
],
725
- "cwes" : [],
726
729
"description" : "" ,
727
- "recommendation" : "" ,
728
730
"advisories" : [],
729
- "created" : "NOT_KNOWN" ,
730
- "published" : "NOT_KNOWN" ,
731
- "updated" : "NOT_KNOWN" ,
731
+ "updated" : "20-10-2012" ,
732
732
"analysis" : {
733
733
"state" : "in_triage" ,
734
734
"response" : [],
735
735
"detail" : "NewFound" ,
736
736
},
737
- "affects" : [{"ref" : "urn:cdx:NOTKNOWN/1 #product1-3.2.1.0" }],
737
+ "affects" : [{"ref" : "urn:cbt:1/vendor1 #product1-3.2.1.0" }],
738
738
},
739
739
],
740
740
}
@@ -781,6 +781,7 @@ def test_output_csv(self):
781
781
782
782
def test_output_vex (self ):
783
783
"""Test creating VEX formatted file"""
784
+ self .maxDiff = None
784
785
self .output_engine .generate_vex (self .MOCK_OUTPUT , "test.vex" )
785
786
with open ("test.vex" ) as f :
786
787
vex_json = json .load (f )
@@ -839,7 +840,7 @@ def test_output_console(self):
839
840
"│ vendor0 │ product0 │ 1.0 │ CVE-1234-1234 │ NVD │ MEDIUM │ 4.2 (v2) │\n "
840
841
"│ vendor0 │ product0 │ 1.0 │ CVE-1234-1234 │ NVD │ LOW │ 1.2 (v2) │\n "
841
842
"│ vendor0 │ product0 │ 2.8.6 │ CVE-1234-1234 │ NVD │ LOW │ 2.5 (v3) │\n "
842
- "│ vendor1 │ product1 │ 3.2.1.0 │ CVE-1234-1234 │ NVD │ HIGH │ 7.5 (v2) │\n "
843
+ "│ vendor1 │ product1 │ 3.2.1.0 │ CVE-1234-1234 │ OSV │ HIGH │ 7.5 (v2) │\n "
843
844
"└─────────┴──────────┴─────────┴───────────────┴────────┴──────────┴──────────────────────┘\n "
844
845
)
845
846
@@ -912,7 +913,7 @@ def test_output_console_outfile(self):
912
913
"│ vendor0 │ product0 │ 1.0 │ CVE-1234-1234 │ NVD │ MEDIUM │ 4.2 (v2) │\n "
913
914
"│ vendor0 │ product0 │ 1.0 │ CVE-1234-1234 │ NVD │ LOW │ 1.2 (v2) │\n "
914
915
"│ vendor0 │ product0 │ 2.8.6 │ CVE-1234-1234 │ NVD │ LOW │ 2.5 (v3) │\n "
915
- "│ vendor1 │ product1 │ 3.2.1.0 │ CVE-1234-1234 │ NVD │ HIGH │ 7.5 (v2) │\n "
916
+ "│ vendor1 │ product1 │ 3.2.1.0 │ CVE-1234-1234 │ OSV │ HIGH │ 7.5 (v2) │\n "
916
917
"└─────────┴──────────┴─────────┴───────────────┴────────┴──────────┴──────────────────────┘\n "
917
918
)
918
919
0 commit comments