Skip to content

Commit 083e0a5

Browse files
committed
feat: Add Trivy scanner to the pipeline
Signed-off-by: Hubert Siwik <siwik.hubert@gmail.com>
1 parent 1ef072c commit 083e0a5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/verifyimage.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
outputs:
1616
targets: ${{ steps.generate.outputs.targets }}
17+
repo: ${{ steps.metadata.outputs.repo }}
1718
steps:
1819
- name: Checkout
1920
uses: actions/checkout@v4
@@ -25,6 +26,10 @@ jobs:
2526
curl -sSL https://raw.githubusercontent.com/owasp-modsecurity/ModSecurity/v3/master/modsecurity.conf-recommended -o modsecurity.conf-recommended
2627
echo '${{ env.MODSECURITY_RECOMMENDED }}' > sha256sum.txt
2728
sha256sum -c sha256sum.txt
29+
# The environment variable is not accessible in the context of "with" section
30+
- name: Set a repo output
31+
id: metadata
32+
run: echo "repo=${REPO}" >> "$GITHUB_OUTPUT"
2833

2934
build:
3035
runs-on: ubuntu-latest
@@ -60,6 +65,18 @@ jobs:
6065
load: true
6166
push: false
6267

68+
# In case of TOOMANYREQUESTS the cache mechanism should be considered
69+
- name: Scan ${{ matrix.target }}
70+
uses: aquasecurity/trivy-action@0.27.0
71+
with:
72+
image-ref: ${{ needs.prepare.outputs.repo }}:${{ matrix.target }}
73+
format: 'table'
74+
exit-code: '1'
75+
ignore-unfixed: true
76+
vuln-type: 'os,library'
77+
severity: 'CRITICAL,HIGH'
78+
scanners: 'vuln,secret'
79+
6380
- name: Run ${{ matrix.target }}
6481
run: |
6582
echo "Starting container ${{ matrix.target }}"

0 commit comments

Comments
 (0)