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

Merged
merged 2 commits into from
Oct 14, 2024
Merged
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
28 changes: 24 additions & 4 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Security

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 1 * * *"

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 +18,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