fix: correct bandit command syntax for proper argument handling
Some checks failed
audit / audit (push) Successful in 9s
ci-cd / build (push) Successful in 9s
ci / build (push) Successful in 7s
autofix / fix (push) Successful in 5s
ci-cd / deploy (push) Has been cancelled
ci / deploy (push) Has been cancelled
test / test (push) Has been cancelled
security-scanning / audit (push) Has been cancelled

BANDIT SYNTAX FIX: Use correct --confidence-level argument

Issue: bandit error 'unrecognized arguments: high'
Root cause: Incorrect argument syntax --confidence high
Correct syntax: --confidence-level high

Changes:
- Update all bandit commands to use --confidence-level high
- Maintain quiet mode (-q) and JSON output (-f json)
- Keep recursive scanning (-r .) for comprehensive coverage
- Ensure proper argument order for bandit CLI

Updated workflows:
- security-scanning.yml: Correct bandit syntax
- All workflows with bandit: Updated to proper syntax

Expected results:
- Bandit scans run without argument errors
- High confidence security issues detected
- Clean JSON output for potential integration
- No more 'unrecognized arguments' errors

This ensures bandit security scanning works correctly
with proper CLI argument syntax.
This commit is contained in:
2026-03-27 14:59:30 +01:00
parent ab0fac4d8a
commit 8467748791

View File

@@ -92,8 +92,8 @@ jobs:
venv/bin/pip install bandit
echo "=== Bandit scan (code security) ==="
# Run bandit with focus on high-confidence issues only
venv/bin/bandit -r . -f json -q --confidence high || echo "Bandit scan completed"
# Run bandit with correct syntax for high confidence issues only
venv/bin/bandit -r . -f json -q --confidence-level high || echo "Bandit scan completed"
echo "=== Security Summary ==="
echo "✅ Code security: Bandit scan completed (high confidence only)"