Граф коммитов

1030 Коммитов

Автор SHA1 Сообщение Дата
Tim King 0481857dd0 cmd/govulncheck: set gotypesalias=1 when using >=1.23 toolchain
Set gotypesalias=1 when using >=1.23 toolchain on all of
the main packages in x/tools that use go/types.

This effectively upgrades commit https://go.dev/cl/617095.

For golang/go#69772

Change-Id: I9f3e64d348f6bffc75321a08145fde07fb4024a6
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/627715
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2024-11-13 22:13:01 +00:00
Gopher Robot d0fc691583 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I9293e80d25c605ff4f640bf4531655a53794ef12
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/626596
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-11-08 17:51:10 +00:00
Zvonimir Pavlinovic dba032fdf4 internal/sarif: use empty arrays instead of nils
Sarif specification requires that some slice elements explicitly exist
in the JSON output even if they are empty. For instance, results should
be an empty array if the sarif handler finished but found nothing.
Another example is tags. Each rule in govulncheck sarif has tags
property that can sometimes be empty. If so, JSON should contain an
empty slice of tags.

Fixes golang/go#70157

Change-Id: I112181e4efa5bc0a1577ff98f1b9eab912ed814c
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/625656
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Maceo Thompson <maceothompson@google.com>
2024-11-08 15:41:59 +00:00
Zvonimir Pavlinovic 47cd072037 cmd/govulncheck/testdata: expand set of go versions in fixup
An example is a multi-word release candidate.

Change-Id: Id5ef9ebd1ba94dad692d5ae8a74f03cb513f24a9
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/625576
Reviewed-by: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-11-05 20:14:42 +00:00
Maceo Thompson 3101014197 cmd/govulncheck: remove unused fixup
Change-Id: I465ad24e69cb77daa19b01b3dc9cf307ce300a57
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/621597
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-10-21 17:35:13 +00:00
Maceo Thompson 5234259f98 internal/scan: add amounts to sbom text output
Updates the sbom text output to include the number of root packages and
number of found/scanned modules in the sbom text output.

Change-Id: I3dd03031d3f8dbd348c3b807c661b4bb0b1b268b
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/621596
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2024-10-21 17:35:08 +00:00
Maceo Thompson 0de853d99e internal/scan: remove 'scanning n packages...' msg
Removes the "Scanning N packages across M dependent modules" progress
message, as it is superseded by the new SBOM message.

Change-Id: I53629e9b47b147399c65f15d7eb7ef3365b2730e
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/618296
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-10-11 16:36:09 +00:00
Maceo Thompson a23ae09c0e internal/scan: add SBOM to text output
Adds the SBOM message to the text output, hidden behind the -verbose
flag.

Change-Id: I15c808df1e15bd339cf27912c9afed04d7146ef8
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/618295
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-10-11 16:33:49 +00:00
Maceo Thompson 9124b27af3 internal/vulncheck: pass SBOM to handlers
Passes the SBOM message to the handlers when in source and binary mode.

Change-Id: Id3ef03eb4294f731a18739477e710edd85ab755e
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/616935
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-10-07 16:49:55 +00:00
Gopher Robot db75d0a826 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: Iab52f007bcc15baaf487223ecd2e5a00ea5bda41
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/617961
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-10-04 19:10:16 +00:00
Maceo Thompson 1aec043eeb internal/semver: add SemverToGoTag
Add SemverToGoTag, which reverses GoTagToSemver.
The exception is when converting a go tag to the semver would have
resulted in an invalid semver (such as go RC versions). GoTagToSemver
returns an empty string in that case, and as such is not reversible.

Change-Id: I8d68c2372261b1ec7ec8b72354ac1919ad24d6f6
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/617396
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2024-10-03 16:48:40 +00:00
Maceo Thompson fd700f3192 internal/govulncheck: add sbom message type
Adds a minimal SBOM message to govulncheck output. This message contains
information about the code that govulncheck is scanning, like the go
version used for the standard library, modules and their version, and
the root packages gathered from the user inputted package patterns.

Change-Id: I5db597ffaaa654394faea8dda82e1f18c5f5975a
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/616061
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-09-30 19:15:01 +00:00
Maceo Thompson bbef36d3e5 internal/openvex: refactor PURL
This changes the internal representation of a PURL to a struct that is
converted to a string. It will make other "purlFromX" functions less
redundant to write in the future.

Change-Id: I278f13ef175878c85b07341be510050f8d7f2c5d
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/615795
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-09-25 18:08:52 +00:00
Maceo Thompson bd80eaab95 internal/openvex: populate product subcomponents
Populates the "subcomponent" field of a outputted vex statement with the
PURL to the vulnerable dependency.

