Skip to content

Commit

Permalink
fix: some more flaws with gitlab report format (#6193)
Browse files Browse the repository at this point in the history
  • Loading branch information
weyhmueller authored Dec 2, 2023
1 parent bb932af commit 038e353
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions core/src/main/resources/templates/gitlabReport.vsl
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,26 @@
## optional properties
"name": "$enc.json($vulnerability.name)",
"description": "$enc.json($vulnerability.description)",
#set($severity = $rpt.normalizeSeverity($vulnerability.cvssV3.cvssData.baseSeverity))
#if($vulnerability.unscoredSeverity)
#if($vulnerability.unscoredSeverity.equals("0.0"))
#set($severity = "Unknown")
#else
#set($severity = $rpt.normalizeSeverity($vulnerability.unscoredSeverity))
#end
#elseif($vulnerability.cvssV3 && $vulnerability.cvssV3.cvssData && $vulnerability.cvssV3.cvssData.baseSeverity)
#set($severity = $rpt.normalizeSeverity($vulnerability.cvssV3.cvssData.baseSeverity))
#elseif($vulnerability.cvssV2 && $vulnerability.cvssV2.cvssData && $vulnerability.cvssV2.cvssData.baseSeverity)
#set($severity = $rpt.normalizeSeverity($vulnerability.cvssV2.cvssData.baseSeverity))
#end
"severity": "$severity.substring(0,1).toUpperCase()$severity.substring(1)",
## "solution": "" --> not implemented
"links": [
#foreach( $ref in $vulnerability.getReferences(true) )
{
#if($ref.name)
## optional property
"name": "$enc.json($ref.name)",

## optional properties
#end
"url": "$enc.json($ref.url)"
}
#if( $foreach.hasNext ),#end
Expand All @@ -129,6 +140,7 @@
"package_manager": "maven",
"dependencies": [
#foreach( $dependency in $dependencies )
#if( $dependency.name )
{
"package": {
"name": "$enc.json($dependency.name)"
Expand All @@ -141,6 +153,7 @@
##"dependency_path": [] --> not implemented
}
#if( $foreach.hasNext ),#end
#end
#end
]
## no optional properties
Expand Down

0 comments on commit 038e353

Please sign in to comment.