How to use the ospd.ospd.OSPDaemon 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
class OpenVasVtsFilter(VtsFilter):
    """ Methods to overwrite the ones in the original class.
    Each method formats the value to be compatible with the filter
    """

    def format_vt_modification_time(self, value: str) -> str:
        """ Convert the string seconds since epoch into a 19 character
        string representing YearMonthDayHourMinuteSecond,
        e.g. 20190319122532. This always refers to UTC.
        """

        return datetime.utcfromtimestamp(int(value)).strftime("%Y%m%d%H%M%S")


class OSPDopenvas(OSPDaemon):

    """ Class for ospd-openvas daemon. """

    def __init__(self, *, niceness=None, **kwargs):
        """ Initializes the ospd-openvas daemon's internal data. """

        super().__init__(customvtfilter=OpenVasVtsFilter(), **kwargs)

        self.server_version = __version__

        self._niceness = str(niceness)

        self.scanner_info['name'] = 'openvas'
        self.scanner_info['version'] = ''  # achieved during self.check()
        self.scanner_info['description'] = OSPD_DESC

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