updates golang/go#68152

Change-Id: I9e7b9a6686744496b3409ee9d4d0f3d70917db45
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/598956
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2024-09-25 18:08:46 +00:00
Zvonimir Pavlinovic 2e326d4dd5 internal/scan: do not show stacks in traces mode for binaries
There are no stacks so the trace just contains the vulnerable symbol
that is anyhow communicated to the user.

Change-Id: I8a8ebcf3864f91150449dafe812f474a4a59bda8
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/614456
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Maceo Thompson <maceothompson@google.com>
2024-09-23 20:01:29 +00:00
Zvonimir Pavlinovic 3917389208 internal/scan: reorganize trace text layout in trace mode
As paths are relative, it is not immediately evident to what module
symbols belong to in traces mode. We hence reorganize things to make
that explicit while avoiding clutter.

Fixes golang/go#69490

Change-Id: Ic43e22954cbe3ff0ac458f75ee3a07706295fb5d
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/614135
Reviewed-by: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-09-19 16:28:06 +00:00
Gopher Robot 6a6005b578 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I483375b05b35cb8231c5b2250319efcf37b562af
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/611935
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Chase <drchase@google.com>
2024-09-09 16:15:04 +00:00
Zvonimir Pavlinovic 1e9d87e82f internal/vulncheck: remove use of ssautil.AllFunctions
This function was used to prune out the forward slice of functions
starting from roots. There weren't a lot of functions being pruned.
Measured on a few large projects, at most 0.08% of functions were
pruned. Keeping those functions is not expected to affect precision
or performance. Calling VTA two times will very likely get rid of
these functions anyhow.

Updates golang/go#69231

Change-Id: Id57f9697c5a5550b4d15fbeb88de30b8bee220da
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/611216
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2024-09-05 18:53:04 +00:00
Zvonimir Pavlinovic ff56115f39 cmd/govulncheck: update test file for main module vulnerabilities
As of https://go-review.git.corp.google.com/c/go/+/596035, go command
adds a version for a Go binary, not always defaulting to devel. That
causes a devel test to fail at go tip builders. This CL adds an explicit
binary with devel version rather than the test building its own binary.
Once the new Go version with the above fix is released, we'll add
another test.

Change-Id: I409d18c85a0fad9b424771bd330067ac987d4830
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/605855
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2024-08-22 13:44:43 +00:00
Zvonimir Pavlinovic ffdef74cc4 cmd/govulncheck: add docs on detecting main module vulns
This only applies to binaries.

Change-Id: Ia499e823a08a1b039cba72d5c06b5f3b2cd2f942
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/603575
Reviewed-by: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-07 17:29:48 +00:00
Gopher Robot 902ccc792c go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: If3475f07a842219f225392d2d2985f07e69cee08
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/603595
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-06 21:18:40 +00:00
Maceo Thompson 8579d869f8 cmd/govulncheck: update unit tests
Previously, unit tests using the "vuln" module did not have a
vulnerability that was imported but not called (a "package-level"
vulnerability). This change modifies main.go in the vuln module to
directly call a vulnerable function instead of using a function that
eventually was affected by multiple vulns.

Change-Id: Ic77a9c8efe3fd6dd2a2e76c230b3c4f67421e2fc
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/599476
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2024-07-22 20:18:20 +00:00
Zvonimir Pavlinovic 03865b626d internal/vulncheck: properly check for main package vulns
And add unit tests.

Change-Id: I311af8467a97c70677955aef7c9bee5edacdde09
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/599195
Reviewed-by: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-18 20:23:52 +00:00
Zvonimir Pavlinovic 079fa4db50 internal/vulncheck: explicitly exclude devel from affected ranges
For now, "(devel)" should never be matched.

Change-Id: Ia6b001caef1a1faf093b6757f3fb89d27e160bb2
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/598715
Reviewed-by: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-18 20:19:10 +00:00
Zvonimir Pavlinovic 201ff88d63 internal/vulncheck: consider main module when checking bin vulns
Tests will come later.

Change-Id: I82b478dc2f7613b65308807475a7f0cd43681937
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/598675
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Maceo Thompson <maceothompson@google.com>
2024-07-18 20:18:38 +00:00
Zvonimir Pavlinovic 0a7cb137c8 internal/vulncheck: exclude dev go versions from ancient check
When checking if a go version is ancient, exclude invalid go versions
such as "devel 12343...." This are considered earlier than go1.18.

