Skip to content

Commit 8111354

Browse files
authored
ci: add Bandit security scanning for Python code with HTML reporting (#198)
* add bandir scan gh workflow * save bandit report * convert report to html * try to skip dependencies installation * revert dependencies installation * cleanup
1 parent 52a098d commit 8111354

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

‎.github/workflows/codeql.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,30 @@ jobs:
9090
with:
9191
sarif_file: rust/clippy.sarif
9292
wait-for-processing: true
93+
94+
analyze_bandit:
95+
name: Analyze (Bandit Scan)
96+
runs-on: ubuntu-latest
97+
permissions:
98+
actions: read
99+
contents: read
100+
security-events: write
101+
102+
steps:
103+
- name: Install dependencies
104+
run: pip install sarif-tools
105+
106+
- name: Perform Bandit Analysis
107+
uses: PyCQA/bandit-action@67a458d90fa11fb1463e91e7f4c8f068b5863c7f # v1.0.1
108+
continue-on-error: true
109+
with:
110+
targets: "python"
111+
112+
- name: Convert SARIF report to HTML
113+
run: sarif html --output bandit-report.html results.sarif
114+
115+
- name: Upload Bandit Scan report
116+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
117+
with:
118+
name: bandit-report
119+
path: bandit-report.html

0 commit comments

Comments
 (0)