Add bandit for Python security linting

- Add bandit as dev dependency
- Configure in pyproject.toml (exclude venv/tests)
- Skip B101 (assert) and B311 (random for non-crypto)
- Add Makefile target: security-backend
This commit is contained in:
counterweight 2025-12-21 21:56:46 +01:00
parent 6a2d7155cb
commit 30583805cd
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
2 changed files with 12 additions and 1 deletions

View file

@ -1,4 +1,4 @@
.PHONY: install-backend install-frontend install setup-hooks backend frontend db db-stop db-ready db-seed dev test test-backend test-frontend test-e2e typecheck generate-types generate-types-standalone check-types-fresh check-constants lint-backend format-backend fix-backend
.PHONY: install-backend install-frontend install setup-hooks backend frontend db db-stop db-ready db-seed dev test test-backend test-frontend test-e2e typecheck generate-types generate-types-standalone check-types-fresh check-constants lint-backend format-backend fix-backend security-backend
-include .env
export
@ -102,3 +102,6 @@ format-backend:
fix-backend:
cd backend && uv run ruff check --fix . && uv run ruff format .
security-backend:
cd backend && uv run bandit -r . -c pyproject.toml