Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
}
OID_SSH_AUTH = "1.3.6.1.4.1.25623.1.0.103591"
OID_SMB_AUTH = "1.3.6.1.4.1.25623.1.0.90023"
OID_ESXI_AUTH = "1.3.6.1.4.1.25623.1.0.105058"
OID_SNMP_AUTH = "1.3.6.1.4.1.25623.1.0.105076"
def _from_bool_to_str(value: int) -> str:
""" The OpenVAS scanner use yes and no as boolean values, whereas ospd
uses 1 and 0."""
return 'yes' if value == 1 else 'no'
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. """