Skip to content

Commit 4086046

Browse files
authored
[CI] Add a workflow for Bandit check (#16394)
We're preparing for public releases - it requires that all python code is verified with the Bandit tool. This PR adds new workflow to perform the check.
1 parent dcfdcfa commit 4086046

File tree

2 files changed

+436
-0
lines changed

2 files changed

+436
-0
lines changed

.github/workflows/bandit.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Scan Python code with Bandit
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 3 * * *'
7+
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
bandit:
14+
name: Bandit
15+
runs-on: ubuntu-latest
16+
permissions:
17+
security-events: write
18+
19+
steps:
20+
- name: Clone the git repo
21+
uses: actions/checkout@v4
22+
23+
- name: Install Bandit
24+
run: pip install bandit bandit-sarif-formatter
25+
26+
- name: Run Bandit
27+
run: |
28+
bandit -c devops/bandit.config -r . --exit-zero -f sarif -o bandit_results.sarif
29+
30+
- uses: github/codeql-action/upload-sarif@v3
31+
with:
32+
sarif_file: bandit_results.sarif

0 commit comments

Comments
 (0)