Skip to content

Commit

Permalink
feat(go): support binary scan (#948)
Browse files Browse the repository at this point in the history
* feature(gobinary) support gobinary scan

* chore(mod): update fanal

* update(go.mod) update trivy-db

Co-authored-by: knqyf263 <knqyf263@gmail.com>
  • Loading branch information
masahiro331 and knqyf263 committed Apr 29, 2021
1 parent d88b7cf commit c88bbbd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions go.mod
Expand Up @@ -6,13 +6,13 @@ require (
github.com/Masterminds/goutils v1.1.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986
github.com/aquasecurity/fanal v0.0.0-20210428003830-7c93bb21b7e9
github.com/aquasecurity/fanal v0.0.0-20210429142135-6e71d2a9d3be
github.com/aquasecurity/go-dep-parser v0.0.0-20210427143403-3c97ccc53976
github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce
github.com/aquasecurity/go-npm-version v0.0.0-20201110091526-0b796d180798
github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46
github.com/aquasecurity/go-version v0.0.0-20210121072130-637058cfe492
github.com/aquasecurity/trivy-db v0.0.0-20210214043256-acc144af2228
github.com/aquasecurity/trivy-db v0.0.0-20210429114658-ae22941a55d0
github.com/caarlos0/env/v6 v6.0.0
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/cheggaaa/pb/v3 v3.0.3
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Expand Up @@ -170,8 +170,8 @@ github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/
github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
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-20210428003830-7c93bb21b7e9 h1:/NfMmI0QxPwc5eonKtZSMeLgzZqvZozGW2pGorygbU8=
github.com/aquasecurity/fanal v0.0.0-20210428003830-7c93bb21b7e9/go.mod h1:cPTOJcf8bdP24oXhBsPVVczcjkICcApAwAOsn6CpHTI=
github.com/aquasecurity/fanal v0.0.0-20210429142135-6e71d2a9d3be h1:cOoE7ZjAResZdnJGPmwYBLr9J2gGyNl7uk7VMT4zKz4=
github.com/aquasecurity/fanal v0.0.0-20210429142135-6e71d2a9d3be/go.mod h1:cPTOJcf8bdP24oXhBsPVVczcjkICcApAwAOsn6CpHTI=
github.com/aquasecurity/go-dep-parser v0.0.0-20210427143403-3c97ccc53976 h1:ypl/IDxujzEymmwtzGJqQyboI2oZr1se+OoYaGqgBzQ=
github.com/aquasecurity/go-dep-parser v0.0.0-20210427143403-3c97ccc53976/go.mod h1:Cv/FOCXy6gwvDbz/KX48+y//SmbnKroFwW5hquXn5G4=
github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce h1:QgBRgJvtEOBtUXilDb1MLi1p1MWoyFDXAu5DEUl5nwM=
Expand All @@ -187,6 +187,8 @@ github.com/aquasecurity/testdocker v0.0.0-20210106133225-0b17fe083674 h1:Xq/HxWF
github.com/aquasecurity/testdocker v0.0.0-20210106133225-0b17fe083674/go.mod h1:psfu0MVaiTDLpNxCoNsTeILSKY2EICBwv345f3M+Ffs=
github.com/aquasecurity/trivy-db v0.0.0-20210214043256-acc144af2228 h1:Hl1eKVUApdGdMUNiSYWekViWccauKxscorOV2bc1cJE=
github.com/aquasecurity/trivy-db v0.0.0-20210214043256-acc144af2228/go.mod h1:N7CWA/vjVw78GWAdCJGhFQVqNGEA4e47a6eIWm+C/Bc=
github.com/aquasecurity/trivy-db v0.0.0-20210429114658-ae22941a55d0 h1:XSnx/roCF/yxA7f1wmjWdY0uYYvy4gDsFU0cOu5jF6M=
github.com/aquasecurity/trivy-db v0.0.0-20210429114658-ae22941a55d0/go.mod h1:N7CWA/vjVw78GWAdCJGhFQVqNGEA4e47a6eIWm+C/Bc=
github.com/aquasecurity/vuln-list-update v0.0.0-20191016075347-3d158c2bf9a2 h1:xbdUfr2KE4THsFx9CFWtWpU91lF+YhgP46moV94nYTA=
github.com/aquasecurity/vuln-list-update v0.0.0-20191016075347-3d158c2bf9a2/go.mod h1:6NhOP0CjZJL27bZZcaHECtzWdwDDm2g6yCY0QgXEGQQ=
github.com/araddon/dateparse v0.0.0-20190426192744-0d74ffceef83/go.mod h1:SLqhdZcd+dF3TEVL2RMoob5bBP5R1P1qkox+HtCBgGI=
Expand Down
5 changes: 5 additions & 0 deletions pkg/detector/library/driver.go
Expand Up @@ -39,6 +39,11 @@ func NewDriver(libType string) (Driver, error) {
driver = newNugetDriver()
case library.Jar:
driver = newMavenDriver()
case library.GoBinary:
driver = Driver{
ecosystem: vulnerability.Go,
advisories: []advisory{NewAdvisory(vulnerability.Go, comparer.GenericComparer{})},
}
default:
return Driver{}, xerrors.Errorf("unsupported type %s", libType)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/scanner/local/scan.go
Expand Up @@ -17,6 +17,7 @@ import (
_ "github.com/aquasecurity/fanal/analyzer/library/bundler"
_ "github.com/aquasecurity/fanal/analyzer/library/cargo"
_ "github.com/aquasecurity/fanal/analyzer/library/composer"
_ "github.com/aquasecurity/fanal/analyzer/library/gobinary"
_ "github.com/aquasecurity/fanal/analyzer/library/jar"
_ "github.com/aquasecurity/fanal/analyzer/library/npm"
_ "github.com/aquasecurity/fanal/analyzer/library/nuget"
Expand Down

0 comments on commit c88bbbd

Please sign in to comment.