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

feat: Utilize NVD API #5978

Merged
merged 66 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
4c26404
feat: utilize NVD API
jeremylong Sep 28, 2023
9976450
chore: bump open-vulnerability-clients version
jeremylong Oct 5, 2023
9681868
feat: NVD API data feed
jeremylong Oct 8, 2023
5975a8a
style: make checkstyle happier
jeremylong Oct 8, 2023
5d1120d
fix: compiler error
jeremylong Oct 9, 2023
3668bfc
style: make checkstyle happier
jeremylong Oct 9, 2023
21c3663
chore: remove dead code
jeremylong Oct 11, 2023
e6bdcc4
feat: convert NVD CVE configuration options to the new NVD API Config…
jeremylong Oct 11, 2023
cf0ea0c
fix: update settings for NVD API
jeremylong Oct 11, 2023
c746cfc
style: make checkstyle happier
jeremylong Oct 14, 2023
1e71a8d
Merge branch 'main' into scratch/nvdapi
jeremylong Oct 14, 2023
311f034
style: auto-format update
jeremylong Oct 15, 2023
8283c81
fix: correct apiKey CLI arg
jeremylong Oct 16, 2023
e79480f
docs: update documentation for the NVD API
jeremylong Oct 16, 2023
94e983e
docs: update documentation for the NVD API
jeremylong Oct 16, 2023
2af3e0d
fix: correct copy/paste error
jeremylong Oct 16, 2023
b1fce94
fix: maven integration tests use NVD_API_KEY
jeremylong Oct 16, 2023
9dfc3f7
fix: correctly reference env variable
jeremylong Oct 17, 2023
fb1aeb4
fix: copy/paste error
jeremylong Oct 21, 2023
63b5520
fix: update data directory
jeremylong Oct 21, 2023
c26501c
fix: remove un-needed code to check for json exceptions
jeremylong Oct 21, 2023
254bb63
Merge branch 'main' into scratch/nvdapi
jeremylong Oct 21, 2023
38888a7
fix: remove unused import
jeremylong Oct 21, 2023
f025035
fix: make checkstyle happier
jeremylong Oct 21, 2023
36866a0
fix: make checkstyle happier
jeremylong Oct 21, 2023
af27f74
fix: correctly obtain timestamp
jeremylong Nov 3, 2023
c025d54
Merge branch 'main' into scratch/nvdapi
jeremylong Nov 3, 2023
536de8c
fix: correctly obtain timestamp
jeremylong Nov 3, 2023
67b793c
style: make checkstyle happier
jeremylong Nov 3, 2023
8145910
fix: make checkstyle happier
jeremylong Nov 3, 2023
bb3e5e4
fix: add check to prevent repeated updates
jeremylong Nov 3, 2023
24edabc
style: make checkstyle happier
jeremylong Nov 3, 2023
fc8350c
fix: wip
jeremylong Nov 4, 2023
174835a
style: make checkstyle happier
jeremylong Nov 4, 2023
58d64b6
fix: update properties
jeremylong Nov 4, 2023
69f6b9f
chore: testing
jeremylong Nov 5, 2023
a5e6861
fix: release memory
jeremylong Nov 5, 2023
6b64165
fix: improve reporting
jeremylong Nov 5, 2023
0621b48
chore: remove debug code
jeremylong Nov 5, 2023
5060a93
fix: adjust time
jeremylong Nov 5, 2023
b504f4b
fix: checkstyle
jeremylong Nov 5, 2023
10b740a
fix: bump open-vulnerability-client
jeremylong Nov 6, 2023
09fc658
fix: improve code
jeremylong Nov 8, 2023
df6af4a
fix: cleaner code
jeremylong Nov 8, 2023
d8e06e0
fix: code cleanup
jeremylong Nov 8, 2023
fe26dab
docs: fix javadoc
jeremylong Nov 8, 2023
8711bac
docs: fix javadoc
jeremylong Nov 8, 2023
4c4f957
fix: code cleanup
jeremylong Nov 8, 2023
bad5eab
fix: remove unused code
jeremylong Nov 8, 2023
dd729d7
fix: restore test case
jeremylong Nov 10, 2023
0c973dd
fix: correctly use setNull
jeremylong Nov 10, 2023
99280ab
fix: confidentail -> confidentiality
jeremylong Nov 10, 2023
4928857
fix: exception handling
jeremylong Nov 11, 2023
0cacc48
fix: improve date range check
jeremylong Nov 11, 2023
f51a6c9
docs: fix javadoc
jeremylong Nov 12, 2023
1e38434
fix: use the correct timezone
jeremylong Nov 12, 2023
6453393
fix: return loaded properties rather then new properties
jeremylong Nov 12, 2023
bcc4cfa
fix: fixes per review by @aikebah
jeremylong Nov 12, 2023
0c9819d
fix: minor code refactoring
jeremylong Nov 12, 2023
7d2bfe0
Merge branch 'main' into scratch/nvdapi
jeremylong Nov 17, 2023
09d291a
docs: document breaking changes
jeremylong Nov 17, 2023
7047bd9
fix: wip - allow other NVD cache types
jeremylong Nov 17, 2023
3df710e
fix: updates for datafeed
jeremylong Nov 18, 2023
6aa18ed
style: make checkstyle happier
jeremylong Nov 18, 2023
8d8ba12
docs: update 9.0.0 upgrade notice
jeremylong Nov 21, 2023
f317078
Merge branch 'main' into scratch/nvdapi
jeremylong Nov 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
run: mvn -s settings.xml -Prelease clean package verify source:jar javadoc:jar gpg:sign deploy -DreleaseTesting --no-transfer-progress --batch-mode -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: SARIF Multitool
uses: microsoft/sarif-actions@v0.1
jeremylong marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
version: 6.0.2
- name: Regression Test Maven Plugin
id: build
env:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
run: |
mvn -s settings.xml -pl utils,core,maven -am compile verify -DtestMavenPlugin -DreleaseTesting --no-transfer-progress --batch-mode
- name: Archive IT test logs
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
run: |
mvn -s settings.xml -Prelease "-DnexusUrl=https://oss.sonatype.org/" clean package source:jar javadoc:jar gpg:sign deploy site site:stage -DreleaseTesting --no-transfer-progress --batch-mode -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Archive code coverage results
Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,25 @@ Dependency-Check is a Software Composition Analysis (SCA) tool that attempts to

