Skip to content

ci: add bandit to pre-commit hooks to check for common security issues - #77

Merged
jenstroeger merged 3 commits into
stagingfrom
add-bandit
Jan 16, 2022
Merged

jenstroeger merged 3 commits into
stagingfrom
add-bandit

Conversation

@jenstroeger

Copy link
Copy Markdown
Owner

As mentioned in issue #5 I added the bandit tool as a pre-commit hook.

I do have a few concerns though:

So, while I think that bandit can be useful, in its current state it’s a bit limited and inflexible for CI.

@jenstroeger
jenstroeger requested a review from behnazh December 16, 2021 10:38
@brad-getpassport

Copy link
Copy Markdown

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 bandit issues will get fixed.

@jenstroeger

Copy link
Copy Markdown
Owner Author

We could add bandit to the development dependencies

"dev": [
"flake8==4.0.1",
"flake8-builtins==1.5.3",
"flake8-docstrings==1.6.0",
"flake8-rst-docstrings==0.2.3",
"hypothesis==6.30.1",
"mypy==0.910",
"pep8-naming==0.12.1",
"pre-commit==2.16.0",
"pylint==2.12.2",
"tox==3.24.4",
"types-setuptools==57.4.2",
],

Then it’ll be installed, and users can use it if they want… or not.

@jenstroeger
jenstroeger marked this pull request as ready for review January 15, 2022 10:22
Comment thread UPSTREAM_README.md Resolved
Comment thread pyproject.toml Resolved
@jenstroeger
jenstroeger merged commit 57a879c into staging Jan 16, 2022
@jenstroeger
jenstroeger deleted the add-bandit branch February 7, 2022 04:46
@travisjungroth

Copy link
Copy Markdown

@jenstroeger Saw this issue mentioned somewhere, and thought you might be interested in how to get the toml config working. PyCQA/bandit#902 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants