How to use the ospd.cvss.CVSS function in ospd

To help you get started, we’ve selected a few ospd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github greenbone / ospd-openvas / ospd_openvas / daemon.py View on Github external
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

ospd

OSPD is a base for scanner wrappers which share the same communication protocol: OSP (Open Scanner Protocol)

AGPL-3.0
Latest version published 3 years ago

Package Health Score

39 / 100
Full package analysis

Similar packages