Add Comprehensive Security Testing to CI Pipeline#762
Conversation
|
@bckohan i am not really sure which one is the best action to take whether to fail the whole pipeline if there are security issues or generate a report so i generated reports. Please advise on the preferred route or the best one |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #762 +/- ##
=======================================
Coverage 91.24% 91.24%
=======================================
Files 28 28
Lines 1897 1897
Branches 273 273
=======================================
Hits 1731 1731
Misses 110 110
Partials 56 56 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds Bandit-based Python static security scanning (SARIF output) to the CI/tooling setup for django-polymorphic, alongside minor adjustments to existing security tooling output naming.
Changes:
- Add a new GitHub Actions workflow to run Bandit and upload SARIF/artifacts.
- Add Bandit configuration + dependency-group entry, and update lockfile accordingly.
- Add
justtargets to run Bandit locally and include it in the broaderchecktask; ignore generated SARIF output.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Adds Bandit and its transitive dependencies to the resolved environment and groups. |
pyproject.toml |
Introduces Bandit configuration and adds Bandit to the lint dependency group. |
justfile |
Adds a bandit recipe and wires Bandit/Zizmor into check. |
.gitignore |
Ignores bandit.sarif. |
.github/workflows/zizmor.yml |
Renames output SARIF file from a generic name to zizmor.sarif. |
.github/workflows/bandit.yml |
New workflow to run Bandit and upload SARIF/artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d7ca03f to
6e551b5
Compare
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out |
Co-authored-by: Johanan Oppong Amoateng <johananoppongamoateng2001@gmail.com> Co-authored-by: Brian Kohan <bckohan@gmail.com>
bckohan
left a comment
There was a problem hiding this comment.
Thanks for this! I made a few tweaks - most notably, results are output in sarif and uploaded to the security tool.
This PR integrates automated security testing into the django-polymorphic CI pipeline, providing continuous security monitoring without blocking development workflows.
The security workflow generates reports instead of failing the pipeline:
Generates reports
Uploads all reports as GitHub Actions artifacts
[x]Uses continue-on-error: true to prevent blocking
Retains reports for 30 days for historical tracking
Closes Add Comprehensive Security and Vulnerability Checks to CI #753