Repository navigation
Maintenance #440
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
Maintenance #440
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,17 +13,28 @@ jobs: | |
| security-events: write # For uploading SARIF to Security tab | ||
| steps: | ||
| - name: "Checkout repository" | ||
| uses: "actions/checkout@v4" | ||
| uses: "actions/checkout@v6" | ||
| with: | ||
| # This explicitly tells the runner to use the branch that triggered the workflow | ||
| ref: ${{ github.ref_name }} | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
| - name: "Run Trivy vulnerability scanner" | ||
| uses: "aquasecurity/trivy-action@0.69.2" | ||
|
Comment on lines
+22
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 suggestion (security): The Trivy action is version-tagged and also configured with Relying on a floating tag and
Suggested implementation:
|
||
| # uses: "aquasecurity/trivy-action@c1824fd6edce30d7ab345a9989de00bbd46ef284" # Pinned to SHA for v0.34.0 | ||
| env: # Suppress version check notification | ||
| TRIVY_SKIP_VERSION_CHECK: 'true' | ||
| with: | ||
| version: 'latest' | ||
| scan-type: 'fs' # Scans the filesystem (your repo after checkout) | ||
| scanners: 'vuln,secret,misconfig,license' # Vulns, secrets, configs, licenses | ||
| hide-progress: false | ||
| format: 'sarif' # Outputs in SARIF for GitHub integration (shows in Security tab) | ||
| output: 'trivy-results.sarif' | ||
| severity: 'CRITICAL,HIGH' # Focus on serious issues | ||
| exit-code: '1' # Fail the workflow if critical/high vulns found (set to '0' to not fail) | ||
| ignore-unfixed: true # Ignore vulns without fixes available | ||
|
|
||
| - name: "Install Trivy" | ||
| run: | | ||
| curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.48.3 | ||
|
|
||
| - name: "Run Trivy FS Scan" | ||
| run: | | ||
| trivy fs --format sarif -exit-code 1 --output trivy-results.sarif --severity CRITICAL,HIGH --ignore-unfixed . | ||
| - name: "Upload Trivy scan results to GitHub Security tab" | ||
| uses: "github/codeql-action/upload-sarif@ef618feace3c4838ae42b239ab86e8fb46437508" # Pinned to SHA for v4.32.2 | ||
| if: always() # Upload even if scan fails | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): The
actions/checkout@v6reference is likely invalid and will cause the job to fail.actions/checkoutcurrently only goes up tov4, so@v6will fail to resolve and the workflow will stop before reaching the Trivy step. Useactions/checkout@v4(or a pinned v4 commit) instead.