Change-Id: Ifbd7bd2834284b8e7fd109ec34fa4a2b9c297e24
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/598716
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Zvonimir Pavlinovic <zpavlinovic@google.com>
Reviewed-by: Maceo Thompson <maceothompson@google.com>
2024-07-17 16:42:03 +00:00
Maceo Thompson 4ea4418106 internal/openvex: update handler test
Updates handler tests to have more accurate package paths.
This doesn't affect anything right now, but will be relevant for
future features/testing.

Change-Id: Ia72c749cdaf263d2a425f349f72630cda576b5f0
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/598593
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2024-07-16 17:36:44 +00:00
Russ Cox de0a0adbc1 LICENSE: update per Google Legal
Very minor tweaks:
 - Remove (c) pseudosymbol.
 - Remove "All Rights Reserved."
 - Change "Google Inc." (no longer exists) to "Google LLC".

[git-generate]
echo '
,s/\(c\) //
,s/ All rights reserved.//
,s/Google Inc./Google LLC/
w
q
' | sam -d LICENSE

Change-Id: Ie92bd7efd420f65bea524a6998c3d4c4e81a7274
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/598615
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
2024-07-16 16:15:35 +00:00
Zvonimir Pavlinovic 1884dfae5d internal/vulncheck: add warning message for ancient binaries
We emit a warning message for Go binaries built with an ancient Go
version.

Change-Id: I9c7037cb1710181786a7c063ae2a253f880dc6ad
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/597516
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Maceo Thompson <maceothompson@google.com>
2024-07-15 19:36:53 +00:00
Zvonimir Pavlinovic d9ad522384 all: remove build restrictions requiring go1.18
govulncheck's go.mod file explicitly requires go1.21 and it can analyze
binaries built before go1.18. There is no need to have these build
restrictions.

Change-Id: I50a80da2490fd4bd8fb3d5b7a68f8796ff3ffe18
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/597575
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Maceo Thompson <maceothompson@google.com>
2024-07-10 19:47:43 +00:00
Zvonimir Pavlinovic 44e45eaefb cmd/govulncheck: clarify unsafe/reflection limitations
They only apply to source mode.

Change-Id: I288adf8eac2075bb32b301b4ffe668f453352a77
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/597515
Reviewed-by: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-10 17:48:11 +00:00
Zvonimir Pavlinovic 601dd9b53b cmd/govulncheck: update docs for old Go binaries
Change-Id: I16c0da875b6b4a0a8dbd5957238158fae3450521
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/597318
Reviewed-by: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-10 17:48:05 +00:00
Maceo Thompson 0f7005f3db internal/openvex: omit vulns with no findings
This change modifies govulncheck's VEX output to no longer include
vulnerabilities that are not imported at a vulnerable version.
This matches the text output of govulncheck, and is in line with most
other vulnerability scanners.

updates golang/go#68338

Change-Id: If7041fd4624d023f623db8daf35a2e76f41d1d29
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/597396
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2024-07-09 20:20:14 +00:00
Zvonimir Pavlinovic f94421b204 cmd/govulncheck/integration: adjust k8s expectations
Due to a withdrawn containerd vuln.

Change-Id: I5734ea3a4336be6550d557753b980953a7ece49b
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/597315
Reviewed-by: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Zvonimir Pavlinovic <zpavlinovic@google.com>
2024-07-09 18:29:04 +00:00
Zvonimir Pavlinovic 684f5c9fa7 all: remove skipIfShort
We don't have any tests using it.

Change-Id: I72b24d505c0d9ec5cf9fce883bc04ed10f6bfd4f
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/595455
Auto-Submit: Zvonimir Pavlinovic <zpavlinovic@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Maceo Thompson <maceothompson@google.com>
2024-07-09 15:22:22 +00:00
Zvonimir Pavlinovic d52dedc621 all: remove unnecessary test lines for staticcheck
Change-Id: I42cb6ac7a4bb9b50ad2e6bff2e89b93f1e382d4b
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/595258
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Maceo Thompson <maceothompson@google.com>
Auto-Submit: Zvonimir Pavlinovic <zpavlinovic@google.com>
2024-07-09 15:22:15 +00:00
Zvonimir Pavlinovic afa91f17c8 internal/vulncheck: avoid recomputing if module is known
This also makes the code cleaner.

Change-Id: Ia59ed7dbf6487ee1ddcb67ffb05bd57668268e62
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/594217
Reviewed-by: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-09 15:22:08 +00:00
Gopher Robot 03a0c2f3be go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I9e76767f7dac4395908959032383f81e6f534a0a
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/596995
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-07 23:36:59 +00:00
Zvonimir Pavlinovic 675d16bf93 internal/buildinfo: add support for ancient Go binaries
As a result, govulncheck will report only stdlib vulnerabilities.

