chore: Update security scan#225
Conversation
Update Trivy scan
Update security scans
Guarantee serif format
Update Security Scan
Reviewer's GuideOverhauls the security GitHub Actions workflow by renaming and restructuring triggers, enriching the Trivy scan with Python setup and severity checks, and introducing a standalone Bandit scanning job. Flow diagram for Bandit scan job in security workflowflowchart TD
A[Checkout code]
B[Set up Python]
C[Create virtual environment]
D[Install dependencies]
E[Install Bandit]
F[Run Bandit Security Scan]
G[Upload SARIF results to Security tab]
H[Upload SARIF as artifact]
A --> B --> C --> D --> E --> F --> G --> H
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @AmberJBlue - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `.github/workflows/security.yaml:89` </location>
<code_context>
+ source .venv/bin/activate
+ pip install -e ".[dev]"
+
+ - name: Install Bandit
+ run: |
+ source .venv/bin/activate
+ pip install bandit[sarif]
+
+ - name: Run Bandit Security Scan
</code_context>
<issue_to_address>
Bandit is installed separately despite being used via a GitHub Action.
Check if installing Bandit separately is required, as the GitHub Action may already handle this. Remove the step if it's unnecessary.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
- name: Install Bandit
run: |
source .venv/bin/activate
pip install bandit[sarif]
- name: Run Bandit Security Scan
uses: PyCQA/bandit-action@v1
with:
targets: "."
exclude: "tests"
=======
- name: Run Bandit Security Scan
uses: PyCQA/bandit-action@v1
with:
targets: "."
exclude: "tests"
>>>>>>> REPLACE
</suggested_fix>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| - name: Install Bandit | ||
| run: | | ||
| source .venv/bin/activate | ||
| pip install bandit[sarif] | ||
|
|
||
| - name: Run Bandit Security Scan | ||
| uses: PyCQA/bandit-action@v1 | ||
| with: | ||
| targets: "." | ||
| exclude: "tests" |
There was a problem hiding this comment.
suggestion: Bandit is installed separately despite being used via a GitHub Action.
Check if installing Bandit separately is required, as the GitHub Action may already handle this. Remove the step if it's unnecessary.
| - name: Install Bandit | |
| run: | | |
| source .venv/bin/activate | |
| pip install bandit[sarif] | |
| - name: Run Bandit Security Scan | |
| uses: PyCQA/bandit-action@v1 | |
| with: | |
| targets: "." | |
| exclude: "tests" | |
| - name: Run Bandit Security Scan | |
| uses: PyCQA/bandit-action@v1 | |
| with: | |
| targets: "." | |
| exclude: "tests" |
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
security.yamlworkflowSummary by Sourcery
Revamp the security scan workflow to improve vulnerability detection and add Python static analysis
New Features:
Enhancements: