trivy

Trivy using HTML templates


Im running Trivy v0.49.1 from brew install trivy and I want to have my output formatted into a HTML file. The docs here say to run trivy image --format template --template "@contrib/html.tpl" -o report.html golang:1.12-alpine however, the resulting file only shows the text "html.tpl" and show no results.

When running locally I downloaded and pointed to this template html.tpl from their GitHub page here

Is there a reason why trivy config . --format template --template "html.tpl" -o report.html would fail to show findings when trivy config . --format json outputs results? It seems like the HTML file they provide is out of date or no longer works with the latest version?

Running with a --debug flag shows its finding results just not outputting them to the file. 2024-03-13T14:40:36.723Z DEBUG [misconf] 40:36.723172000 terraform.executor


Solution

  • For some reason, you have to prepend an @ to the file path.