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

NIST update - Allow to stop and continue later #7449

Closed
richardzaat opened this issue Feb 21, 2025 · 8 comments
Closed

NIST update - Allow to stop and continue later #7449

richardzaat opened this issue Feb 21, 2025 · 8 comments

Comments

@richardzaat
Copy link

Is your feature request related to a problem? Please describe.
I'm always frustrated when I install a new version of Dependency Check and need to download the complete NIST library. Now it stops at 220.000 downloads and just does not continue until I cancel the whole thing

Describe the solution you'd like
A clear and concise description of what I want to happen is that the next time I update the database it continuous where it left off. Same as when the database was already filled and it only downloads the delta. Why not do so now?

Describe alternatives you've considered
I've considered replacing the empty database with one from a previous version of DC, but does not feel like a good solution.

Additional context
n/a

@marcelstoer
Copy link
Collaborator

I've considered replacing the empty database with one from a previous version of DC, but does not feel like a good solution.

Why? Only rarely should it be necessary to start with an empty database. Besides, a new ODC tool version doesn't necessarily require a new database version.

It is strongly recommended that you cache the database one way or the other. Various approaches are documented at https://jeremylong.github.io/DependencyCheck/data/index.html#The_NVD_Database.

@kantipenko
Copy link

Why? Only rarely should it be necessary to start with an empty database. Besides, a new ODC tool version doesn't necessarily require a new database version.

It is strongly recommended that you cache the database one way or the other.

We used cashing approach, after upgrade to 12.1.0 we can not have even one first successful update from NVD API. Maximum it went was 86% of records. After that time it just hangs for hours.
Recent attempt example

Image

@marcelstoer
Copy link
Collaborator

A more efficient way to initialize a cold database is to start with the dependency check data files (see documentation I posted for details).

  • First, get the feed files as a basis.
  • Then fetch the latest delta from the NVD API.
  • Then offer the thusly created database to the actual build jobs.
$ dependency-check.bat --updateonly --nvdDatafeed=https://dependency-check.github.io/DependencyCheck_Builder/nvd_cache/nvdcve-{0}.json.gz
$ dependency-check.bat --updateonly --nvdValidForHours=0 --nvdApiKey="$NVD_API_KEY"

@richardzaat
Copy link
Author

richardzaat commented Feb 26, 2025 via email

@franzgranlund
Copy link

I have the same problem. It always stops at [INFO] Downloaded 220,000/283,171 (78%).

@kantipenko
Copy link

kantipenko commented Feb 27, 2025

A more efficient way to initialize a cold database is to start with the dependency check data files (see documentation I posted for details).

Many Thanks! This approach have worked for us.

  • First, get the feed files as a basis.
    Would you recommend we add it to scheduled run or only needed on the initial DB seeding?
  • Then fetch the latest delta from the NVD API.
    At the moment we have only this one

@marcelstoer
Copy link
Collaborator

Would you recommend we add it to scheduled run

We do this every night. This ensures that every build job that runs during the day uses the same database.

@marcelstoer
Copy link
Collaborator

I am closing this as @jeremylong closed my request (asking for the same feature) for the same reasons I stated above: #7180 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants