Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_severity_score(self, vt_aux: dict) -> Optional[float]:
""" Return the severity score for the given oid.
Arguments:
vt_aux: VT element from which to get the severity vector
Returns:
The calculated cvss base value. None if there is no severity
vector or severity type is not cvss base version 2.
"""
if vt_aux:
severity_type = vt_aux['severities'].get('severity_type')
severity_vector = vt_aux['severities'].get('severity_base_vector')
if severity_type == "cvss_base_v2" and severity_vector:
return CVSS.cvss_base_v2_value(severity_vector)
return None