Skip to content

Commit 3968f18

Browse files
committed
chore: add trivy check on docker images
Ticket: WP-6506
1 parent dad7c31 commit 3968f18

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
if: steps.node-modules-cache.outputs.cache-hit != 'true'
126126
run: npm ci
127127

128-
- name: Run Trivy vulnerability scanner
128+
- name: Run Trivy vulnerability scanner (Filesystem)
129129
uses: aquasecurity/trivy-action@master
130130
with:
131131
scan-type: 'fs'
@@ -136,6 +136,36 @@ jobs:
136136
ignore-unfixed: true
137137
scanners: 'vuln' # Only scan for vulnerabilities, not secrets
138138

139+
trivy-image-scan:
140+
name: Security - Docker Image Scan
141+
runs-on: ubuntu-latest
142+
steps:
143+
- name: Checkout
144+
uses: actions/checkout@v4
145+
146+
- name: Set up Docker Buildx
147+
uses: docker/setup-buildx-action@v3
148+
149+
- name: Build Docker image
150+
uses: docker/build-push-action@v5
151+
with:
152+
context: .
153+
push: false
154+
load: true
155+
tags: advanced-wallet-manager:pr-${{ github.event.pull_request.number || 'test' }}
156+
cache-from: type=gha
157+
cache-to: type=gha,mode=max
158+
159+
- name: Run Trivy vulnerability scanner (Docker Image)
160+
uses: aquasecurity/trivy-action@master
161+
with:
162+
image-ref: 'advanced-wallet-manager:pr-${{ github.event.pull_request.number || 'test' }}'
163+
format: 'table'
164+
severity: 'CRITICAL,HIGH'
165+
exit-code: '1'
166+
ignore-unfixed: true
167+
scanners: 'vuln' # Only scan for vulnerabilities, not secrets
168+
139169
test:
140170
name: Test
141171
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)