Skip to content

Commit

Permalink
Forcing bandit exit 0
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-figueiredo committed Feb 1, 2021
1 parent 4a9d495 commit b71b461
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions docker/sast-check.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh -x
#!/bin/sh

export NOW="$(date +%s)"
TMP_REPORT="$(mktemp)"

# Run Bandit and save report on temporary folder
set -euo pipefail
bandit --version
bandit -r -a vuln -ii -ll -x .git,.svn,.mvn,.idea,dist,bin,obj,backup,docs,tests,test,tmp,reports,venv "$@" -f json -o report.json
bandit -r -a vuln -ii -ll -x .git,.svn,.mvn,.idea,dist,bin,obj,backup,docs,tests,test,tmp,reports,venv "$@" -f json -o "${TMP_REPORT}" --exit-zero

# EXITCODE=$?
# RESULT="${RESULT//'%'/'%25'}"
Expand All @@ -16,8 +16,7 @@ bandit -r -a vuln -ii -ll -x .git,.svn,.mvn,.idea,dist,bin,obj,backup,docs,tests
# echo "${EXITCODE}"

# Print Report on screen to developers
# cat "${TMP_REPORT}"
cat report.json
cat "${TMP_REPORT}"

if [ -z ${DD_CLIENT_API_KEY} ] || [ -z ${GITHUB_REPOSITORY} ]
then
Expand Down Expand Up @@ -113,5 +112,4 @@ EOF
fi

# Removing temporary files
#rm -rf "${TMP_REPORT}"
rm -rf report.json
rm -rf "${TMP_REPORT}"

0 comments on commit b71b461

Please sign in to comment.