Skip to content

Commit

Permalink
Added targets
Browse files Browse the repository at this point in the history
  • Loading branch information
carsongee committed Dec 27, 2023
1 parent 06848f4 commit ed5523c
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions contrib/html.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
table {
margin: 0 auto;
}
.pkg-path {
overflow-wrap: anywhere
}
.severity {
text-align: center;
font-weight: bold;
Expand Down Expand Up @@ -52,7 +55,9 @@
}
a.toggle-more-links { cursor: pointer; }
</style>
<title>{{- escapeXML ( index . 0 ).Target }} - Trivy Report - {{ now }} </title>
<title>
Trivy Report - {{ now }}
</title>
<script>
window.onload = function() {
document.querySelectorAll('td.links').forEach(function(linkCell) {
Expand Down Expand Up @@ -82,19 +87,22 @@
</script>
</head>
<body>
<h1>{{- escapeXML ( index . 0 ).Target }} - Trivy Report - {{ now }}</h1>
<h1>Trivy Report - {{ now }}</h1>
<table>
{{- range . }}
<tr class="group-header"><th colspan="6">{{ .Type | toString | escapeXML }}</th></tr>
<tr class="group-header">
<th colspan="7">Target: {{ escapeXML .Target }} &mdash; Type: {{ escapeXML .Type }}</th>
</tr>
{{- if (eq (len .Vulnerabilities) 0) }}
<tr><th colspan="6">No Vulnerabilities found</th></tr>
<tr><th colspan="7">No Vulnerabilities found</th></tr>
{{- else }}
<tr class="sub-header">
<th>Package</th>
<th>Vulnerability ID</th>
<th>Severity</th>
<th>Installed Version</th>
<th>Fixed Version</th>
<th>Package Path</th>
<th>Links</th>
</tr>
{{- range .Vulnerabilities }}
Expand All @@ -104,16 +112,17 @@
<td class="severity">{{ escapeXML .Vulnerability.Severity }}</td>
<td class="pkg-version">{{ escapeXML .InstalledVersion }}</td>
<td>{{ escapeXML .FixedVersion }}</td>
<td class="pkg-path">{{ escapeXML .PkgPath }}</td>
<td class="links" data-more-links="off">
{{- range .Vulnerability.References }}
<a href={{ escapeXML . | printf "%q" }}>{{ escapeXML . }}</a>
<a href={{ escapeXML . | printf "%q" }}>{{ abbrev 50 . | escapeXML }}</a>
{{- end }}
</td>
</tr>
{{- end }}
{{- end }}
{{- if (eq (len .Misconfigurations ) 0) }}
<tr><th colspan="6">No Misconfigurations found</th></tr>
<tr><th colspan="7">No Misconfigurations found</th></tr>
{{- else }}
<tr class="sub-header">
<th>Type</th>
Expand Down

0 comments on commit ed5523c

Please sign in to comment.