diff --git a/jobs/tools-templates/bandit.yaml b/jobs/tools-templates/bandit.yaml index beaff9c..763af83 100644 --- a/jobs/tools-templates/bandit.yaml +++ b/jobs/tools-templates/bandit.yaml @@ -1,18 +1,18 @@ - job-template: name: '{name}-bandit' description: "A job template for openstack's python static analyzer" concurrent: true output_type: html builders: - shell: | #!/bin/bash -e docker pull linosgian/bandit docker run --rm \ - -u $(id -u):$(id -g) \ - -v $PWD:/app \ - linosgian/bandit -r . -f {output_type} -o {name}.{output_type} {bandit_extra_args} + -u $(id -u):$(id -g) \ + -v $PWD:/app \ + linosgian/bandit -P -r . -f {output_type} -o {name}.{output_type} {bandit_extra_args} triggers: - timed: '@hourly' scm: - git: url: '{repo}' diff --git a/tools/bandit/Dockerfile b/tools/bandit/Dockerfile index 71a8f44..4c92192 100644 --- a/tools/bandit/Dockerfile +++ b/tools/bandit/Dockerfile @@ -1,6 +1,7 @@ FROM python:2 RUN pip install bandit WORKDIR /app -ENTRYPOINT ["bandit"] +# Invert bandit's exit code it returns 1 upon success (?!) +ENTRYPOINT ["/bin/bash", "-c", "! bandit $@"] diff --git a/tools/bandit/out.html b/tools/bandit/out.html new file mode 100644 index 0000000..581fbba --- /dev/null +++ b/tools/bandit/out.html @@ -0,0 +1,105 @@ + + + +
+ + + +