Skip to content

SARIF output ignores exclude argument #1255

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

Closed
bmos opened this issue Apr 5, 2025 · 2 comments
Closed

SARIF output ignores exclude argument #1255

bmos opened this issue Apr 5, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@bmos
Copy link
Contributor

bmos commented Apr 5, 2025

Describe the bug

When using the SARIF output, results are shown for files that match the exclude argument

Reproduction steps

1. Install a module with a bunch of dependencies to a virtual environment at .venv
1. Install bandit[sarif]
1. Run `bandit --format sarif --exclude .venv/* --recursive .`
1. Examine results.sarif

Expected behavior

Results in sarif file respect the choices passed in using --exclude

Bandit version

1.8.3 (Default)

Python version

3.13 (Default)

Additional context

No response

@bmos bmos added the bug Something isn't working label Apr 5, 2025
@bmos
Copy link
Contributor Author

bmos commented Apr 5, 2025

I also had this issue when passing in .venv via pyproject.toml (with bandit[toml,sarif])

[tool.bandit]
exclude_dirs = [".venv/"]

@ericwb
Copy link
Member

ericwb commented Apr 7, 2025

I don't think this is specific to SARIF format. Instead appears to be the same problem as noted in issue #975

@ericwb ericwb closed this as completed Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants