rename plugin to signature and cvss_x to cvss2_x
This commit is contained in:
@ -17,7 +17,7 @@ class NessusAPI(object):
|
||||
SCANS = '/scans'
|
||||
SCAN_ID = SCANS + '/{scan_id}'
|
||||
HOST_VULN = SCAN_ID + '/hosts/{host_id}'
|
||||
PLUGINS = HOST_VULN + '/plugins/{plugin_id}'
|
||||
PLUGINS = HOST_VULN + '/plugins/{signature_id}'
|
||||
EXPORT = SCAN_ID + '/export'
|
||||
EXPORT_TOKEN_DOWNLOAD = '/scans/exports/{token_id}/download'
|
||||
EXPORT_FILE_DOWNLOAD = EXPORT + '/{file_id}/download'
|
||||
@ -25,17 +25,19 @@ class NessusAPI(object):
|
||||
EXPORT_HISTORY = EXPORT + '?history_id={history_id}'
|
||||
# All column mappings should be lowercase
|
||||
COLUMN_MAPPING = {
|
||||
'cvss base score': 'cvss_base',
|
||||
'cvss temporal score': 'cvss_temporal',
|
||||
'cvss temporal vector': 'cvss_temporal_vector',
|
||||
'cvss base score': 'cvss2_base',
|
||||
'cvss temporal score': 'cvss2_temporal',
|
||||
'cvss temporal vector': 'cvss2_temporal_vector',
|
||||
'cvss vector': 'cvss2_vector',
|
||||
'cvss3 base score': 'cvss3_base',
|
||||
'cvss3 temporal score': 'cvss3_temporal',
|
||||
'cvss3 temporal vector': 'cvss3_temporal_vector',
|
||||
'fqdn': 'dns',
|
||||
'host': 'asset',
|
||||
'ip address': 'ip',
|
||||
'name': 'plugin_name',
|
||||
'name': 'signature',
|
||||
'os': 'operating_system',
|
||||
'plugin id': 'signature_id',
|
||||
'see also': 'exploitability',
|
||||
'system type': 'category',
|
||||
'vulnerability state': 'state'
|
||||
|
@ -83,10 +83,10 @@ class qualysVulnScan:
|
||||
'impact': 'synopsis',
|
||||
'ip_status': 'state',
|
||||
'os': 'operating_system',
|
||||
'qid': 'plugin_id',
|
||||
'qid': 'signature_id',
|
||||
'results': 'plugin_output',
|
||||
'threat': 'description',
|
||||
'title': 'plugin_name'
|
||||
'title': 'signature'
|
||||
}
|
||||
|
||||
SEVERITY_MAPPING = {0: 'none', 1: 'low', 2: 'medium', 3: 'high',4: 'critical'}
|
||||
@ -164,10 +164,12 @@ class qualysVulnScan:
|
||||
|
||||
# Contruct the CVSS vector
|
||||
self.logger.info('Extracting CVSS components')
|
||||
df['cvss_vector'] = df['cvss_base'].str.extract('\((.*)\)', expand=False)
|
||||
df['cvss_base'] = df['cvss_base'].str.extract('^(\d+(?:\.\d+)?)', expand=False)
|
||||
df['cvss_temporal_vector'] = df['cvss_temporal'].str.extract('\((.*)\)', expand=False)
|
||||
df['cvss_temporal'] = df['cvss_temporal'].str.extract('^(\d+(?:\.\d+)?)', expand=False)
|
||||
df['cvss2_vector'] = df['cvss_base'].str.extract('\((.*)\)', expand=False)
|
||||
df['cvss2_base'] = df['cvss_base'].str.extract('^(\d+(?:\.\d+)?)', expand=False)
|
||||
df['cvss2_temporal_vector'] = df['cvss_temporal'].str.extract('\((.*)\)', expand=False)
|
||||
df['cvss2_temporal'] = df['cvss_temporal'].str.extract('^(\d+(?:\.\d+)?)', expand=False)
|
||||
df.drop('cvss_base', axis=1, inplace=True, errors='ignore')
|
||||
df.drop('cvss_temporal', axis=1, inplace=True, errors='ignore')
|
||||
|
||||
# Set asset to ip
|
||||
df['asset'] = df['ip']
|
||||
|
@ -289,12 +289,12 @@ class qualysScanReport:
|
||||
'DescriptionSeverity': 'synopsis',
|
||||
'Evidence #1': 'evidence',
|
||||
'Payload #1': 'payload',
|
||||
'QID': 'plugin_id',
|
||||
'QID': 'signature_id',
|
||||
'Request Headers #1': 'request_headers',
|
||||
'Request Method #1': 'request_method',
|
||||
'Request URL #1': 'request_url',
|
||||
'Response #1': 'plugin_output',
|
||||
'Title': 'plugin_name',
|
||||
'Title': 'signature',
|
||||
'Url': 'uri',
|
||||
'URL': 'url',
|
||||
'Vulnerability Category': 'type',
|
||||
|
Reference in New Issue
Block a user