Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions oval/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ def references( cves, fixes, impact, public ) :
references = [ ]
for cve in cves :
cve_id = cve[ 'name' ]
references.append(
{
'id' : cve_id,
'url' : cve[ 'sourceLink' ],
'source' : cve[ 'sourceBy' ],
'cvss3' : cve[ 'cvss3BaseScore' ] + cve[ 'cvss3ScoringVector' ],
'cwe' : cve[ 'cwe' ],
'impact' : impact,
'public' : public,
'cve' : cve_id
}
)

# lookup bug for this cve (could be more efficient)
for bug in bugs :
Expand Down Expand Up @@ -148,9 +160,10 @@ def definitions( advisories, rl_version ) :
# create references
refs = references( advisory[ 'cves' ], advisory[ 'fixes' ], severity.lower( ), issued.replace( '-', '' ) )
for reference in refs :
id = reference[ 'bugdesc' ].split( ' ' )[ 0 ]
desc = reference[ 'bugdesc' ].replace( id, '' )
description = description + '*' + desc + '. (' + id + ')\n\n'
if 'bugdesc' in reference:
id = reference[ 'bugdesc' ].split( ' ' )[ 0 ]
desc = reference[ 'bugdesc' ].replace( id, '' )
description = description + '*' + desc + '. (' + id + ')\n\n'

# create definition
definitions.append(
Expand Down
7 changes: 4 additions & 3 deletions oval/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ def metadata( title, family, platforms, ref_id, source, references, description,
'" impact="' + reference[ 'impact' ] + '" public="' + \
reference[ 'public' ] + '">' + reference[ 'cve' ] + '</cve>\n'

bugs = bugs + \
' <bugzilla href="' + reference[ 'bugref' ] + '" id="' + \
reference[ 'bugid' ] + '">' + reference[ 'bugdesc' ] + '</bugzilla>\n'
if 'bugref' in reference:
bugs = bugs + \
' <bugzilla href="' + reference[ 'bugref' ] + '" id="' + \
reference[ 'bugid' ] + '">' + reference[ 'bugdesc' ] + '</bugzilla>\n'

xml = xml + \
cves + \
Expand Down