Quarkus 中的安全漏洞检测和报告
大多数 Quarkus 标签以通用平台枚举 (CPE) 名称格式在美国 国家漏洞数据库 (NVD) 中注册。
美国国家漏洞数据库
要查看美国 NVD 中注册的 Quarkus CPE 名称,请使用以下搜索 URL
如果 NVD 数据库标记针对 Quarkus 标签的 CVE,则会将提供有关 CVE 更多详细信息的链接添加到给定的 CPE 名称条目。
NVD CPE 团队会定期更新列表,但如果您遇到误报,请通过在 quarkusio 存储库中创建 issue 来报告详细信息。
在构建时检测 Quarkus 中的漏洞
您可以使用 Maven OWASP Dependency-check-maven 插件,通过 NVD feed 在应用程序构建时检测漏洞。
要将 Open Worldwide Application Security Project (OWASP) Dependency-check-maven 插件添加到您的 Quarkus Maven 项目,请将以下 XML 配置添加到 pom.xml
文件
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>${owasp-dependency-check-plugin.version}</version>
</plugin>
将 |
接下来,按如下方式配置插件
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>${owasp-dependency-check-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- Fail only when detecting High Vulnerability issues -->
<failBuildOnCVSS>7</failBuildOnCVSS>
<suppressionFiles>
<suppressionFile>${project.basedir}/dependency-cpe-suppression.xml</suppressionFile>
</suppressionFiles>
</configuration>
</plugin>
要检测不太严重的问题,请调整 failBuildOnCVSS
的值以抑制误报,如下面的代码示例所示
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.2.xsd">
<!--
This is a CPE suppression file for the maven dependency check plugin.
Each CPE that is found by error (false positive) needs to be suppressed for a specific jar using its' GAV.
See https://jeremylong.github.io/DependencyCheck/general/suppression.html
-->
<suppress>
<notes>
<![CDATA[
Suppress the false positive CPE for netty-tcnative-classes to netty
]]>
</notes>
<gav regex="true">^io\.netty:netty-tcnative-classes.*:.*$</gav>
<cpe>cpe:/a:netty:netty</cpe>
</suppress>
<suppress>
<notes>
<![CDATA[
Suppress the false positive CPE for Quarkus Mutiny to mutiny:mutiny
]]>
</notes>
<gav regex="true">^io\.quarkus:quarkus-mutiny.*:.*$</gav>
<cpe>cpe:/a:mutiny:mutiny</cpe>
</suppress>
<suppress>
<notes>
<![CDATA[
Suppress the false positive CPE for SmallRye Mutiny to mutiny:mutiny
]]>
</notes>
<gav regex="true">^io\.smallrye\.reactive:mutiny.*:.*$</gav>
<cpe>cpe:/a:mutiny:mutiny</cpe>
</suppress>
<suppress>
<notes>
<![CDATA[
Suppress the false positive CPE for SmallRye Mutiny to mutiny:mutiny
]]>
</notes>
<gav regex="true">^io\.smallrye\.reactive:smallrye-mutiny.*:.*$</gav>
<cpe>cpe:/a:mutiny:mutiny</cpe>
</suppress>
<suppress>
<notes>
<![CDATA[
Suppress the false positive CPE for SmallRye Mutiny to mutiny:mutiny
]]>
</notes>
<gav regex="true">^io\.smallrye\.reactive:vertx-mutiny.*:.*$</gav>
<cpe>cpe:/a:mutiny:mutiny</cpe>
</suppress>
<suppress>
<notes>
<![CDATA[
Suppress the false positive CPE for graal-sdk to GraalVM (the JVM distribution)
]]>
</notes>
<gav regex="true">^org\.graalvm\.sdk:graal-sdk.*:.*$</gav>
</suppress>
</suppressions>
请确保定期查看和更新禁止列表,以确保结果是最新的。 您可以选择通过添加到期属性来对单个禁止应用时间限制,如下面的示例所示
<suppress until="2022-01-01Z">…</suppress>
如果需要,您可以调整到期日期。