trivy icon indicating copy to clipboard operation
trivy copied to clipboard

HTML template missing target names for go, npm, python/pip, java pom.xml, config files

Open jpinkham opened this issue 3 years ago • 6 comments

For many different types of files being scanned, the target names are not being reported in the HTML template, only the type of file. This makes it impossible to know which file contains the vulnerabilities and/or misconfigurations that were found.

  • The HTML title of the file is only for the first item scanned, all other items only list their type. It would be great if the title was set to directory, repo, or image that was scanned (.ArtifactName, .ArtifactType)
  • Now that config entries are included with the vulnerabilities (which is awesome btw, thanks!), it's slightly confusing to see entries with "No vulnerabilities found" that are followed immediately by what looks like a vulnerability (but is actually a misconfiguration) Trivy_HTML_report_confusing_mixed_findings

I happened to have a local clone of https://github.com/docker/awesome-compose available, which is good for scanning because it contains files of multiple types (except golang). I've attached the json output of the scan and the HTML output for comparison (for some reason GH doesn't support HTML or JSON file attachments....so I gzip'd them). I attached trivy results of Trivy as well, since it contains golang examples plus lots of config files.

And here's some screenshots of the lack of Target name: Trivy_HTML_report_AwesomeCompose Trivy_HTML_report_trivy_itself

awesome-compose.html.gz awesome-compose.json.gz trivy_results_of_trivy_itself.json.gz trivy_results_of_trivy_itself.html.gz

NOTE: These reports were generated with Trivy v0.22.0

jpinkham avatar Jan 09 '22 02:01 jpinkham

I've taken a first pass at tweaking the template to increase readability. This round was more about determining what data I can add to the page, vs fussing too much with styling. Feedback is welcome Trivy_HTML_report_trivy_itself__first_pass_html_reportchanges Trivy_HTML_report_trivy_itself__first_pass_html_reportchanges-2

jpinkham avatar Jan 09 '22 03:01 jpinkham

Was also facing this issue, where we scan a large number of .NET projects at the same time, and each project would only get the header "nuget". Would be great to see the modifications by @jpinkham implemented.

frjonsen avatar Feb 18 '22 10:02 frjonsen

@frjonsen you can use any custom templates for trivy results:

$ trivy image --format template --template @path/to/custom/html.tpl --output result.html alpine:latest

it seems that @jpinkham's changes are here: https://github.com/aquasecurity/trivy/commit/7b4fb9daadffa758337a9042ff37b057b602a772

afdesk avatar Feb 18 '22 12:02 afdesk

@afdesk and @frjonsen : thank you for providing the impetus to stop futzing with the template and finally submit a PR with my changes. Hopefully https://github.com/aquasecurity/trivy/pull/1741 will be reviewed soon.

jpinkham avatar Feb 26 '22 16:02 jpinkham

This issue is stale because it has been labeled with inactivity.

github-actions[bot] avatar Apr 28 '22 00:04 github-actions[bot]

I think this shouldn't be closed, I'd like to see this fixed at some point... And the PR hasn't been merged yet

jpvg10 avatar Jul 29 '22 08:07 jpvg10

Same issue here - please merge the PR

huornlmj avatar Mar 01 '23 12:03 huornlmj

This also applies when using Trivy's misconfiguration scanning AND filesystem scanning features.

huornlmj avatar Mar 01 '23 12:03 huornlmj

This issue is stale because it has been labeled with inactivity.

github-actions[bot] avatar Jul 21 '23 00:07 github-actions[bot]

Ping to keep this active. This is the official bundled HTML template and it's never worked properly. I think this should be fixed.

huornlmj avatar Jul 21 '23 08:07 huornlmj

Hi @huornlmj, we have a plan to extract the non-essential output options out of trivy so that the community can develop it, therefore we are reluctant to invest in these areas right now. related: https://github.com/aquasecurity/trivy/discussions/4451

itaysk avatar Jul 23 '23 06:07 itaysk

This issue is stale because it has been labeled with inactivity.

github-actions[bot] avatar Sep 23 '23 00:09 github-actions[bot]

Still an issue

huornlmj avatar Sep 25 '23 09:09 huornlmj