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

ci: report vulnerabilities and fail on HIGH,CRITICAL #152

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
22 changes: 22 additions & 0 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
scan:
name: Scan for known vulnerabilities
runs-on: ubuntu-latest
env:
TRIVY_RESULTS: 'trivy-results.sarif'
steps:
- uses: actions/checkout@v3

Expand All @@ -18,3 +20,23 @@ jobs:
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: ${{ env.TRIVY_RESULTS }}

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ env.TRIVY_RESULTS }}

- uses: actions/upload-artifact@v4
with:
name: ${{ env.TRIVY_RESULTS }}
path: ${{ env.TRIVY_RESULTS }}

- name: Raise error on HIGH,CRITICAL vulnerabilities
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
severity: 'CRITICAL,HIGH'
exit-code: '1'
Loading