Documentation and links to production binary releases can be found on the [github pages](http://jeremylong.github.io/DependencyCheck/). Additionally, more information about the architecture and ways to extend dependency-check can be found on the [wiki].

## 8.0.0 Upgrade Notice
## 9.0.0 Upgrade Notice

8.0.0 contains breaking changes which requires updates to the database. If using
### NVD API Key Highly Recommended

With 9.0.0 dependency-check has moved from using the NVD data-feed to the NVD API.
Users of dependency-check are **highly** encouraged to obtain an NVD API Key; see https://nvd.nist.gov/developers/request-an-api-key
Without an NVD API Key dependency-check's updates will be **extremely slow**.
Please see the documentation for the cli, maven, gradle, or ant integrations on
how to set the NVD API key.

### Breaking Changes

9.0.0 contains breaking changes which requires updates to the database. If using
an externally hosted database the schema will need to be updated. When using the
embedded H2 database the schema should be upgraded automatically. However, if
embedded H2 database, the schema should be upgraded automatically. However, if
issues arise you may need to purge the database:

- gradle: `./gradlew dependencyCheckPurge`
- maven: `mvn org.owasp:dependency-check-maven:8.0.0:purge`
- maven: `mvn org.owasp:dependency-check-maven:9.0.0:purge`
- cli: `dependency-check.sh --purge`

## Requirements
Expand Down
2 changes: 1 addition & 1 deletion ant/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Copyright (c) 2013 - Jeremy Long. All Rights Reserved.
<parent>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-parent</artifactId>
<version>8.4.4-SNAPSHOT</version>
<version>9.0.0-SNAPSHOT</version>
</parent>

<artifactId>dependency-check-ant</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
import org.owasp.dependencycheck.utils.Settings;
import org.owasp.dependencycheck.utils.SeverityUtil;
import org.slf4j.impl.StaticLoggerBinder;
//CSOFF: MethodCount

//CSOFF: MethodCount
/**
* An Ant task definition to execute dependency-check during an Ant build.
*
Expand Down Expand Up @@ -882,7 +882,7 @@ public Boolean isNuspecAnalyzerEnabled() {
*/
public Boolean isNugetconfAnalyzerEnabled() {
return nugetconfAnalyzerEnabled;
}
}

/**
* Sets whether or not the analyzer is enabled.
Expand Down Expand Up @@ -2217,8 +2217,8 @@ private void checkForFailure(Dependency[] dependencies) throws BuildException {
for (Dependency d : dependencies) {
boolean addName = true;
for (Vulnerability v : d.getVulnerabilities()) {
if ((v.getCvssV2() != null && v.getCvssV2().getScore() >= failBuildOnCVSS)
|| (v.getCvssV3() != null && v.getCvssV3().getBaseScore() >= failBuildOnCVSS)
if ((v.getCvssV2() != null && v.getCvssV2().getCvssData().getBaseScore() >= failBuildOnCVSS)
|| (v.getCvssV3() != null && v.getCvssV3().getCvssData().getBaseScore() >= failBuildOnCVSS)
|| (v.getUnscoredSeverity() != null && SeverityUtil.estimateCvssV2(v.getUnscoredSeverity()) >= failBuildOnCVSS)
//safety net to fail on any if for some reason the above misses on 0
|| (failBuildOnCVSS <= 0.0f)) {
Expand Down
11 changes: 7 additions & 4 deletions ant/src/main/java/org/owasp/dependencycheck/taskdefs/Purge.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,13 @@ public void setHostedSuppressionsUrl(final String hostedSuppressionsUrl) {
}

/**
* Sets the {@link Thread#getContextClassLoader() Thread Context Class Loader} to the one for this class,
* and then calls {@link #executeWithContextClassloader()}. This is done because the JCS cache needs to have
* the Thread Context Class Loader set to something that can resolve it's classes. Other build tools do this
* by default but Ant does not.
* Sets the
* {@link Thread#getContextClassLoader() Thread Context Class Loader} to the
* one for this class, and then calls
* {@link #executeWithContextClassloader()}. This is done because the JCS
* cache needs to have the Thread Context Class Loader set to something that
* can resolve it's classes. Other build tools do this by default but Ant
* does not.
*
* @throws BuildException throws if there is a problem. See
* {@link #executeWithContextClassloader()} for details
Expand Down
Loading