Mercurial > farol > farolluz
comparison farolluz/parsers/cvrf.py @ 1:d47e1164740f
Add support for AggregateSeverity
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Wed, 24 Sep 2014 08:26:56 +0200 |
parents | e18b61a73a68 |
children | d62264a643fb |
comparison
equal
deleted
inserted
replaced
0:e18b61a73a68 | 1:d47e1164740f |
---|---|
40 | 40 |
41 from ..cvrf import (CVRF, CVRFPublisher, CVRFTracking, CVRFRevision, CVRFNote, | 41 from ..cvrf import (CVRF, CVRFPublisher, CVRFTracking, CVRFRevision, CVRFNote, |
42 CVRFAcknowledgment, CVRFProductBranch, CVRFFullProductName, CVRFGenerator, | 42 CVRFAcknowledgment, CVRFProductBranch, CVRFFullProductName, CVRFGenerator, |
43 CVRFRelationship, CVRFVulnerability, CVRFVulnerabilityID, CVRFThreat, | 43 CVRFRelationship, CVRFVulnerability, CVRFVulnerabilityID, CVRFThreat, |
44 CVRFProductStatus, CVRFCVSSSet, CVRFReference, CVRFRemediation, CVRFGroup, | 44 CVRFProductStatus, CVRFCVSSSet, CVRFReference, CVRFRemediation, CVRFGroup, |
45 CVRFInvolvement, CVRFCWE, CVRFTrackingID) | 45 CVRFInvolvement, CVRFCWE, CVRFTrackingID, CVRFAggregateSeverity) |
46 | 46 |
47 NAMESPACES = { | 47 NAMESPACES = { |
48 'cvrf': "http://www.icasi.org/CVRF/schema/cvrf/1.1", | 48 'cvrf': "http://www.icasi.org/CVRF/schema/cvrf/1.1", |
49 'prod': "http://www.icasi.org/CVRF/schema/prod/1.1", | 49 'prod': "http://www.icasi.org/CVRF/schema/prod/1.1", |
50 'vuln': "http://www.icasi.org/CVRF/schema/vuln/1.1", | 50 'vuln': "http://www.icasi.org/CVRF/schema/vuln/1.1", |
296 if distr is not None: | 296 if distr is not None: |
297 doc.setDistribution(textwrap.dedent(distr).strip()) | 297 doc.setDistribution(textwrap.dedent(distr).strip()) |
298 | 298 |
299 # This is in a quite free format, not sure how to do something with it ... | 299 # This is in a quite free format, not sure how to do something with it ... |
300 xmlaggsev = cvrfdoc.find(UN('cvrf', 'AggregateSeverity')) | 300 xmlaggsev = cvrfdoc.find(UN('cvrf', 'AggregateSeverity')) |
301 if xmlaggsev is not None: | |
302 aggsev = CVRFAggregateSeverity(xmlaggsev.text.strip()) | |
303 if 'Namespace' in xmlaggsev.attrib: | |
304 aggsev.setNamespace(xmlaggsev.attrib['Namespace']) | |
305 doc.setAggregateSeverity(aggsev) | |
301 | 306 |
302 for xmlref in cvrfdoc.findall('/'.join([UN('cvrf', 'DocumentReferences'), UN('cvrf', 'Reference')])): | 307 for xmlref in cvrfdoc.findall('/'.join([UN('cvrf', 'DocumentReferences'), UN('cvrf', 'Reference')])): |
303 doc.addReference(parseReference(xmlref)) | 308 doc.addReference(parseReference(xmlref)) |
304 | 309 |
305 for cvrfack in cvrfdoc.findall('/'.join([UN('cvrf', 'Acknowledgments'), UN('cvrf', 'Acknowledgment')])): | 310 for cvrfack in cvrfdoc.findall('/'.join([UN('cvrf', 'Acknowledgments'), UN('cvrf', 'Acknowledgment')])): |