Skip to content

Commit ffaeac8

Browse files
dependabot[bot]nhumblotchadlwilsonjeremylong
authored
build(deps): bump io.github.jeremylong:open-vulnerability-clients from 7.3.2 to 9.0.2 (#7630)
Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Chad Wilson <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nicolas Humblot <[email protected]> Co-authored-by: Chad Wilson <[email protected]> Co-authored-by: Jeremy Long <[email protected]>
1 parent e198b4f commit ffaeac8

File tree

6 files changed

+21
-4
lines changed

6 files changed

+21
-4
lines changed

core/src/main/java/org/owasp/dependencycheck/data/update/NvdApiDataSource.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,11 @@ private boolean processApi() throws UpdateException {
315315
if (key != null) {
316316
//using a higher delay as the system may not be able to process these faster.
317317
builder.withApiKey(key)
318-
.withDelay(5000)
319-
.withThreadCount(4);
318+
.withrequestsPerThirtySeconds(settings.getInt(Settings.KEYS.NVD_API_REQUESTS_PER_30_SECONDS_WITH_API_KEY, 50));
320319
} else {
321320
LOGGER.warn("An NVD API Key was not provided - it is highly recommended to use "
322321
+ "an NVD API key as the update can take a VERY long time without an API Key");
323-
builder.withDelay(10000);
322+
builder.withrequestsPerThirtySeconds(settings.getInt(Settings.KEYS.NVD_API_REQUESTS_PER_30_SECONDS_WITHOUT_API_KEY, 5));
324323
}
325324

326325
final int resultsPerPage = Math.min(settings.getInt(Settings.KEYS.NVD_API_RESULTS_PER_PAGE, RESULTS_PER_PAGE), RESULTS_PER_PAGE);

core/src/main/resources/dependencycheck.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ nvd.api.check.validforhours=4
5656
nvd.api.datafeed.validfordays=7
5757
nvd.api.max.retry.count=30
5858
nvd.api.delay=0
59+
60+
# these are the default NVD API request limits - these can be set lower,
61+
# but the client used will not let you exceed these values
62+
nvd.api.requestsperthirtysecondswithoutapikey=5
63+
nvd.api.requestsperthirtysecondswithapikey=50
64+
5965
#nvd.api.datafeed.url=https://example.com/nvd-cache/
6066
#nvd.api.datafeed.user=
6167
#nvd.api.datafeed.password=

core/src/test/resources/dependencycheck.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ nvd.api.check.validforhours=4
5252
nvd.api.datafeed.validfordays=7
5353
nvd.api.max.retry.count=30
5454
nvd.api.delay=0
55+
nvd.api.requestsperthirtysecondswithoutapikey=5
56+
nvd.api.requestsperthirtysecondswithapikey=50
5557
#nvd.api.datafeed.url=https://example.com/nvd-cache/
5658
#nvd.api.datafeed.user=
5759
#nvd.api.datafeed.password=

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ Copyright (c) 2012 - Jeremy Long
924924
<dependency>
925925
<groupId>io.github.jeremylong</groupId>
926926
<artifactId>open-vulnerability-clients</artifactId>
927-
<version>7.3.2</version>
927+
<version>9.0.2</version>
928928
</dependency>
929929
<dependency>
930930
<groupId>org.anarres.jdiagnostics</groupId>

utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ public static final class KEYS {
173173
* The delay between requests for the NVD API.
174174
*/
175175
public static final String NVD_API_DELAY = "nvd.api.delay";
176+
/**
177+
* The number of requests made to the NVD API per 30 seconds when no API KEY is provided.
178+
*/
179+
public static final String NVD_API_REQUESTS_PER_30_SECONDS_WITHOUT_API_KEY = "nvd.api.requestsperthirtysecondswithoutapikey";
180+
/**
181+
* The number of requests made to the NVD API per 30 seconds when an API KEY is provided.
182+
*/
183+
public static final String NVD_API_REQUESTS_PER_30_SECONDS_WITH_API_KEY = "nvd.api.requestsperthirtysecondswithapikey";
176184
/**
177185
* The maximum number of retry requests for a single call to the NVD
178186
* API.

utils/src/test/resources/dependencycheck.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ nvd.api.check.validforhours=4
5252
nvd.api.datafeed.validfordays=7
5353
nvd.api.max.retry.count=30
5454
nvd.api.delay=0
55+
nvd.api.requestsperthirtysecondswithoutapikey=5
56+
nvd.api.requestsperthirtysecondswithapikey=50
5557
#nvd.api.datafeed.url=https://example.com/nvd-cache/
5658
#nvd.api.datafeed.user=
5759
#nvd.api.datafeed.password=

0 commit comments

Comments
 (0)