Skip to content

Commit 4497f4c

Browse files
committed
Updated view template and details
1 parent f7e8244 commit 4497f4c

File tree

4 files changed

+44
-29
lines changed

4 files changed

+44
-29
lines changed

src/main/java/com/fortify/ssc/parser/owasp/dependencycheck/CustomVulnAttribute.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
*/
1515

1616
public enum CustomVulnAttribute implements com.fortify.plugin.spi.VulnerabilityAttribute {
17-
17+
fileName(AttrType.STRING),
18+
source(AttrType.STRING),
19+
name(AttrType.STRING),
20+
cveUrl(AttrType.STRING),
1821
notes(AttrType.STRING),
1922
cvssScore(AttrType.DECIMAL),
2023
cvssAccessVector(AttrType.STRING),

src/main/java/com/fortify/ssc/parser/owasp/dependencycheck/domain/Vulnerability.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
@Getter
3232
public final class Vulnerability {
33+
@JsonProperty private String source;
3334
@JsonProperty private String name;
3435
@JsonProperty private String severity;
3536
@JsonProperty private String description;

src/main/java/com/fortify/ssc/parser/owasp/dependencycheck/parser/VulnerabilitiesParser.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ private final void buildVulnerability(Dependency dependency, Vulnerability vulne
5858
vb.setKingdom(FortifyKingdom.ENVIRONMENT.getKingdomName());
5959
vb.setAnalyzer(FortifyAnalyser.CONFIGURATION.getAnalyserName());
6060
vb.setCategory("Insecure Deployment");
61-
vb.setSubCategory(vulnerability.getName());
61+
vb.setSubCategory("Vulnerable Dependency");
62+
63+
vb.setStringCustomAttributeValue(CustomVulnAttribute.fileName, dependency.getFileName());
64+
vb.setStringCustomAttributeValue(CustomVulnAttribute.source, vulnerability.getSource());
65+
vb.setStringCustomAttributeValue(CustomVulnAttribute.name, vulnerability.getName());
66+
vb.setStringCustomAttributeValue(CustomVulnAttribute.cveUrl, "https://nvd.nist.gov/vuln/detail/"+vulnerability.getName());
6267

6368
// Set mandatory values to JavaDoc-recommended values
6469
vb.setAccuracy(5.0f);

src/main/resources/viewtemplate/OWASPDependencyCheckTemplate.json

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,29 @@
22
[
33
{
44
"type": "template",
5-
"title": "Description",
6-
"key": "brief",
7-
"templateId": "SIMPLE",
8-
"dataType": "string"
9-
}
10-
],
11-
[
12-
{
13-
"type": "fieldset",
14-
"htmlClass": "container-spacer-bottom",
5+
"title": "Details",
6+
"templateId": "TITLEBOX",
157
"items": [
168
{
179
"type": "template",
1810
"title": "File name",
19-
"key": "fullFileName",
11+
"key": "customAttributes.fileName",
2012
"templateId": "SIMPLE",
2113
"dataType": "string"
2214
},
2315
{
2416
"type": "template",
25-
"title": "Impact",
26-
"key": "impact",
17+
"title": "Vulnerability",
18+
"key": "customAttributes.name",
2719
"templateId": "SIMPLE",
28-
"dataType": "float"
20+
"dataType": "string"
21+
},
22+
{
23+
"type": "template",
24+
"title": "Source",
25+
"key": "customAttributes.source",
26+
"templateId": "SIMPLE",
27+
"dataType": "string"
2928
},
3029
{
3130
"type": "template",
@@ -36,18 +35,32 @@
3635
},
3736
{
3837
"type": "template",
39-
"title": "CWE's",
38+
"title": "CWE",
4039
"key": "customAttributes.cwes",
4140
"templateId": "SIMPLE",
4241
"dataType": "string"
42+
},
43+
{
44+
"type": "template",
45+
"title": "CVE URL",
46+
"key": "customAttributes.cveUrl",
47+
"templateId": "SIMPLE",
48+
"dataType": "string"
4349
}
4450
]
51+
},
52+
{
53+
"type": "template",
54+
"title": "Description",
55+
"key": "brief",
56+
"templateId": "COLLAPSE",
57+
"dataType": "string"
4558
}
4659
],
4760
[
4861
{
4962
"type": "template",
50-
"title": "CVSS Information",
63+
"title": "CVSS 2.0",
5164
"templateId": "TITLEBOX",
5265
"items": [
5366
{
@@ -70,31 +83,24 @@
7083
"key": "customAttributes.cvssAccessComplexity",
7184
"templateId": "SIMPLE",
7285
"dataType": "string"
73-
}
74-
]
75-
},
76-
{
77-
"type": "template",
78-
"title": "CVSS IMPACT (CIA)",
79-
"templateId": "TITLEBOX",
80-
"items": [
86+
},
8187
{
8288
"type": "template",
83-
"title": "Confidentiality",
89+
"title": "Confidentiality Impact",
8490
"key": "customAttributes.cvssConfidentialImpact",
8591
"templateId": "SIMPLE",
8692
"dataType": "string"
8793
},
8894
{
8995
"type": "template",
90-
"title": "Integrity",
96+
"title": "Integrity Impact",
9197
"key": "customAttributes.cvssIntegrityImpact",
9298
"templateId": "SIMPLE",
9399
"dataType": "string"
94100
},
95101
{
96102
"type": "template",
97-
"title": "Availability",
103+
"title": "Availability Impact",
98104
"key": "customAttributes.cvssAvailabilityImpact",
99105
"templateId": "SIMPLE",
100106
"dataType": "string"

0 commit comments

Comments
 (0)