Skip to content

Commit 9ff6713

Browse files
committed
Try allowlist for grype and trivy
Signed-off-by: Victor Chang <vicchang@nvidia.com>
1 parent 77a02d8 commit 9ff6713

File tree

4 files changed

+40
-23
lines changed

4 files changed

+40
-23
lines changed

.github/containerscan/allowedlist.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,34 +88,39 @@ jobs:
8888
labels: ${{ steps.meta.outputs.labels }}
8989
file: ${{ matrix.dockerfile }}
9090

91-
- uses: hands-lab/dockle-action@v1
91+
- name: Dockle Container Scanner
92+
uses: erzz/dockle-action@v1
93+
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/develop') }}
9294
with:
9395
image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
96+
report-format: sarif
97+
report-name: dockle-report
98+
failure-threshold: fatal
99+
100+
- name: Upload Dockle SARIF Report
101+
uses: github/codeql-action/upload-sarif@v1.2.0
102+
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/develop') }}
103+
with:
104+
sarif_file: super-report.sarif
94105

95106
- name: Trivy Vulnerability Scanner
96107
uses: aquasecurity/trivy-action@master
108+
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/develop') }}
97109
with:
98110
image-ref: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
99111
format: 'sarif'
100112
output: 'trivy-results.sarif'
101113

102-
- name: Upload Trivy scan results to GitHub Security tab
114+
- name: Upload Trivy SARIF Report
103115
uses: github/codeql-action/upload-sarif@v2
116+
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/develop') }}
104117
with:
105118
sarif_file: 'trivy-results.sarif'
106119

107-
- name: Scan Image with Azure Container Scan
108-
uses: Azure/container-scan@v0.1
109-
if: always()
110-
env:
111-
TRIVY_TIMEOUT_SEC: 360s
112-
with:
113-
image-name: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
114-
115120
- name: Anchore Container Scan
116121
id: anchore-scan
117122
uses: anchore/scan-action@v3.2.5
118-
if: always()
123+
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/develop') }}
119124
with:
120125
image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
121126
fail-build: true
@@ -124,7 +129,7 @@ jobs:
124129

125130
- name: Upload Anchore Scan SARIF Report
126131
uses: github/codeql-action/upload-sarif@v2
127-
if: always()
132+
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/develop') }}
128133
with:
129134
sarif_file: ${{ steps.anchore-scan.outputs.sarif }}
130135
token: ${{ secrets.GITHUB_TOKEN }}

.grype.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
ignore:
16-
- vulnerability: CVE-2022-37434 # medium https://ubuntu.com/security/CVE-2022-37434
17-
- vulnerability: CVE-2015-5237 # low https://ubuntu.com/security/CVE-2015-5237
18-
- vulnerability: CVE-2016-20013 # negligible https://ubuntu.com/security/CVE-2016-20013
19-
- vulnerability: CVE-2017-11164 # negligible https://ubuntu.com/security/CVE-2017-11164
20-
- vulnerability: CVE-2020-16156 # medium https://ubuntu.com/security/CVE-2020-16156
21-
- vulnerability: CVE-2022-29458 # negligible https://ubuntu.com/security/CVE-2022-29458
15+
# ignore:
16+
# - vulnerability: CVE-2022-37434 # medium https://ubuntu.com/security/CVE-2022-37434
17+
# - vulnerability: CVE-2015-5237 # low https://ubuntu.com/security/CVE-2015-5237
18+
# - vulnerability: CVE-2016-20013 # negligible https://ubuntu.com/security/CVE-2016-20013
19+
# - vulnerability: CVE-2017-11164 # negligible https://ubuntu.com/security/CVE-2017-11164
20+
# - vulnerability: CVE-2020-16156 # medium https://ubuntu.com/security/CVE-2020-16156
21+
# - vulnerability: CVE-2022-29458 # negligible https://ubuntu.com/security/CVE-2022-29458
2222

.trivyignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2022 MONAI Consortium
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# CVE-2022-27664
16+
# CVE-2022-32149

0 commit comments

Comments
 (0)