-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only print the config block when -version is present Change to be more verbose but more readable now it is not always printed. Also don't print the usage just because there were no patterns. Fixes #53867 Change-Id: I282a5332c11eef535286133fc2425afa7f46942b Reviewed-on: https://go-review.googlesource.com/c/vuln/+/519815 Run-TryBot: Ian Cottrell <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Maceo Thompson <[email protected]> Reviewed-by: Zvonimir Pavlinovic <[email protected]> Auto-Submit: Ian Cottrell <[email protected]>
- Loading branch information
Showing
26 changed files
with
49 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,6 @@ $ govulncheck -mode=binary notafile --> FAIL 2 | |
##### | ||
# Test of passing a non-binary file to -mode=binary | ||
$ govulncheck -mode=binary ${moddir}/vuln/go.mod --> FAIL 1 | ||
Using [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your binary for known vulnerabilities... | ||
|
||
govulncheck: could not parse provided binary: unrecognized file format | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
##### | ||
# Test basic binary scanning with text output | ||
$ govulncheck -mode=binary ${vuln_binary} --> FAIL 3 | ||
Using [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your binary for known vulnerabilities... | ||
|
||
Vulnerability #1: GO-2021-0265 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
##### | ||
# Test using the conversion from json on stdin to text on stdout | ||
$ govulncheck -mode=convert < convert_input.json | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your code and P packages across M dependent modules for known vulnerabilities... | ||
|
||
Vulnerability #1: GO-2021-0265 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
##### | ||
# Test of missing go.mod error message. | ||
$ govulncheck -C ${moddir}/nogomod . --> FAIL 1 | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
govulncheck: no go.mod file | ||
|
||
govulncheck only works with Go modules. Try navigating to your module directory. | ||
|
@@ -24,8 +22,6 @@ For details, run govulncheck -h. | |
##### | ||
# Test of handing an invalid package pattern to source mode | ||
$ govulncheck -C ${moddir}/vuln blah --> FAIL 1 | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
govulncheck: loading packages: | ||
There are errors with the provided package patterns: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
##### | ||
# Test souce mode with no callstacks | ||
$ govulncheck -C ${moddir}/informational -show=traces . | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your code and P packages across M dependent modules for known vulnerabilities... | ||
|
||
=== Informational === | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
##### | ||
# Test for multiple call stacks in source mode with expanded traces | ||
$ govulncheck -C ${moddir}/multientry . --> FAIL 3 | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your code and P packages across M dependent module for known vulnerabilities... | ||
|
||
Vulnerability #1: GO-2021-0113 | ||
|
@@ -25,8 +23,6 @@ Share feedback at https://go.dev/s/govulncheck-feedback. | |
##### | ||
# Test for multple call stacks in source mode with expanded traces | ||
$ govulncheck -C ${moddir}/multientry -show=traces ./... --> FAIL 3 | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your code and P packages across M dependent module for known vulnerabilities... | ||
|
||
Vulnerability #1: GO-2021-0113 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ | |
# Test of source mode on a module with a replace directive. | ||
|
||
$ govulncheck -C ${moddir}/replace ./... --> FAIL 3 | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your code and P packages across M dependent module for known vulnerabilities... | ||
|
||
Vulnerability #1: GO-2021-0113 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
##### | ||
# Test finding stdlib vulnerability in source mode | ||
$ govulncheck -C ${moddir}/stdlib . --> FAIL 3 | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your code and P packages across M dependent modules for known vulnerabilities... | ||
|
||
Vulnerability #1: GO-2022-0969 | ||
|
@@ -23,8 +21,6 @@ Share feedback at https://go.dev/s/govulncheck-feedback. | |
##### | ||
# Test finding stdlib vulnerability in source mode with expanded traces | ||
$ govulncheck -C ${moddir}/stdlib -show=traces . --> FAIL 3 | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your code and P packages across M dependent modules for known vulnerabilities... | ||
|
||
Vulnerability #1: GO-2022-0969 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
##### | ||
# Test govulncheck runs on the subdirectory of a module | ||
$ govulncheck -C ${moddir}/vuln/subdir . --> FAIL 3 | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your code and P packages across M dependent module for known vulnerabilities... | ||
|
||
Vulnerability #1: GO-2021-0113 | ||
|
@@ -24,8 +22,6 @@ Share feedback at https://go.dev/s/govulncheck-feedback. | |
##### | ||
# Test govulncheck runs on the subdirectory of a module | ||
$ govulncheck -C ${moddir}/vuln/subdir -show=traces . --> FAIL 3 | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your code and P packages across M dependent module for known vulnerabilities... | ||
|
||
Vulnerability #1: GO-2021-0113 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
##### | ||
# Test of basic govulncheck in source mode | ||
$ govulncheck -C ${moddir}/vuln ./... --> FAIL 3 | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your code and P packages across M dependent modules for known vulnerabilities... | ||
|
||
Vulnerability #1: GO-2021-0265 | ||
|
@@ -50,8 +48,6 @@ Share feedback at https://go.dev/s/govulncheck-feedback. | |
##### | ||
# Test of basic govulncheck in source mode with expanded traces | ||
$ govulncheck -C ${moddir}/vuln -show=traces ./... --> FAIL 3 | ||
Using go1.18 and [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your code and P packages across M dependent modules for known vulnerabilities... | ||
|
||
Vulnerability #1: GO-2021-0265 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# Test for stripped binaries (see #57764). | ||
|
||
$ govulncheck -mode=binary ${strip_binary} --> FAIL 3 | ||
Using [email protected] with vulnerability data from testdata/vulndb-v1 (last modified 01 Jan 21 00:00 UTC). | ||
|
||
Scanning your binary for known vulnerabilities... | ||
|
||
Vulnerability #1: GO-2021-0113 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,35 +25,26 @@ Usage: | |
comma-separated list of build tags | ||
-test | ||
analyze test files (only valid for source mode) | ||
-version | ||
print the version information | ||
|
||
For details, see https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck. | ||
|
||
##### | ||
# Same output as -h, but failure. | ||
$ govulncheck --> FAIL 2 | ||
Govulncheck reports known vulnerabilities in dependencies. | ||
# Not scanning anything. | ||
$ govulncheck | ||
No vulnerabilities found. | ||
|
||
Usage: | ||
Share feedback at https://go.dev/s/govulncheck-feedback. | ||
|
||
govulncheck [flags] [patterns] | ||
govulncheck -mode=binary [flags] [binary] | ||
##### | ||
# Reporting version without scanning anything. | ||
$ govulncheck -version | ||
Go: go1.18 | ||
Scanner: [email protected] | ||
DB: testdata/vulndb-v1 | ||
DB updated: 2023-04-03 15:57:51 +0000 UTC | ||
|
||
-C dir | ||
change to dir before running govulncheck | ||
-db url | ||
vulnerability database url (default "https://vuln.go.dev") | ||
-json | ||
output JSON | ||
-mode string | ||
supports source or binary (default "source") | ||
-scan string | ||
set the scanning level desired, one of module, package or symbol (default "symbol") | ||
-show list | ||
enable display of additional information specified by the comma separated list | ||
The only supported value is 'traces' | ||
-tags list | ||
comma-separated list of build tags | ||
-test | ||
analyze test files (only valid for source mode) | ||
No vulnerabilities found. | ||
|
||
For details, see https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck. | ||
Share feedback at https://go.dev/s/govulncheck-feedback. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.