forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Build] Run OWASP Dependency Check as a scheduled build once per day (a…
…pache#10855) - add suppressions for false positives - add suppressions for known issues in distribution/server and make the check fail if new vulnerabilities are introduced - run reports for distribution/offloaders, distribution/io and pulsar-sql/presto-distribution to get a complete report of all vulnerabilities - upload report files as GitHub Actions artifact
- Loading branch information
Showing
4 changed files
with
179 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
name: CI - OWASP Dependency Check | ||
on: | ||
schedule: | ||
- cron: '15 0 * * *' | ||
|
||
env: | ||
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 | ||
|
||
jobs: | ||
run-owasp-dependency-check: | ||
name: Run OWASP Dependency Check | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 45 | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Tune Runner VM | ||
uses: ./.github/actions/tune-runner-vm | ||
|
||
- name: Cache local Maven repository | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.m2/repository/*/*/* | ||
!~/.m2/repository/org/apache/pulsar | ||
key: ${{ runner.os }}-m2-dependencies-owasp-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-m2-dependencies-all-${{ hashFiles('**/pom.xml') }} | ||
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }} | ||
${{ runner.os }}-m2-dependencies-core-modules- | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 11 | ||
|
||
- name: Replace maven's wagon-http version | ||
run: sudo ./build/replace_maven-wagon-http-version.sh | ||
|
||
- name: run install by skip tests | ||
run: mvn -q -B -ntp clean install -DskipTests | ||
|
||
- name: run OWASP Dependency Check for distribution/server (-DfailBuildOnAnyVulnerability=true) | ||
run: mvn -B -ntp -Pmain,skip-all,skipDocker,owasp-dependency-check initialize verify -pl distribution/server -DfailBuildOnAnyVulnerability=true | ||
|
||
- name: run OWASP Dependency Check for distribution/offloaders, distribution/io and pulsar-sql/presto-distribution | ||
run: mvn -B -ntp -Pmain,skip-all,skipDocker,owasp-dependency-check initialize verify -pl distribution/offloaders,distribution/io,pulsar-sql/presto-distribution | ||
|
||
- name: Upload OWASP Dependency Check reports | ||
uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: owasp-dependency-check-reports | ||
path: | | ||
distribution/server/target/dependency-check-report.html | ||
distribution/offloaders/target/dependency-check-report.html | ||
distribution/io/target/dependency-check-report.html | ||
pulsar-sql/presto-distribution/target/dependency-check-report.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd"> | ||
<!-- add supressions for false-positives detected by OWASP Dependency Check --> | ||
<suppress> | ||
<notes> | ||
apache:http_server is not used. | ||
</notes> | ||
<cpe>cpe:/a:apache:http_server</cpe> | ||
</suppress> | ||
<suppress> | ||
<notes>pulsar-zookeeper-utils gets mixed with zookeeper.</notes> | ||
<gav regex="true">org\.apache\.pulsar:.*</gav> | ||
<cpe>cpe:/a:apache:zookeeper</cpe> | ||
</suppress> | ||
<suppress> | ||
<notes>kubernetes client doesn't contain CVE-2020-8554</notes> | ||
<gav regex="true">io\.kubernetes:.*</gav> | ||
<cve>CVE-2020-8554</cve> | ||
</suppress> | ||
<suppress> | ||
<notes>avro doesn't contain CVE-2019-17195</notes> | ||
<gav regex="true">org\.apache\.avro:.*</gav> | ||
<cve>CVE-2019-17195</cve> | ||
</suppress> | ||
</suppressions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd"> | ||
<!-- add supressions for known vulnerabilities detected by OWASP Dependency Check --> | ||
<suppress> | ||
<notes>Ignore netty CVEs in GRPC shaded Netty.</notes> | ||
<filePath regex="true">.*grpc-netty-shaded.*</filePath> | ||
<cpe>cpe:/a:netty:netty</cpe> | ||
</suppress> | ||
<suppress> | ||
<notes>Suppress all pulsar-presto-distribution vulnerabilities</notes> | ||
<filePath regex="true">.*pulsar-presto-distribution-.*</filePath> | ||
<vulnerabilityName regex="true">.*</vulnerabilityName> | ||
</suppress> | ||
<suppress> | ||
<notes>Suppress libthrift-0.12.0.jar vulnerabilities</notes> | ||
<gav>org.apache.thrift:libthrift:0.12.0</gav> | ||
<vulnerabilityName regex="true">.*</vulnerabilityName> | ||
</suppress> | ||
<suppress> | ||
<notes>Suppress vert.x 3.5.4 vulnerabilities</notes> | ||
<gav regex="true">io\.vertx:.*:3\.5\.4</gav> | ||
<vulnerabilityName regex="true">.*</vulnerabilityName> | ||
</suppress> | ||
<suppress> | ||
<notes>Suppress Zookeeper 3.6.2 vulnerabilities</notes> | ||
<gav regex="true">org\.apache\.zookeeper:.*:3\.6\.2</gav> | ||
<vulnerabilityName regex="true">.*</vulnerabilityName> | ||
</suppress> | ||
</suppressions> |