-
Notifications
You must be signed in to change notification settings - Fork 3
chore: Add Trivy and Bandit scan workflow #4
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
Open
AmberJBlue
wants to merge
7
commits into
trustyai-explainability:main
Choose a base branch
from
AmberJBlue:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8fca3a5
Add trivy and bandit yaml
AmberJBlue 0ab80c9
Merge pull request #1 from AmberJBlue/add-security-scan
AmberJBlue ff23941
move to workflows dir
AmberJBlue 926326b
move to workflows dir
AmberJBlue bfd1bdb
update security-scan.yaml
AmberJBlue a7cbbc8
Merge pull request #2 from AmberJBlue/add-security-scan
AmberJBlue fa15326
Pin actions and upload bandit results
AmberJBlue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| name: Security Scan | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| trivy-scan: | ||
| name: Trivy | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| security-events: write | ||
| actions: read | ||
| contents: read | ||
| checks: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run Trivy vulnerability scan | ||
| uses: aquasecurity/[email protected] | ||
| with: | ||
| scan-type: fs | ||
| scan-ref: . | ||
| format: sarif | ||
| output: trivy-results.sarif | ||
| severity: CRITICAL,HIGH,MEDIUM,LOW | ||
| exit-code: 0 | ||
|
|
||
| - name: Check for critical and high vulnerabilities | ||
| uses: aquasecurity/[email protected] | ||
AmberJBlue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| with: | ||
| scan-type: fs | ||
| scan-ref: . | ||
| format: table | ||
| severity: CRITICAL,HIGH | ||
| exit-code: 1 | ||
| continue-on-error: true | ||
AmberJBlue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Upload SARIF to Security tab | ||
| if: always() | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: trivy-results.sarif | ||
| category: trivy-security-scan | ||
|
|
||
| bandit: | ||
| name: Bandit | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| security-events: write | ||
| actions: read | ||
| contents: read | ||
| checks: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Run Bandit code scan | ||
| uses: PyCQA/bandit-action@v1 | ||
AmberJBlue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| with: | ||
| project_path: . | ||
| bandit_args: "-r . -f sarif -o results.sarif" | ||
| continue-on-error: true | ||
|
|
||
| - name: Upload SARIF as artifact | ||
| if: always() | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: results.sarif | ||
| category: bandit-security-scan | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.