Skip to content

Commit 9608ba8

Browse files
authored
add file location info to CVE scan report (#632)
* add file location info to CVE scan report * add file location info to CVE scan report
1 parent dcf05e6 commit 9608ba8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

jenkins/helper/generate_cve_report.py

+13
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
<th>Artifact type</th>
7474
<th>Artifact version</th>
7575
<th>Fixed version(s)</th>
76+
<th>Locations(s)</th>
7677
<tbody id="table-body">
7778
{% for scan in scans %}
7879
{% for vulnerability in scan.vulnerabilities %}
@@ -88,6 +89,11 @@
8889
<td>{{ vulnerability.artifact_type }}</td>
8990
<td>{{ vulnerability.artifact_version }}</td>
9091
<td>{{ vulnerability.fixed_versions }}</td>
92+
<td>
93+
{% for location in vulnerability.locations %}
94+
{{ location.path }}<br>
95+
{% endfor %}
96+
</td>
9197
</tr>
9298
{% endif %}
9399
{% endfor %}
@@ -104,6 +110,7 @@
104110
<th>Artifact type</th>
105111
<th>Artifact version</th>
106112
<th>Fixed version(s)</th>
113+
<th>Locations(s)</th>
107114
<tbody id="table-body">
108115
{% for scan in scans %}
109116
{% for vulnerability in scan.vulnerabilities %}
@@ -122,6 +129,11 @@
122129
<td>{{ vulnerability.artifact_type }}</td>
123130
<td>{{ vulnerability.artifact_version }}</td>
124131
<td>{{ vulnerability.fixed_versions }}</td>
132+
<td>
133+
{% for location in vulnerability.locations %}
134+
{{ location.path }}<br>
135+
{% endfor %}
136+
</td>
125137
</tr>
126138
{% endfor %}
127139
{% endfor %}
@@ -200,6 +212,7 @@
200212
vulnerability_entry["fixed_versions"] = "<br>".join(
201213
vulnerability.get("fix", {}).get("versions", [])
202214
)
215+
vulnerability_entry["locations"] = artifact.get("locations", [])
203216
table_entry["vulnerabilities"].append(vulnerability_entry)
204217
table_entry["vulnerabilities"] = sorted(
205218
table_entry["vulnerabilities"],

0 commit comments

Comments
 (0)