Skip to content

Commit

Permalink
Aggregate jar result for table (#1269)
Browse files Browse the repository at this point in the history
Co-authored-by: Teppei Fukuda <[email protected]>
  • Loading branch information
masahiro331 and knqyf263 authored Oct 4, 2021
1 parent b37f682 commit 1ebb329
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46
github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986
github.com/aquasecurity/fanal v0.0.0-20211003152019-761279c3f9c6
github.com/aquasecurity/fanal v0.0.0-20211004070100-eb291d3fb538
github.com/aquasecurity/go-dep-parser v0.0.0-20210919151457-76db061b9305
github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce
github.com/aquasecurity/go-npm-version v0.0.0-20201110091526-0b796d180798
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986 h1:2a30xLN2sUZcMXl50hg+PJCIDdJgIvIbVcKqLJ/ZrtM=
github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986/go.mod h1:NT+jyeCzXk6vXR5MTkdn4z64TgGfE5HMLC8qfj5unl8=
github.com/aquasecurity/fanal v0.0.0-20211003152019-761279c3f9c6 h1:RKgiEqKpv22QY3+p46EEoKmkpoS4toH1CNV0A6aKPro=
github.com/aquasecurity/fanal v0.0.0-20211003152019-761279c3f9c6/go.mod h1:FyKpqN6I6emeoEFdU3BKHyTpr47g2gwzIdJQDbm/Z+0=
github.com/aquasecurity/fanal v0.0.0-20211003111225-62545988ce3f h1:HS3cEuBKJ28l89UN9fg8IQWRX+AZKcpa6xZN0SNeCO4=
github.com/aquasecurity/fanal v0.0.0-20211003111225-62545988ce3f/go.mod h1:FyKpqN6I6emeoEFdU3BKHyTpr47g2gwzIdJQDbm/Z+0=
github.com/aquasecurity/fanal v0.0.0-20211004070100-eb291d3fb538 h1:uNPUl2xh88tYRhbduC9b9GruNwn8vF4eYTRRcD+urAU=
github.com/aquasecurity/fanal v0.0.0-20211004070100-eb291d3fb538/go.mod h1:FyKpqN6I6emeoEFdU3BKHyTpr47g2gwzIdJQDbm/Z+0=
github.com/aquasecurity/go-dep-parser v0.0.0-20210919151457-76db061b9305 h1:xsniAD6IrP+stY8tkytxE2tk8czkzSN3XaUvzoi1hCk=
github.com/aquasecurity/go-dep-parser v0.0.0-20210919151457-76db061b9305/go.mod h1:Zc7Eo6tFl9l4XcqsWeabD7jHnXRBK/LdgZuu9GTSVLU=
github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce h1:QgBRgJvtEOBtUXilDb1MLi1p1MWoyFDXAu5DEUl5nwM=
Expand Down
5 changes: 0 additions & 5 deletions pkg/report/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/fatih/color"
"github.com/olekukonko/tablewriter"

ftypes "github.com/aquasecurity/fanal/types"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy/pkg/types"
"github.com/aquasecurity/trivy/pkg/utils"
Expand All @@ -31,10 +30,6 @@ type TableWriter struct {
// Write writes the result on standard output
func (tw TableWriter) Write(report Report) error {
for _, result := range report.Results {
// Skip zero vulnerabilities on Java archives (JAR/WAR/EAR)
if result.Type == ftypes.Jar && len(result.Vulnerabilities) == 0 {
continue
}
tw.write(result)
}
return nil
Expand Down
1 change: 1 addition & 0 deletions pkg/scanner/local/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var (
ftypes.PythonPkg: "Python",
ftypes.GemSpec: "Ruby",
ftypes.NodePkg: "Node.js",
ftypes.Jar: "Java",
}
)

Expand Down

0 comments on commit 1ebb329

Please sign in to comment.