Skip to content

Commit

Permalink
✨ Update trivy command
Browse files Browse the repository at this point in the history
  • Loading branch information
tosone committed Feb 25, 2024
1 parent d74e83a commit c1ff365
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/daemon/scan/vulnerability.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ func runnerVulnerability(ctx context.Context, artifact *models.Artifact, statusC
if strings.HasPrefix(config.HTTP.InternalEndpoint, "https://") {
cmd.Args = append(cmd.Args, "--insecure")
}
cmd.Args = append(cmd.Args, "-q", "--format", "json", "--output", filename, "--registry-token", authorization, "--skip-db-update")
cmd.Args = append(cmd.Args, "-q", "--format", "json", "--scanners", "vuln", "--output", filename,
"--skip-db-update", "--skip-java-db-update")

Check warning on line 87 in pkg/daemon/scan/vulnerability.go

View check run for this annotation

Codecov / codecov/patch

pkg/daemon/scan/vulnerability.go#L86-L87

Added lines #L86 - L87 were not covered by tests
if utils.IsDir("/opt/trivy") {
cmd.Args = append(cmd.Args, "--offline-scan", "--cache-dir", "/opt/trivy")
}
cmd.Args = append(cmd.Args, image)
cmd.Env = append(cmd.Env, fmt.Sprintf("TRIVY_REGISTRY_TOKEN=%s", authorization))

Check warning on line 92 in pkg/daemon/scan/vulnerability.go

View check run for this annotation

Codecov / codecov/patch

pkg/daemon/scan/vulnerability.go#L92

Added line #L92 was not covered by tests
var stdout bytes.Buffer
var stderr bytes.Buffer
cmd.Stdout = &stdout
Expand Down

0 comments on commit c1ff365

Please sign in to comment.