-
Notifications
You must be signed in to change notification settings - Fork 21
Trivy #1274
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
Trivy #1274
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||||||||||||||||||||||||
| name: Trivy Scanner | ||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||||||
| - dev | ||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||
| trivy-scan: | ||||||||||||||||||||||||||||||||
| name: Use Trivy | ||||||||||||||||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Run Trivy scanner in repo mode | ||||||||||||||||||||||||||||||||
| uses: aquasecurity/trivy-action@0.33.1 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| scan-type: 'fs' | ||||||||||||||||||||||||||||||||
| ignore-unfixed: true | ||||||||||||||||||||||||||||||||
| format: 'sarif' | ||||||||||||||||||||||||||||||||
| output: 'trivy-results.sarif' | ||||||||||||||||||||||||||||||||
| severity: 'CRITICAL,HIGH,UNKNOWN' | ||||||||||||||||||||||||||||||||
|
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. [ |
||||||||||||||||||||||||||||||||
| scanners: vuln,secret,misconfig,license | ||||||||||||||||||||||||||||||||
| github-pat: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Upload Trivy scan results to GitHub Security tab | ||||||||||||||||||||||||||||||||
| uses: github/codeql-action/upload-sarif@v3 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| sarif_file: 'trivy-results.sarif' | ||||||||||||||||||||||||||||||||
|
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. [💡
Comment on lines
+10
to
+30
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 22 days ago To fix the problem, add the
Add: permissions:
contents: read
security-events: writeto the No external methods or imports are required; it's a YAML block edit.
Suggested changeset
1
.github/workflows/trivy.yaml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
||||||||||||||||||||||||||||||||
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.
[⚠️
maintainability]Consider using a more stable version of Ubuntu, such as
ubuntu-latest, to ensure compatibility and reduce maintenance overhead when newer versions are released.