Skip to content

Commit 996c7b8

Browse files
committed
Undo added 'vuls scan' options
1 parent e082409 commit 996c7b8

File tree

5 files changed

+7
-11
lines changed

5 files changed

+7
-11
lines changed

GNUmakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ endif
171171

172172
mkdir -p ${ONE_SEC_AFTER_JSON_DIR}
173173
sleep 1
174-
./vuls.new scan -trivy-cachedb-dir=./integration/data/trivy-cache -trivy-skip-java-db-update -config=./integration/int-config.toml --results-dir=${BASE_DIR} ${LIBS}
174+
./vuls.new scan -config=./integration/int-config.toml --results-dir=${BASE_DIR} ${LIBS}
175175
cp -f ${BASE_DIR}/$(CURRENT)/*.json ${ONE_SEC_AFTER_JSON_DIR}
176176
cp integration/data/results/*.json ${ONE_SEC_AFTER_JSON_DIR}
177177
./vuls.new report --format-json --refresh-cve --results-dir=${BASE_DIR} -config=./integration/int-redis-config.toml ${ONE_SEC_AFTER}

config/config.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ type Config struct {
2929
logging.LogOpts
3030

3131
// scan, report
32-
HTTPProxy string `valid:"url" json:"httpProxy,omitempty"`
33-
ResultsDir string `json:"resultsDir,omitempty"`
34-
Pipe bool `json:"pipe,omitempty"`
35-
TrivyCacheDBDir string `json:"trivyCacheDBDir,omitempty"`
32+
HTTPProxy string `valid:"url" json:"httpProxy,omitempty"`
33+
ResultsDir string `json:"resultsDir,omitempty"`
34+
Pipe bool `json:"pipe,omitempty"`
3635

3736
Default ServerInfo `json:"default,omitempty"`
3837
Servers map[string]ServerInfo `json:"servers,omitempty"`
@@ -79,6 +78,7 @@ type ScanOpts struct {
7978
type ReportOpts struct {
8079
CvssScoreOver float64 `json:"cvssScoreOver,omitempty"`
8180
ConfidenceScoreOver int `json:"confidenceScoreOver,omitempty"`
81+
TrivyCacheDBDir string `json:"trivyCacheDBDir,omitempty"`
8282
NoProgress bool `json:"noProgress,omitempty"`
8383
RefreshCve bool `json:"refreshCve,omitempty"`
8484
IgnoreUnfixed bool `json:"ignoreUnfixed,omitempty"`

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ require (
1313
github.com/aquasecurity/go-dep-parser v0.0.0-20231120074854-8322cc2242bf
1414
github.com/aquasecurity/trivy v0.48.0
1515
github.com/aquasecurity/trivy-db v0.0.0-20231005141211-4fc651f7ac8d
16-
github.com/aquasecurity/trivy-java-db v0.0.0-20230209231723-7cddb1406728
1716
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
1817
github.com/aws/aws-sdk-go v1.48.4
1918
github.com/c-robinson/iplib v1.0.7
@@ -108,6 +107,7 @@ require (
108107
github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46 // indirect
109108
github.com/aquasecurity/go-version v0.0.0-20210121072130-637058cfe492 // indirect
110109
github.com/aquasecurity/trivy-iac v0.7.0 // indirect
110+
github.com/aquasecurity/trivy-java-db v0.0.0-20230209231723-7cddb1406728 // indirect
111111
github.com/aquasecurity/trivy-policies v0.6.1-0.20231120231532-f6f2330bf842 // indirect
112112
github.com/aws/aws-sdk-go-v2 v1.22.1 // indirect
113113
github.com/aws/aws-sdk-go-v2/config v1.18.45 // indirect

scanner/base.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,7 @@ func (l *base) scanLibraries() (err error) {
641641
l.log.Info("Scanning Language-specific Packages...")
642642

643643
if err := trivyInitOnce(); err != nil {
644-
logging.Log.Errorf("Trivy init error: %+v", err)
645-
return err
644+
return xerrors.Errorf("Failed to initialize Trivy. err: %w", err)
646645
}
647646

648647
found := map[string]bool{}

subcmds/scan.go

-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ func (*ScanCmd) Usage() string {
4444
[-log-to-file]
4545
[-log-dir=/path/to/log]
4646
[-cachedb-path=/path/to/cache.db]
47-
[-trivy-cachedb-dir=/path/to/dir]
48-
[-trivy-java-db-repository=ghcr.io/aquasecurity/trivy-java-db]
49-
[-trivy-skip-java-db-update]
5047
[-http-proxy=http://192.168.0.1:8080]
5148
[-timeout=300]
5249
[-timeout-scan=7200]

0 commit comments

Comments
 (0)