Skip to content

Commit

Permalink
Create extended severities object.
Browse files Browse the repository at this point in the history
This is about the given values we might have at hand.
It is not yet considering multiple severities from a NVT though.
But if the internal severity structure has a origin or date,
then it will be considered already.
  • Loading branch information
janowagner committed Feb 9, 2020
1 parent d274530 commit 89e2a69
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ospd_openvas/daemon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2019 Greenbone Networks GmbH
# Copyright (C) 2019-2020 Greenbone Networks GmbH
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
Expand Down Expand Up @@ -560,13 +560,18 @@ def get_severities_vt_as_xml_str(vt_id: str, severities: Dict) -> str:
_severity = SubElement(_severities, 'severity')
if 'severity_base_vector' in severities:
try:
_severity.text = severities.get('severity_base_vector')
_value = SubElement(_severity, 'value')
_value.text = severities.get('severity_base_vector')
except ValueError as e:
logger.warning(
"Not possible to parse severity tag for vt %s: %s", vt_id, e
)
if 'severity_origin' in severities:
_severity.set('origin', severities.get('severity_origin'))
_origin = SubElement(_severity, 'origin')
_origin.text = severities.get('severity_origin')
if 'severity_date' in severities:
_date = SubElement(_severity, 'date')
_date.text = severities.get('severity_date')
if 'severity_type' in severities:
_severity.set('type', severities.get('severity_type'))

Expand Down

0 comments on commit 89e2a69

Please sign in to comment.