Skip to content

Commit

Permalink
2.x: Upgrade dependency-check-maven and add support for nvdApiKey (he…
Browse files Browse the repository at this point in the history
…lidon-io#8137)

* Upgrade dependency-check-maven and add support for nvdApiKey
* Suppress Brave false positives
  • Loading branch information
barchetta committed Dec 12, 2023
1 parent 88a5b39 commit 15ae7ef
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
46 changes: 46 additions & 0 deletions etc/dependency-check-suppression.xml
Expand Up @@ -134,4 +134,50 @@
<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
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
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 15ae7ef

Please sign in to comment.