Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added Secrets to the HTML report #4071

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion contrib/html.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<td>{{ escapeXML .ID }}</td>
<td class="misconf-check">{{ escapeXML .Title }}</td>
<td class="severity">{{ escapeXML .Severity }}</td>
<td class="link" data-more-links="off" style="white-space:normal;"">
<td class="link" data-more-links="off" style="white-space:normal;">
{{ escapeXML .Message }}
<br>
<a href={{ escapeXML .PrimaryURL | printf "%q" }}>{{ escapeXML .PrimaryURL }}</a>
Expand All @@ -137,6 +137,28 @@
</tr>
{{- end }}
{{- end }}
{{- if (eq (len .Secrets ) 0) }}
<tr><th colspan="6">No Secrets found</th></tr>
{{- else }}
<tr class="sub-header">
<th>Category</th>
<th>Rule ID</th>
<th>Check</th>
<th>Severity</th>
<th>Match</th>
</tr>
{{- range .Secrets }}
<tr class="severity-{{ escapeXML .Severity }}">
<td class="secrets-category">{{ .Category }}</td>
<td>{{ escapeXML .RuleID }}</td>
<td class="secrets-check">{{ escapeXML .Title }}</td>
<td class="severity">{{ escapeXML .Severity }}</td>
<td style="overflow-wrap: anywhere; white-space:normal;">
{{ escapeXML .Match }}
</td>
</tr>
{{- end }}
{{- end }}
{{- end }}
</table>
{{- else }}
Expand Down
1 change: 1 addition & 0 deletions integration/testdata/alpine-310.html.golden
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
</td>
</tr>
<tr><th colspan="6">No Misconfigurations found</th></tr>
<tr><th colspan="6">No Secrets found</th></tr>
</table>
</body>
</html>