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 12, 2023
1 parent 4f2f32b commit 0e6951c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
46 changes: 46 additions & 0 deletions etc/dependency-check-suppression.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,51 @@
<cve>CVE-2023-4759</cve>
</suppress>

<!--
False Positives. These CVEs are against the Brave web browser, not brave-opentracing.
-->
<suppress>
<notes><![CDATA[
file name: brave-opentracing-1.0.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/io\.opentracing\.brave/brave\-opentracing@.*$</packageUrl>
<cve>CVE-2022-47932</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: brave-opentracing-1.0.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/io\.opentracing\.brave/brave\-opentracing@.*$</packageUrl>
<cve>CVE-2022-47933</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: brave-opentracing-1.0.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/io\.opentracing\.brave/brave\-opentracing@.*$</packageUrl>
<cve>CVE-2022-47934</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: brave-opentracing-1.0.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/io\.opentracing\.brave/brave\-opentracing@.*$</packageUrl>
<cve>CVE-2021-22929</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: brave-opentracing-1.0.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/io\.opentracing\.brave/brave\-opentracing@.*$</packageUrl>
<cve>CVE-2022-30334</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: brave-opentracing-1.0.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/io\.opentracing\.brave/brave\-opentracing@.*$</packageUrl>
<cve>CVE-2023-28360</cve>
</suppress>


</suppressions>
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
4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<version.plugin.source>3.3.0</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</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 @@ -567,6 +567,8 @@
<skipTestScope>true</skipTestScope>
<failBuildOnAnyVulnerability>false</failBuildOnAnyVulnerability>
<assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
# If provide improves rate limits
<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 0e6951c

Please sign in to comment.