Python code for security analysis using Bandit

怎甘沉沦 提交于 2019-12-24 00:27:03

问题


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:


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 by adding -x env to the command (now it would look like this: bandit -r . -x env).

For more information, please refer to Bandit main page.



来源:https://stackoverflow.com/questions/46864556/python-code-for-security-analysis-using-bandit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!