map openvas and make risk mapping common

This commit is contained in:
pemontto
2019-05-07 17:14:42 +01:00
parent 44d75c397f
commit c350ec73c2
6 changed files with 39 additions and 47 deletions

View File

@ -42,7 +42,6 @@ class NessusAPI(object):
'system type': 'category',
'vulnerability state': 'state'
}
SEVERITY_MAPPING = {'none': 0, 'low': 1, 'medium': 2, 'high': 3, 'critical': 4}
def __init__(self, hostname=None, port=None, username=None, password=None, verbose=True, profile=None, access_key=None, secret_key=None):
self.logger = logging.getLogger('NessusAPI')
@ -229,10 +228,6 @@ class NessusAPI(object):
df['protocol'] = df['protocol'].str.lower()
df['risk'] = df['risk'].str.lower()
# Map risk to a SEVERITY MAPPING value
self.logger.debug('Mapping risk to severity number')
df['risk_number'] = df['risk'].map(self.SEVERITY_MAPPING)
df.fillna('', inplace=True)
return df