Skip to content

Commit f6c7ede

Browse files
author
Gonzalo Diaz
committed
[CONFIG] [Gihub Actions] Docker analisys with Trivy: new secondary "table" output.
1 parent f3d50fe commit f6c7ede

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/docker-image.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
with:
154154
sarif_file: 'snyk.sarif'
155155
scan:
156-
name: "Trivy"
156+
name: "Trivy (sarif)"
157157
runs-on: ubuntu-latest
158158
needs: build
159159
steps:
@@ -179,3 +179,25 @@ jobs:
179179
uses: github/codeql-action/upload-sarif@v3
180180
with:
181181
sarif_file: 'trivy-results.sarif'
182+
183+
report:
184+
name: "Trivy (report)"
185+
runs-on: ubuntu-latest
186+
needs: build
187+
steps:
188+
- name: Download artifact
189+
uses: actions/download-artifact@v4
190+
with:
191+
name: ${{ env.ARTIFACT_NAME }}_prod
192+
path: /tmp/
193+
194+
- name: Load image
195+
run: |
196+
docker load --input /tmp/${{ env.ARTIFACT_NAME }}_prod.tar
197+
docker image ls -a
198+
199+
- name: Run Trivy vulnerability scanner
200+
uses: aquasecurity/[email protected]
201+
with:
202+
image-ref: ${{ env.IMAGE_NAME }}:${{ github.sha }}
203+
format: 'table'

0 commit comments

Comments
 (0)