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

[Security] Add Bandit #795

Merged
merged 2 commits into from
Mar 1, 2025
Merged

[Security] Add Bandit #795

merged 2 commits into from
Mar 1, 2025

Conversation

aliberts
Copy link
Collaborator

@aliberts aliberts commented Mar 1, 2025

What this does

Adds Bandit in pre-commits which is a security linter to detect common security issues in Python code.

Performs the following fixes to comply with the issues reported:

  • Rename eval -> eval_main as bandit thinks this is python's built-in eval function (we should use builtins names anyway)
  • Add a timeout value to some requests.get calls
  • Replaced an os.system with the safer subprocess.run(..., shell=False)
  • Other unrelated formatting fixes due to running pre-commit run -a

Deactivates a few rules after verification that this is reasonable given our usage:

Took the opportunity to update pre-commit hooks.

How it was tested

Ran pre-commit run -a

@aliberts aliberts requested a review from Cadene March 1, 2025 18:07
@aliberts aliberts marked this pull request as ready for review March 1, 2025 18:07
Copy link
Collaborator

@Cadene Cadene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@aliberts aliberts merged commit 8861546 into main Mar 1, 2025
6 checks passed
@aliberts aliberts deleted the user/aliberts/2025_03_01_add_bandit branch March 1, 2025 18:19
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.

2 participants