Skip to content

Commit

Permalink
Upgrade dependency-check-maven and add support for nvdApiKey
Browse files Browse the repository at this point in the history
  • Loading branch information
barchetta committed Dec 11, 2023
1 parent 88a5b39 commit 498922c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions etc/scripts/owasp-dependency-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ if [ -n "${JENKINS_HOME}" ] || [ "${GITHUB_ACTIONS}" = "true" ]; then
mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml clean install -DskipTests
fi

# Setting NVD_API_KEY is not required but improves behavior of NVD API throttling

mvn ${MAVEN_ARGS} -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN org.owasp:dependency-check-maven:aggregate \
-f ${WS_DIR}/pom.xml \
-Dtop.parent.basedir="${WS_DIR}" \
-Dnvd-api-key=${NVD_API_KEY} \
> ${RESULT_FILE} || die "Error running the Maven command"

grep -i "One or more dependencies were identified with known vulnerabilities" ${RESULT_FILE} \
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<version.plugin.source>3.0.1</version.plugin.source>
<version.plugin.spotbugs>4.4.2.2</version.plugin.spotbugs>
<version.plugin.findsecbugs>1.11.0</version.plugin.findsecbugs>
<version.plugin.dependency-check>8.4.3</version.plugin.dependency-check>
<version.plugin.dependency-check>9.0.4</version.plugin.dependency-check>
<version.plugin.surefire>3.0.0-M5</version.plugin.surefire>
<version.plugin.toolchains>1.1</version.plugin.toolchains>
<version.plugin.version-plugin>2.3</version.plugin.version-plugin>
Expand Down Expand Up @@ -558,6 +558,7 @@
<skipTestScope>true</skipTestScope>
<failBuildOnAnyVulnerability>false</failBuildOnAnyVulnerability>
<assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
<nvdApiKey>${nvd-api-key}</nvdApiKey>
<excludes>
<!-- Exclude stuff we do not deploy -->
<exclude>io.helidon.tracing:helidon-tracing-tests</exclude>
Expand Down

0 comments on commit 498922c

Please sign in to comment.