@@ -102,6 +102,7 @@ class TestOutputEngine(unittest.TestCase):
102102 cvss_version = 2 ,
103103 cvss_vector = "C:H" ,
104104 data_source = "NVD" ,
105+ last_modified = "01-05-2019" ,
105106 ),
106107 CVE (
107108 "CVE-1234-1234" ,
@@ -110,6 +111,7 @@ class TestOutputEngine(unittest.TestCase):
110111 cvss_version = 2 ,
111112 cvss_vector = "CVSS2.0/C:H" ,
112113 data_source = "NVD" ,
114+ last_modified = "11-11-2021" ,
113115 ),
114116 ],
115117 paths = {"" },
@@ -123,6 +125,7 @@ class TestOutputEngine(unittest.TestCase):
123125 cvss_version = 3 ,
124126 cvss_vector = "CVSS3.0/C:H/I:L/A:M" ,
125127 data_source = "NVD" ,
128+ last_modified = "12-12-2020" ,
126129 )
127130 ],
128131 paths = {"" },
@@ -135,7 +138,8 @@ class TestOutputEngine(unittest.TestCase):
135138 score = 7.5 ,
136139 cvss_version = 2 ,
137140 cvss_vector = "C:H/I:L/A:M" ,
138- data_source = "NVD" ,
141+ data_source = "OSV" ,
142+ last_modified = "20-10-2012" ,
139143 )
140144 ],
141145 paths = {"" },
@@ -340,7 +344,7 @@ class TestOutputEngine(unittest.TestCase):
340344 "product" : "product1" ,
341345 "version" : "3.2.1.0" ,
342346 "cve_number" : "CVE-1234-1234" ,
343- "source" : "NVD " ,
347+ "source" : "OSV " ,
344348 "severity" : "HIGH" ,
345349 "score" : "7.5" ,
346350 "cvss_version" : "2" ,
@@ -610,6 +614,9 @@ class TestOutputEngine(unittest.TestCase):
610614 "vulnerabilities" : [
611615 {
612616 "id" : "CVE-1234-1234" ,
617+ "created" : "NOT_KNOWN" ,
618+ "published" : "NOT_KNOWN" ,
619+ "recommendation" : "" ,
613620 "source" : {
614621 "name" : "NVD" ,
615622 "url" : "https://nvd.nist.gov/vuln/detail/CVE-1234-1234" ,
@@ -626,22 +633,21 @@ class TestOutputEngine(unittest.TestCase):
626633 "vector" : "C:H" ,
627634 }
628635 ],
629- "cwes" : [],
630636 "description" : "" ,
631- "recommendation" : "" ,
632637 "advisories" : [],
633- "created" : "NOT_KNOWN" ,
634- "published" : "NOT_KNOWN" ,
635- "updated" : "NOT_KNOWN" ,
638+ "updated" : "01-05-2019" ,
636639 "analysis" : {
637640 "state" : "in_triage" ,
638641 "response" : [],
639642 "detail" : "NewFound" ,
640643 },
641- "affects" : [{"ref" : "urn:cdx:NOTKNOWN/1 #product0-1.0" }],
644+ "affects" : [{"ref" : "urn:cbt:1/vendor0 #product0-1.0" }],
642645 },
643646 {
644647 "id" : "CVE-1234-1234" ,
648+ "created" : "NOT_KNOWN" ,
649+ "published" : "NOT_KNOWN" ,
650+ "recommendation" : "" ,
645651 "source" : {
646652 "name" : "NVD" ,
647653 "url" : "https://nvd.nist.gov/vuln/detail/CVE-1234-1234" ,
@@ -658,22 +664,21 @@ class TestOutputEngine(unittest.TestCase):
658664 "vector" : "CVSS2.0/C:H" ,
659665 }
660666 ],
661- "cwes" : [],
662667 "description" : "" ,
663- "recommendation" : "" ,
664668 "advisories" : [],
665- "created" : "NOT_KNOWN" ,
666- "published" : "NOT_KNOWN" ,
667- "updated" : "NOT_KNOWN" ,
669+ "updated" : "11-11-2021" ,
668670 "analysis" : {
669671 "state" : "in_triage" ,
670672 "response" : [],
671673 "detail" : "NewFound" ,
672674 },
673- "affects" : [{"ref" : "urn:cdx:NOTKNOWN/1 #product0-1.0" }],
675+ "affects" : [{"ref" : "urn:cbt:1/vendor0 #product0-1.0" }],
674676 },
675677 {
676678 "id" : "CVE-1234-1234" ,
679+ "created" : "NOT_KNOWN" ,
680+ "published" : "NOT_KNOWN" ,
681+ "recommendation" : "" ,
677682 "source" : {
678683 "name" : "NVD" ,
679684 "url" : "https://nvd.nist.gov/vuln/detail/CVE-1234-1234" ,
@@ -690,25 +695,24 @@ class TestOutputEngine(unittest.TestCase):
690695 "vector" : "CVSS3.0/C:H/I:L/A:M" ,
691696 }
692697 ],
693- "cwes" : [],
694698 "description" : "" ,
695- "recommendation" : "" ,
696699 "advisories" : [],
697- "created" : "NOT_KNOWN" ,
698- "published" : "NOT_KNOWN" ,
699- "updated" : "NOT_KNOWN" ,
700+ "updated" : "12-12-2020" ,
700701 "analysis" : {
701702 "state" : "in_triage" ,
702703 "response" : [],
703704 "detail" : "NewFound" ,
704705 },
705- "affects" : [{"ref" : "urn:cdx:NOTKNOWN/1 #product0-2.8.6" }],
706+ "affects" : [{"ref" : "urn:cbt:1/vendor0 #product0-2.8.6" }],
706707 },
707708 {
708709 "id" : "CVE-1234-1234" ,
710+ "created" : "NOT_KNOWN" ,
711+ "published" : "NOT_KNOWN" ,
712+ "recommendation" : "" ,
709713 "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" ,
712716 },
713717 "ratings" : [
714718 {
@@ -722,19 +726,15 @@ class TestOutputEngine(unittest.TestCase):
722726 "vector" : "C:H/I:L/A:M" ,
723727 }
724728 ],
725- "cwes" : [],
726729 "description" : "" ,
727- "recommendation" : "" ,
728730 "advisories" : [],
729- "created" : "NOT_KNOWN" ,
730- "published" : "NOT_KNOWN" ,
731- "updated" : "NOT_KNOWN" ,
731+ "updated" : "20-10-2012" ,
732732 "analysis" : {
733733 "state" : "in_triage" ,
734734 "response" : [],
735735 "detail" : "NewFound" ,
736736 },
737- "affects" : [{"ref" : "urn:cdx:NOTKNOWN/1 #product1-3.2.1.0" }],
737+ "affects" : [{"ref" : "urn:cbt:1/vendor1 #product1-3.2.1.0" }],
738738 },
739739 ],
740740 }
@@ -781,6 +781,7 @@ def test_output_csv(self):
781781
782782 def test_output_vex (self ):
783783 """Test creating VEX formatted file"""
784+ self .maxDiff = None
784785 self .output_engine .generate_vex (self .MOCK_OUTPUT , "test.vex" )
785786 with open ("test.vex" ) as f :
786787 vex_json = json .load (f )
@@ -839,7 +840,7 @@ def test_output_console(self):
839840 "│ vendor0 │ product0 │ 1.0 │ CVE-1234-1234 │ NVD │ MEDIUM │ 4.2 (v2) │\n "
840841 "│ vendor0 │ product0 │ 1.0 │ CVE-1234-1234 │ NVD │ LOW │ 1.2 (v2) │\n "
841842 "│ 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 "
843844 "└─────────┴──────────┴─────────┴───────────────┴────────┴──────────┴──────────────────────┘\n "
844845 )
845846
@@ -912,7 +913,7 @@ def test_output_console_outfile(self):
912913 "│ vendor0 │ product0 │ 1.0 │ CVE-1234-1234 │ NVD │ MEDIUM │ 4.2 (v2) │\n "
913914 "│ vendor0 │ product0 │ 1.0 │ CVE-1234-1234 │ NVD │ LOW │ 1.2 (v2) │\n "
914915 "│ 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 "
916917 "└─────────┴──────────┴─────────┴───────────────┴────────┴──────────┴──────────────────────┘\n "
917918 )
918919
0 commit comments