gotrivy
is a Golang helper for github.com/aquasecurity/trivy
(reference).
The primary purpose of this library is currently to create XSLX reports from a JSON report file. Trivy provides reports in Table and JSON formats, along with a custom Template capability. This libary provides an additional XLSX option via github.com/grokify/gocharts
. This can be run from the CLI as cmd/gotrivy/main.go
or it can be done programmatically by inspecting the code of that file.
gotrivy.Report
is an extension of github.com/aquasecurity/trivy/pkg/types.Report
.
go install github.com/grokify/gotrivy/cmd/gotrivy
gotrivy -i <path-to-report.json> [-o path-to-report.xlsx]
If an output file isn't provided, a default output filename and path is used setting the filename to the original filename with a .xlsx
suffix in the current directory.
The following is an example of scanning a local image:
% docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
grokify/ringcentral-permahooks v0.2.3 af80576e5e7d 6 months ago 640MB
% trivy image -f json grokify/ringcentral-permahooks > trivy-report.json
% gotrivy -i trivy-report.json -o trivy-report.xlsx