Change-Id: Ib9dd2445de41690b3e3122ad3789871b5d632441
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/595615
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2024-07-01 18:56:00 +00:00
Zvonimir Pavlinovic cfe93e3f19 internal/goversion: comment out a printing line
Change-Id: I09e59759e8843d0a5150cf6a0df5e9d6afefe8e0
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/595016
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2024-07-01 18:55:39 +00:00
Zvonimir Pavlinovic d6cadf9010 internal/goversion: add package as copy of rsc.io/goversion/version
This package will be mainly used to check ancient Go binaries.

Change-Id: Ie0bd6b2c4fc0610941905c93cdb63ed7260b66ba
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/595015
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2024-07-01 18:55:24 +00:00
Sean Liao deda8bb439 cmd/govulncheck: remove line about go version requirements
Use the go directive in go.mod as the single source of truth
for the required Go version for installing golvulncheck.

Updates golang/go#68034
Fixes golang/go#68256

Change-Id: Ief445ffa40282feff6a97419b48dc6290071d971
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/595935
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2024-07-01 13:22:55 +00:00
Zvonimir Pavlinovic 055425f86a internal/vulncheck: improve documentation
And refactor some code.

Change-Id: I658954d8670861cc36413c78c763cc2225716f15
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/594218
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2024-06-25 14:24:45 +00:00
Zvonimir Pavlinovic d44b651a2e internal/vulncheck: use module info when looking for symbols
When searching if (a symbol of a) package is vulnerable, we would try to
identify the module from package path. (The module information is needed
because we save vulns per module.) This can cause problems when module
paths are prefixes of each other. In all cases except binary mode, we
know the exact module of a symbol or a package, so we simply use that.

Change-Id: I21c220e485522dda1bc1fe0a9025e73846b6fd6f
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/592135
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Maceo Thompson <maceothompson@google.com>
2024-06-24 19:52:44 +00:00
Zvonimir Pavlinovic dd23607213 internal/vulncheck: handle symbols ending with .
For some binaries, a symbol can end in ".", so this CL handles that
case.

Change-Id: I7c3634eb9cc13ee4cd18d6787460e645dbbfdfae
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/594355
Reviewed-by: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-06-24 15:53:36 +00:00
Zvonimir Pavlinovic dfbdf8164c cmd/govulncheck/integration: make expectation check more robust
When checking test expectations (packages of called vulnerabilities), we
would use equality. Given that a requirement of integration checking is
to query the Go vulnerability database, the expectations need to change
from time to time. With the new support for UNREVIEWED, this is
happening more and more.

To address this, the CL here checks that the expected packages are a
subset of what is detected with govulncheck. This will make the test
more robust. The list of expected packages is anyhow long, so the
coverage is good and we are still testing against the same live db.

Change-Id: I49f73dc2094686253ae222bbe92144f87b2637a5
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/593155
Reviewed-by: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-06-24 15:52:52 +00:00
Zvonimir Pavlinovic f35edf848b all: require go1.21
Otherwise, code won't compile due to the use of slices package.

Fixes golang/go#68034

Change-Id: Id6fb27d2f213e5a665a2bcd6d07b15f80702975b
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/593235
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2024-06-24 15:49:52 +00:00
Zvonimir Pavlinovic 3740f5cb12 internal/osv: add review status
Ecosystem metrics cannot pick up REVIEWED vs UNREVIWED unless
govulncheck produces it.

Change-Id: Ia6ea1ef7cf681ac51e18dd32748dc658a72ebad9
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/591055
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
2024-06-06 14:46:51 +00:00
Maceo Thompson 29462d73a2 vulncheck: update documentation for vex
Adds documentation/updates some tests & comments to reflect the
introduction of the openVEX standard as a valid output format for
govulncheck.

fixes golang/go#62486

Change-Id: I88c6fc830439606441bb1855ba8b36642007738c
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/590575
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
Commit-Queue: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-06-05 20:35:58 +00:00
Zvonimir Pavlinovic 2736e1dc19 cmd/govulncheck/integration/stackrox-scanner: update expectations
Due to a new addition of unreviewed reports.

Change-Id: I4bbecf7bb600944cdec0fe61fce13372e6450f00
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/590636
Auto-Submit: Zvonimir Pavlinovic <zpavlinovic@google.com>
Reviewed-by: Maceo Thompson <maceothompson@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-06-05 19:01:16 +00:00