bandit-python

How can I make bandit skip B101 within tests?

How can I make bandit skip B101 within tests? Question: I’m using bandit to check my code for potential security issues: bandit -r git-repository/ However, the most common item found by bandit is B101. It is triggered by assert statements within tests. I use pytest, so this is not a concern, but a good practice. …

Total answers: 6

What is the way to ignore/skip some issues from python bandit security issues report?

What is the way to ignore/skip some issues from python bandit security issues report? Question: I’ve got a bunch of django_mark_safe errors >> Issue: [B703:django_mark_safe] Potential XSS on mark_safe function. Severity: Medium Confidence: High Location: … More Info: https://bandit.readthedocs.io/en/latest/plugins/b703_django_mark_safe.html 54 return mark_safe(f'<a href=”{url}” target=”_blank”>{title}</a>’) >> Issue: [B308:blacklist] Use of mark_safe() may expose cross-site scripting vulnerabilities …

Total answers: 5