Repository navigation
ci: add bandit to pre-commit hooks to check for common security issues - #77
Merged
Merged
Conversation
|
My suggestion would be to make it usable for running locally but not integrated as part of a github action. This allows us to parse the issues and give feedback to bandit. Hopefully over time it these |
Owner
Author
|
We could add python-package-template/setup.py Lines 61 to 73 in 7292ee9 Then it’ll be installed, and users can use it if they want… or not. |
jenstroeger
force-pushed
the
add-bandit
branch
from
January 6, 2022 11:23
af660df to
7d37c2e
Compare
jenstroeger
force-pushed
the
staging
branch
2 times, most recently
from
January 15, 2022 09:32
5ab088f to
61c2b39
Compare
jenstroeger
force-pushed
the
add-bandit
branch
from
January 15, 2022 10:21
7d37c2e to
6239a60
Compare
jenstroeger
marked this pull request as ready for review
January 15, 2022 10:22
behnazh
requested changes
Jan 16, 2022
behnazh
approved these changes
Jan 16, 2022
|
@jenstroeger Saw this issue mentioned somewhere, and thought you might be interested in how to get the toml config working. PyCQA/bandit#902 (comment) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As mentioned in issue #5 I added the bandit tool as a pre-commit hook.
I do have a few concerns though:
pyproject.tomlconfiguration isn’t currently supported (issue Error parsing pyproject.tml PyCQA/bandit#733) but seems to have been committed to mainstream (commit PyCQA/bandit@44f5c41) but I couldn’t make that work.banditas issue B101, and it’s not possible to disable that for tests only (issue Skip configuration for certain paths only PyCQA/bandit#457); so I’ve disabled it globally through the command-line (because thepyproject.tomlisn’t working).So, while I think that
banditcan be useful, in its current state it’s a bit limited and inflexible for CI.