@@ -46,13 +46,9 @@ def import_cvss_bt() -> None:
46
46
settings = Settings .load ()
47
47
if int (cve_year ) <= current_year - settings .cvss_enrichment_max_age_years :
48
48
continue
49
- enriched_cvss_vector = row .get ("cvss-bt_vector" , "" )
50
- if not enriched_cvss_vector .startswith ("CVSS:3" ) and not enriched_cvss_vector .startswith ("CVSS:4" ):
51
- continue
52
49
53
50
enriched_cvss = Enriched_CVSS (
54
51
cve = cve ,
55
- enriched_cvss_vector = enriched_cvss_vector ,
56
52
base_cvss_vector = row .get ("base_vector" , "" ),
57
53
cisa_kev = row .get ("cisa_kev" , "" ).lower () == "true" ,
58
54
vulncheck_kev = row .get ("vulncheck_kev" , "" ).lower () == "true" ,
@@ -97,8 +93,6 @@ def enriched_cvss_apply_observations(settings: Settings) -> None:
97
93
"cvss3_vector" ,
98
94
"cvss4_score" ,
99
95
"cvss4_vector" ,
100
- "enriched_cvss_score" ,
101
- "enriched_cvss_vector" ,
102
96
"cve_found_in" ,
103
97
"current_severity" ,
104
98
],
@@ -115,37 +109,32 @@ def apply_enriched_cvss(observation: Observation, settings: Settings) -> bool:
115
109
if not enriched_cvss :
116
110
return False
117
111
118
- if observation .cvss3_vector and not enriched_cvss .enriched_cvss_vector .startswith (observation .cvss3_vector ):
119
- return False
120
- if observation .cvss4_vector and not enriched_cvss .enriched_cvss_vector .startswith (observation .cvss4_vector ):
121
- return False
122
-
123
- observation .enriched_cvss_vector = enriched_cvss .enriched_cvss_vector
124
- if enriched_cvss .enriched_cvss_vector .startswith ("CVSS:3" ):
125
- cvss = CVSS3 (observation .enriched_cvss_vector )
126
- observation .enriched_cvss_score = cvss .temporal_score
127
- else :
128
- cvss = CVSS4 (observation .enriched_cvss_vector )
129
- observation .enriched_cvss_score = cvss .base_score
112
+ cvss3_vector_before = observation .cvss3_vector
113
+ cvss4_vector_before = observation .cvss4_vector
114
+ cve_found_in_before = observation .cve_found_in
130
115
131
116
if not observation .cvss3_vector and enriched_cvss .base_cvss_vector .startswith ("CVSS:3" ):
132
117
observation .cvss3_vector = enriched_cvss .base_cvss_vector
133
118
cvss = CVSS3 (observation .cvss3_vector )
134
- observation .cvss3_score = cvss .temporal_score
119
+ observation .cvss3_score = cvss .base_score
135
120
if not observation .cvss4_vector and enriched_cvss .base_cvss_vector .startswith ("CVSS:4" ):
136
121
observation .cvss4_vector = enriched_cvss .base_cvss_vector
137
122
cvss = CVSS4 (observation .cvss4_vector )
138
123
observation .cvss4_score = cvss .base_score
139
124
140
125
_add_cve_found_in (observation , enriched_cvss )
141
126
142
- observation .current_severity = get_current_severity (observation )
127
+ if (
128
+ observation .cvss3_vector != cvss3_vector_before
129
+ or observation .cvss4_vector != cvss4_vector_before
130
+ or observation .cve_found_in != cve_found_in_before
131
+ ):
132
+ observation .current_severity = get_current_severity (observation )
133
+ return True
143
134
144
- return True
135
+ return False
145
136
else :
146
- if observation .enriched_cvss_score or observation .enriched_cvss_vector or observation .cve_found_in :
147
- observation .enriched_cvss_score = None
148
- observation .enriched_cvss_vector = ""
137
+ if observation .cve_found_in :
149
138
observation .cve_found_in = ""
150
139
observation .current_severity = get_current_severity (observation )
151
140
return True
@@ -157,8 +146,6 @@ def _add_cve_found_in(observation: Observation, enriched_cvss: Enriched_CVSS) ->
157
146
cve_found_in = []
158
147
if enriched_cvss .cisa_kev :
159
148
cve_found_in .append ("CISA KEV" )
160
- if enriched_cvss .vulncheck_kev :
161
- cve_found_in .append ("VulnCheck KEV" )
162
149
if enriched_cvss .exploitdb :
163
150
cve_found_in .append ("ExploitDB" )
164
151
if enriched_cvss .metasploit :
@@ -167,4 +154,6 @@ def _add_cve_found_in(observation: Observation, enriched_cvss: Enriched_CVSS) ->
167
154
cve_found_in .append ("Nuclei" )
168
155
if enriched_cvss .poc_github :
169
156
cve_found_in .append ("PoC GitHub" )
157
+ if enriched_cvss .vulncheck_kev :
158
+ cve_found_in .append ("VulnCheck KEV" )
170
159
observation .cve_found_in = ", " .join (cve_found_in )
0 commit comments