Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(nvd): use NVD API v2 #1318

Merged
merged 4 commits into from
Nov 16, 2023
Merged

chore(nvd): use NVD API v2 #1318

merged 4 commits into from
Nov 16, 2023

Conversation

RTann
Copy link
Collaborator

@RTann RTann commented Nov 2, 2023

NVD plans to retire the 1.1 JSON feeds on December 15, 2023. This PR swaps our usage of those feeds with the v2 API.

For backwards compatibility purposes with previous Scanner versions, which may still be deployed somewhere and may still be officially supported, we convert the v2 API JSON responses to the 1.1 JSON formatting. This allows us to continue serving NVD data to live Scanners without any downtime nor required updates.

Before, there was a JSON file per year (2002 - Present year). Now, there will be a JSON file for every 20,000 vulnerabilities. The maximum file size, uncompressed, is about 60MB, and the genesis-dump.zip is about 164MB. The genesis-dump.zip associated with the 4.3.0 release is about 166MB, so these changes result in negligible differences in the genesis-dump.

The change in file names will not affect older Scanners (at least no Scanners which are still supported), as each Scanner looks inside of a directory called nvd/ (which has not changed) for all .json files. As long as the file extension is .json, the file name does not matter. See https://github.com/stackrox/scanner/blob/2.28.7/cpe/nvdtoolscache/load.go, which (as of writing this), has not been touched since well before 3.74 (Scanner 2.28) was released.

See stackrox/nvdtools#9 for the related changes to the nvdtools library.

NOTE: Once this is merged, all live Scanners will be getting this data, so this can be a potentially dangerous change.

@RTann RTann added the generate-dumps-on-pr Generates the image based on dumps from the PR label Nov 2, 2023
@RTann RTann force-pushed the ross/nvd-20-api branch 6 times, most recently from dfa8104 to 796f18f Compare November 3, 2023 20:00
@ghost
Copy link

ghost commented Nov 3, 2023

Images are ready for the commit at 7d44713.

To use the images, use the tag 2.31.x-54-g7d44713ce0.

@RTann RTann force-pushed the ross/nvd-20-api branch 4 times, most recently from 5a49763 to 0ff2a22 Compare November 8, 2023 00:44
@RTann
Copy link
Collaborator Author

RTann commented Nov 8, 2023

/retest slim-e2e-tests

Copy link

openshift-ci bot commented Nov 8, 2023

@RTann: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test images
  • /test push-images
  • /test style-checks
  • /test unit-tests

The following commands are available to trigger optional jobs:

  • /test db-integration-tests
  • /test diff-dumps
  • /test e2e-tests
  • /test scale-tests
  • /test slim-e2e-tests
  • /test store-db-dump
  • /test store-genesis-dump

Use /test all to run all jobs.

In response to this:

/retest slim-e2e-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@RTann
Copy link
Collaborator Author

RTann commented Nov 8, 2023

/test slim-e2e-tests

@RTann
Copy link
Collaborator Author

RTann commented Nov 8, 2023

/retest

@RTann
Copy link
Collaborator Author

RTann commented Nov 8, 2023

Getting 403s, which is concerning. Perhaps we should look into getting an API key...

@RTann
Copy link
Collaborator Author

RTann commented Nov 8, 2023

/retest

1 similar comment
@RTann
Copy link
Collaborator Author

RTann commented Nov 8, 2023

/retest

@RTann
Copy link
Collaborator Author

RTann commented Nov 9, 2023

Failing e2e test is unrelated: #1322

@RTann
Copy link
Collaborator Author

RTann commented Nov 15, 2023

will merge tomorrow morning

@RTann
Copy link
Collaborator Author

RTann commented Nov 16, 2023

Verified via these tests, checking for specific known ones, and ensuring StackRox 3.74.7 can handle the vulns without panicking and return scan results. Merging

@RTann RTann merged commit 9c259f3 into master Nov 16, 2023
@RTann RTann deleted the ross/nvd-20-api branch November 16, 2023 20:46
RTann added a commit that referenced this pull request Nov 17, 2023
RTann added a commit that referenced this pull request Nov 17, 2023
RTann added a commit that referenced this pull request Nov 22, 2023
RTann added a commit that referenced this pull request Nov 22, 2023
RTann added a commit that referenced this pull request Nov 28, 2023
RTann added a commit that referenced this pull request Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generate-dumps-on-pr Generates the image based on dumps from the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants