Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control report severity level separately to exit code #696

Open
robertlagrant opened this issue Mar 9, 2021 · 1 comment
Open

Control report severity level separately to exit code #696

robertlagrant opened this issue Mar 9, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@robertlagrant
Copy link

Is your feature request related to a problem? Please describe.
Currently in bandit the minimum severity for reporting and for triggering an exit code of 1 is always the same - controlled by -l, -ll and -lll. This means, for example, that I cannot run bandit in CI with all vulnerabilities going into a report, while failing the CI job on more severe issues.

Describe the solution you'd like
Being able to control the two separately. For example, -lll can still control both, but perhaps having presence of equivalent -L flags overriding what triggers an exit code of 1. So here's my example above in this format:

bandit -r code_dir -l -LLL

Describe alternatives you've considered
I could just run bandit twice: the first time reporting everything with --exit-zero; the second time just reporting high severity and allowing the exit code to influence CI.

Additional context
This is part of how I'd like our CI to work whereby I use the excellent Microsoft open source Bandit SARIF formatter to create a SARIF report, which pushes to Github security issues.

@robertlagrant robertlagrant added the enhancement New feature or request label Mar 9, 2021
@maciejstromich
Copy link
Contributor

dup of #640?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants