Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add workaround for snyk image scan failure #3880

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/scheduled-go-security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
args: '-no-fail -fmt=sarif -out=go-security-scan-results.sarif -exclude-dir=pkg/client -exclude-dir=pkg/clientv1alpha1 ./...'

- name: Upload SARIF file to Github Code Scanning
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: go-security-scan-results.sarif
category: gosec-tool
28 changes: 26 additions & 2 deletions .github/workflows/scheduled-image-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ jobs:
--sarif-file-output=./application/${{ matrix.image.name }}/docker.snyk.sarif
sarif: false

# Replace any "undefined" security severity values with 0. The undefined value is used in the case
# of license-related findings, which do not indicate a security vulnerability.
# See https://github.com/github/codeql-action/issues/2187 for more context.
# This can be removed once https://github.com/snyk/cli/pull/5409 is merged.
- name: Replace security-severity undefined for license-related findings
run: |
sed -i 's/"security-severity": "undefined"/"security-severity": "0"/g' ./application/${{ matrix.image.name }}/docker.snyk.sarif

- name: Upload sarif file to Github Code Scanning
if: always()
continue-on-error: true #avoid fail the pipeline if the SARIF upload fails.
Expand Down Expand Up @@ -80,9 +88,17 @@ jobs:
--sarif-file-output=./application/${{ matrix.image.name }}/docker.snyk.sarif
sarif: false

# Replace any "undefined" security severity values with 0. The undefined value is used in the case
# of license-related findings, which do not indicate a security vulnerability.
# See https://github.com/github/codeql-action/issues/2187 for more context.
# This can be removed once https://github.com/snyk/cli/pull/5409 is merged.
- name: Replace security-severity undefined for license-related findings
run: |
sed -i 's/"security-severity": "undefined"/"security-severity": "0"/g' ./application/${{ matrix.image.name }}/docker.snyk.sarif

- name: Upload sarif file to Github Code Scanning
if: always()
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: application/${{ matrix.image.name }}/docker.snyk.sarif

Expand Down Expand Up @@ -113,8 +129,16 @@ jobs:
--sarif-file-output=./application/${{ matrix.image.name }}/docker.snyk.sarif
sarif: false

# Replace any "undefined" security severity values with 0. The undefined value is used in the case
# of license-related findings, which do not indicate a security vulnerability.
# See https://github.com/github/codeql-action/issues/2187 for more context.
# This can be removed once https://github.com/snyk/cli/pull/5409 is merged.
- name: Replace security-severity undefined for license-related findings
run: |
sed -i 's/"security-severity": "undefined"/"security-severity": "0"/g' ./application/${{ matrix.image.name }}/docker.snyk.sarif

- name: Upload sarif file to Github Code Scanning
if: always()
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: application/${{ matrix.image.name }}/docker.snyk.sarif
Loading