Skip to content

Commit ca9598c

Browse files
authored
Update scan-for-vulnerabilities.yaml
Move to trivy.
1 parent ef646d3 commit ca9598c

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

.github/workflows/scan-for-vulnerabilities.yaml

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ jobs:
2222
- name: Checkout code
2323
uses: actions/checkout@v2
2424

25-
- name: Setup Snyk
26-
uses: snyk/actions/setup@master
27-
2825
- name: Build image and version variables
2926
run: |
3027
echo "IMAGE=$CONTAINER_REGISTRY/$CONTAINER_IMAGE" >> $GITHUB_ENV
@@ -37,25 +34,16 @@ jobs:
3734
--build-arg IMAGE_CREATE_DATE="`date -u +"%Y-%m-%dT%H:%M:%SZ"`" \
3835
--build-arg IMAGE_SOURCE_REVISION="`git rev-parse HEAD`" \
3936
--file src/app/Dockerfile src/app
40-
41-
- name: Scan container with Snyk
42-
run: snyk container test --file=src/app/Dockerfile --sarif-file-output=snyk-container-sarif.json "$IMAGE:$IMAGE_VERSION"
43-
continue-on-error: true
44-
env:
45-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
46-
47-
- name: Scan application with Snyk
48-
run: snyk test --sarif-file-output=snyk-app-sarif.json src/app
49-
continue-on-error: true
50-
env:
51-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
52-
53-
- name: Upload container results to GitHub Code Scanning
54-
uses: github/codeql-action/upload-sarif@v1
37+
38+
- name: Run Trivy vulnerability scanner
39+
uses: aquasecurity/trivy-action@master
5540
with:
56-
sarif_file: snyk-container-sarif.json
41+
image-ref: "$IMAGE:$IMAGE_VERSION"
42+
format: 'template'
43+
template: '@/contrib/sarif.tpl'
44+
output: 'trivy-results.sarif'
5745

58-
- name: Upload app results to GitHub Code Scanning
46+
- name: Upload container results to GitHub Code Scanning
5947
uses: github/codeql-action/upload-sarif@v1
6048
with:
61-
sarif_file: snyk-app-sarif.json
49+
sarif_file: trivy-results.sarif

0 commit comments

Comments
 (0)