Skip to content

Commit 5e53801

Browse files
fix: restore -r flag for bandit targets
The YAML config does not support a "targets" key — that was INI-format only. Without -r on the CLI, bandit gets no scan targets and produces an empty SARIF file.
1 parent eed0071 commit 5e53801

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

.bandit

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# Bandit configuration
1+
# Bandit configuration (YAML format, bandit 1.9+)
22
# https://bandit.readthedocs.io/en/latest/config.html
3-
4-
# Python directories to scan (add new entries here instead of
5-
# editing the workflow file)
6-
targets:
7-
- scripts/aidlc-evaluator
3+
#
4+
# NOTE: scan targets must be passed via -r on the CLI; the YAML config
5+
# does not support a "targets" key. Edit the workflow's bandit command
6+
# to add new directories.
87

98
# Exclude test directories (test code often has intentional patterns
109
# that trigger false positives like assert, subprocess in fixtures)

.github/workflows/security-scanners.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ jobs:
231231
pip install -r requirements.txt
232232
rm requirements.txt
233233
set +e
234-
bandit -c .bandit -f sarif -o bandit-report_sarif.json
234+
bandit -c .bandit -r scripts/aidlc-evaluator -f sarif -o bandit-report_sarif.json
235235
BANDIT_EXIT=$?
236236
set -e
237237
# Fail only if HIGH severity findings exist (level=error in SARIF)

0 commit comments

Comments
 (0)