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

20 Коммитов

Автор SHA1 Сообщение Дата
Tatiana Bradley 2ff2c865e4 all: rename cveschema5 and cveschema to cve5 and cve4
Change-Id: I361574a534adbfdbbe052ed9d6b93b9ff0e01081
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/583657
Commit-Queue: Tatiana Bradley <tatianabradley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2024-05-15 14:51:25 +00:00
Tatiana Bradley 57274b497d internal/{ghsa,report}: move ghsaToReport to ghsa package
Change-Id: I8bbb9482dddf3b1c58bcaff037c7d60fcb1539e7
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/583655
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Tatiana Bradley <tatianabradley@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
2024-05-15 14:51:10 +00:00
Tatiana Bradley 685ac1984d all: move cve/ghsa utils to their own package
- Move some functions related to CVE/GHSA regex matching
to a new "idstr" package, as they are not related specifically to the
CVE5 or GHSA GraphQL format.

- Move all logic related to the cve5, cve4 and legacyGHSA formats in
the "internal/report" package to their own files, so it is easier to
(potentially) move these to their own packages in the future.

The goal of this CL is to reduce the risk of import cycles
for some upcoming refactors.

Change-Id: I7e14c31c17882230b783cc62e1ecdf43dcb98995
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/581717
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2024-05-15 14:42:37 +00:00
Tatiana Bradley ba00fcf8c9 all, checks.bash: restore unparam check
Restore the check for unused parameters and remove unused parameters
found by the check.

Change-Id: I80fe9b1cab507eeae8eb1f27e2395824330868c5
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/551436
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-12-19 20:22:38 +00:00
Tatiana Bradley 7a7755550d cmd/cve: add option to automatically preserve CVE refs
In the "cve publish" command, allow the user to choose to automatically
update a report & its CVE record with missing CVE references.

Change-Id: I2a3e45aa896e6bd69cc8b9697a227ca7aaf4144a
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/547496
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2023-12-06 16:23:18 +00:00
Tatiana Bradley 89f9caba8d cmd/cve: make warning for deleted URLs in CVEs more prominent
Change-Id: I25f25fa5d014d25e8d361826a885e77ad8be5dba
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/526265
Auto-Submit: Tatiana Bradley <tatianabradley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2023-09-11 15:42:45 +00:00
Tatiana Bradley f15359aabd all: deduplicate alias regexps
Consolidate regular expressions for CVEs and GHSAs and update a TODO
related to CVEs to reference a bug.

Change-Id: If7837fe3fa7ccb7dd205dc73b259462df2023cd5
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/507908
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tatiana Bradley <tatianabradley@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
2023-07-06 18:53:45 +00:00
Tatiana Bradley 26bbb34362 internal/report,cmd/cve: preserve CVE references added by CVE program
The CVE program sometimes adds references to a CVE record beyond what
we initially populated. We would like to preserve these references in
CVE records, but not publish them in OSV, because they often do not
meet our style requirements.

To do this, this CL:

1) introduces a field "cve_metadata.references" to
our YAML reports which can be used to list such externally-added
references.
2) adds this field to all YAML reports where 1 or more references
have been externally added.
3) adds a warning to the "cve publish" command to warn the user if
a publish might overwrite an externally-added reference.

Change-Id: I71cce89d2099e9f34b25e9939d755ff9dfd653ba
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/502635
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Tatiana Bradley <tatianabradley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-12 19:01:18 +00:00
Tatiana Bradley 5c064e0c02 all: (cleanup) remove unnecessary words from function names
No-op refactor to remove redundant words like "get" from function names.

Change-Id: I899556dbbe8caa790593bee8d952d1b3f557387b
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/497499
Run-TryBot: Tatiana Bradley <tatianabradley@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-25 15:11:04 +00:00
Tatiana Bradley 34375e4319 internal/cveclient, cmd/cve: tweak output of CVE publish
Modify cve publish to:
1) support the new MITRE web test instance, which displays test CVE
records
2) print out a link to the existing CVE record if it exists
3) not print out the full published CVE record

Also moves the logic for computing the web link to the cveclient instead
of the reports package.

