Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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