The English version of quarkus.io is the official project site. Translated sites are community supported on a best-effort basis.

Quarkusにおけるセキュリティ脆弱性の検出と報告

Quarkusのタグの多くは、米国の National Vulnerability Database(NVD) にCPE(Common Platform Enumeration)の名前形式で登録されています。

US National Vulnerability Database

米国NVDに登録されているQuarkus CPE名を閲覧するには、以下の検索URLをご利用ください:

NVDデータベースがQuarkusタグに対してCVEフラグを立てた場合、そのCVEの詳細を提供するリンクが、指定されたCPE名エントリに追加されます。

NVD CPEチームは定期的にリストを更新していますが、誤検出が発生した場合は、 quarkusio リポジトリにissueを作成して詳細を報告してください。

ビルド時にQuarkusの脆弱性を検出

Maven OWASP Dependency-check-mavenプラグイン を使用することで、NVDフィードを使ってアプリケーションのビルド時に脆弱性を検出することができます。

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>

owasp-dependency-check-plugin.version の値を 8.3.1 以降に設定する。

次に、以下のようにプラグインを設定します:

<plugin>
    <groupId>org.owasp</groupId>
    <artifactId>dependency-check-maven</artifactId>
    <version>${owasp-dependency-check-plugin.version}</version>
    <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>

抑制リストを定期的に見直し、更新して、結果が最新であるようにして下さい。次の例に示すように、expiry属性を追加することで、個々の抑制に時間制限を適用することも可能です:

<suppress until="2022-01-01Z">…​</suppress>

必要であれば、有効期限を調整することができます。

関連コンテンツ