Change-Id: I04b0ef8b93650b834908b29b7a2fa10eb41bf12a
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/459597
Reviewed-by: Julie Qiu <julieqiu@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tatiana Bradley <tatiana@golang.org>
Run-TryBot: Tatiana Bradley <tatiana@golang.org>
2022-12-28 16:08:25 +00:00
Tatiana Bradley 10819e1dfe cmd/cve: support running cve publish on multiple arguments
The "cve publish" command can now be run on space-separated arguments
or regular expressions (e.g. cve publish data/cve/v5/*.json)

Change-Id: Ia7eb06218bdb090161f78a0aeaea4f274c66b3d7
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/459596
Reviewed-by: Julie Qiu <julieqiu@google.com>
Reviewed-by: Tatiana Bradley <tatiana@golang.org>
Run-TryBot: Tatiana Bradley <tatiana@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-12-28 16:07:49 +00:00
Tatiana Bradley 59b3da85b0 cmd/cve: support issue IDs in cve publish
In "cve publish", allow argument to be a Github issue ID instead of
a filename.

Change-Id: I975030f0a5c9f771dbb1e85fca28b5a88098500e
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/454016
Run-TryBot: Tatiana Bradley <tatiana@golang.org>
Reviewed-by: Tatiana Bradley <tatiana@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Julie Qiu <julieqiu@google.com>
2022-11-30 17:16:45 +00:00
Tatiana Bradley bbf7cc70a7 cmd/cve, internal/cveclient: check if a record is already published in cve publish
Instead of asking the user to provide a flag -update indicating whether
a record is already published, use the CVE Services API to determine this
automatically.

Change-Id: I6e5bf7d6e095360335043424eb3330aeaf23b297
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/446218
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Tatiana Bradley <tatiana@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tatiana Bradley <tatiana@golang.org>
2022-10-31 15:59:27 +00:00
Tatiana Bradley 6b4153ebee internal/cveclient, cmd/cve: remove "unsupported" error in cve commands
MITRE now supports publishing and looking up CVEs via a prod API
(https://github.com/CVEProject/cve-services), so our "cve" command no
longer errors when a user attempts to publish or view a record in the
prod environment.

This CL also fixes the endpoint for the "cve record" command which was
incorrect.

For golang/go#53256

Change-Id: I1a28f9607de1253a5e9bdeb1249f44de4b8f7e47
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/446216
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tatiana Bradley <tatiana@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Tatiana Bradley <tatiana@golang.org>
2022-10-28 19:37:07 +00:00
Tatiana Bradley 9bb306ee77 cmd/cve: add separate flags for test key/user
This allows for easier testing without having to change the values
of environment variables.

Change-Id: I76b5d91d75066cf175bd8ffd9cef7efd1689fd8f
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/445896
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tatiana Bradley <tatiana@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Tatiana Bradley <tatiana@golang.org>
2022-10-28 17:38:34 +00:00
Tatiana Bradley 39b8f633d5 cmd/cve, internal/cveclient: update output of "cve reserve"
Print out a newline-separated list of CVEs instead of a comma-separated
one, to make it quicker to copy the list into a spreadsheet.

Change-Id: Ie9e2e406e4fd9a771e04fb82454322e4e12bcd1f
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/435457
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tatiana Bradley <tatiana@golang.org>
2022-09-28 21:13:02 +00:00
Julie Qiu 9e1b6eb982 cmd,internal: change generate link for CVEs to nvd.nist.gov
NIST provides a more readable version of the CVE information than
cve.mitre.org, and cve.mitre.org also links to it prominently, so link
to the NIST page instead.

Change-Id: Ia8044b92af5e7816098fcaec81fada1dff92c6f4
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/423094
Reviewed-by: Julie Qiu <julieqiu@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Julie Qiu <julieqiu@google.com>
Auto-Submit: Julie Qiu <julieqiu@google.com>
2022-08-16 15:29:38 +00:00
Tatiana Bradley d66b9fe4c6 x/vulndb: add cve publish and record commands
Adds a new command, cve publish, which can be used to publish CVE
Records to MITRE from YAML reports or JSON files. Also adds a cve record
command to look up existing CVE records by ID. The commands are
currently only supported in the test environment as the MITRE API does
not yet support the commands in production.

To support these commands, this CL also contains logic to convert YAML
report files to the new CVE JSON 5.0 format.

For golang/go#53256

Change-Id: I024bb18a2ece851724ca97f2f6d77f6aafc956b0
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/411514
Reviewed-by: Tatiana Bradley <tatiana@golang.org>
Reviewed-by: Julie Qiu <julieqiu@google.com>
2022-08-01 19:36:02 +00:00
Tatiana Bradley e5430e2fed x/vulndb: add cve org command to lookup org info
Also adds a minor refactor of cveclient to increase code reuse.

Change-Id: I67e798e35124913d916d743f86dcbbbc8d7a6b37
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/412877
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tatiana Bradley <tatiana@golang.org>
Reviewed-by: Tatiana Bradley <tatiana@golang.org>
2022-07-06 15:36:09 +00:00
Tatiana Bradley b33de87dbe x/vulndb: add client and cli for managing CVE IDs
Adds new internal package cveclient, a Go client for the MITRE CVE
Services API. Implements functionality to reserve new IDs, lookup
existing IDs, lookup quota, and list IDs for an organization.

Also adds a command line tool 'cve' to call the client functions.

For golang/go#53256

Change-Id: I10fad48adbdac32485ddf05975e2604021607079
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/409995
Reviewed-by: Julie Qiu <julieqiu@google.com>
Reviewed-by: Tatiana Bradley <tatiana@golang.org>
Auto-Submit: Tatiana Bradley <tatiana@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Julie Qiu <julieqiu@google.com>
2022-06-10 14:19:55 +00:00