Image Removed📙 You will learn
How to configure defect templates.
Prerequisites
Audience: IT Professional
Difficulty: Intermediate
Time needed: Approximately 20 minutes
Tools required: N/A
Velocity Templates
ThreadFix uses a Velocity template to generate defect descriptions. Velocity has also made available a comprehensive user guide.
Finding the Defect Description Template
Multiple defect templates can be defined at once. The original template is located at tomcat/webapps/threadfix/velocityTemplates/defect
with the name Classic_Description.vm. User files can be placed in this directory with any desired changes or the existing template updated as necessary. When submitting a defect through the ThreadFix UI, choose between any template file in this directory and they will appear within ThreadFix by their filename.
Samples Expand |
---|
title | Scanner Detail field - Click to expand |
---|
|
|
Expand |
---|
title | defectDescription.vm - click to expand |
---|
|
Code Block |
---|
#if( $metadata.preamble && $metadata.preamble != "" )
#header("General information")$br
$metadata.preamble$br
$br
#end
#set( $vulnIndex=0 )
#if( $vulnerabilities )
#foreach( $vulnerability in $vulnerabilities )
#if( $vulnerability.genericVulnerability && $vulnerability.surfaceLocation )
Vulnerability\[${vulnIndex}]: #addThreadfixLink( "${baseUrl}$vulnerability.getUri()" )$br
$vulnerability.genericVulnerability.name$br
CWE entry: http://cwe.mitre.org/data/definitions/${vulnerability.genericVulnerability.id}.html$br
#set( $dependencyFinding = "" )
#set( $staticFinding = "" )
#set( $dynamicFinding = "" )
#set( $dependencyFinding = $dependencyFindings.get($vulnerability) )
#set( $staticFinding = $staticFindings.get($vulnerability) )
#set( $dynamicFinding = $dynamicFindings.get($vulnerability) )
#if( $dependencyFinding && $dependencyFinding.getDependency() )
#set( $refId = "" )
#set( $refLink = "" )
#set( $componentName = "" )
#set( $refId = $dependencyFinding.getDependency().getRefId() )
#set( $refLink = $dependencyFinding.getDependency().getRefLink() )
#set( $componentName = $dependencyFinding.getDependency().getComponentName() )
#if( $refId != "" || $componentName != "" )
Vulnerability dependency:$br
#if( $refId != "" )Reference: $refId #if($refLink != "")($refLink)#end$br#end
#if( $componentName != "" )Component: $componentName$br#end
#end
#end
#if( $staticFinding && $staticFinding.getDataFlowElements() )
#set( $dataFlows = "" )
#set( $dataFlows = $staticFinding.getDataFlowElements() )
#if( $dataFlows != "")
Vulnerability source file location:$br
#foreach( $dataFlow in $dataFlows )
#set( $sourceFileLocation = "" )
#set( $lineNumber = "" )
#set( $sourceFileLocation = $dataFlow.getSourceFileName() )
#set( $lineNumber = $dataFlow.getLineNumber() )
#if( $sourceFileLocation != "" )
File: $sourceFileLocation#if($lineNumber != "") line $lineNumber#end$br
#end
#end
#end
#end
#if( $dynamicFinding && $dynamicFinding.surfaceLocation )
#set( $url = "" )
#set( $parameter = "" )
#set( $url = $dynamicFinding.surfaceLocation.getUrl() )
#set( $parameter = $dynamicFinding.surfaceLocation.parameter )
#if( $url != "" || $parameter != "" )
Vulnerability attack surface location:$br
#if( $url != "" )URL: ${url}#end$br
#if( $parameter != "" )Parameter: ${parameter}#end$br
#end
#end
#if($addFindingsDetails)
#addFindingsDetails( $vulnerability )
#end
#set( $vulnIndex = $vulnIndex + 1 )
#end
$br
#end
#if( $customTexts.size() > 0 )
#header("ThreadFix Custom Text:")$br
#foreach ($customText in $customTexts)
$customText
#end
#end
#end
|
|
Expand |
---|
title | Vulnerability Defect detailed view - Click to expand |
---|
|
|