Python code for security analysis using Bandit

2019-08-06 12:50发布

I would like to get python code for an analysis using Bandit static analyzer. The main emphasis is security, for python 2.7.

Can anyone help ?

Thx.

1条回答
手持菜刀,她持情操
2楼-- · 2019-08-06 13:15

You don't need to write code to test your software using Bandit static analyzer tool.

All you need to do (in the most basic scenario) is:

  1. Install Bandit with pip3 install bandit (Python3) or pip install bandit (Python2)
  2. Navigate to your project in terminal, e.g. `cd /home/user/projects/abc/'
  3. Run the Bandit on your source code with bandit -r .

What you may also want to do, is to exclude virtualenv libraries' files from testing with bandit -r . -x env.

For more information, please refer to Bandit main page.

查看更多
登录 后发表回答