@@ -297,7 +297,14 @@ jobs:
297
297
# This is where you will need to introduce the Snyk API token created with your Snyk account
298
298
SNYK_TOKEN : ${{ secrets.SNYK_TOKEN }}
299
299
300
+ # Replace any "undefined" security severity values with 0. The undefined value is used in the case
301
+ # of license-related findings, which do not do not indicate a security vulnerability.
302
+ # See https://github.com/github/codeql-action/issues/2187 for more context.
303
+ - name : Post-process sarif output
304
+ run : |
305
+ sed -i 's/"security-severity": "undefined"/"security-severity": "0"/g' snyk-code.sarif
300
306
# Push the Snyk Code results into GitHub Code Scanning tab
307
+
301
308
- name : Upload result to GitHub Code Scanning
302
309
uses : github/codeql-action/upload-sarif@v3
303
310
with :
@@ -352,29 +359,23 @@ jobs:
352
359
actions : read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
353
360
runs-on : ubuntu-latest
354
361
steps :
355
- - uses : actions/checkout@v4
356
- - name : Set up Snyk CLI to check for security issues
357
- # Snyk can be used to break the build when it detects security issues.
358
- # In this case we want to upload the SAST issues to GitHub Code Scanning
359
- uses : snyk/actions/setup@master
360
- env :
361
- # This is where you will need to introduce the Snyk API token created with your Snyk account
362
- SNYK_TOKEN : ${{ secrets.SNYK_TOKEN }}
363
-
364
- - name : Snyk auth
365
- shell : bash
366
- run : snyk config set api=$SNYK_TOKEN
367
- env :
368
- # This is where you will need to introduce the Snyk API token created with your Snyk account
369
- SNYK_TOKEN : ${{ secrets.SNYK_TOKEN }}
370
-
371
362
- name : Snyk Container test
363
+ uses : snyk/actions/docker@master
372
364
continue-on-error : true
373
- shell : bash
374
- run : snyk container test traefik:v2.11.0 --sarif --sarif-file-output=snyk-code.sarif
375
365
env :
376
366
# This is where you will need to introduce the Snyk API token created with your Snyk account
377
367
SNYK_TOKEN : ${{ secrets.SNYK_TOKEN }}
368
+ with :
369
+ image : traefik:v2.11.0
370
+ args : --sarif --sarif-file-output=snyk-code.sarif
371
+
372
+ # Replace any "undefined" security severity values with 0. The undefined value is used in the case
373
+ # of license-related findings, which do not do not indicate a security vulnerability.
374
+ # See https://github.com/github/codeql-action/issues/2187 for more context.
375
+ - name : Post-process sarif output
376
+ run : |
377
+ sed -i 's/"security-severity": "undefined"/"security-severity": "0"/g' snyk-code.sarif
378
+ # Push the Snyk Code results into GitHub Code Scanning tab
378
379
379
380
# Push the Snyk Code results into GitHub Code Scanning tab
380
381
- name : Upload result to GitHub Code Scanning
0 commit comments