Checking vulnerabilities in python code with bandit using jenkins pipeline

1.1k Views Asked by At

Can anyone help me with this in jenkins:

  1. Install the required jenkins plugins .

  2. Configure your job to scan only python files .

  3. Using bandit, scan only the python files of the directory- "examples" and publish the results in html format . And the report is named as report.html .And below is the command I used -

    bandit -r examples/*.py -f html -o report.html

  4. And when clicked on the build now, it is getting failed . Can any help me with this : how to install bandit in a jenkins pipeline ? and pip is also not working in jenkins . I am executing in shell command(os-linux2,pyhthon-2.7 system configuration)

1

There are 1 best solutions below

0
On

use as below and try

bandit -r "examples/*.py" -f html -o report.html