diff --git a/README.md b/README.md index 33fb738a3ab594e66386461b619ad00e8df81b7d..f839051527723eb11259c994ddbbe3df1da06037 100644 --- a/README.md +++ b/README.md @@ -25,4 +25,4 @@ This file is automatically updated after execute `git commit` based on the conte - its-registry.unl.edu/unl-its/docker-ci/static-code-analysis:android - its-registry.unl.edu/unl-its/docker-ci/static-code-analysis:latest - its-registry.unl.edu/unl-its/docker-ci/static-code-analysis:php -- its-registry.unl.edu/unl-its/docker-ci/static-code-analysis:python \n \n\n\r_Last update: Thu Sep 19 16:28:10 CDT 2019_\n +- its-registry.unl.edu/unl-its/docker-ci/static-code-analysis:python \n \n\n\r_Last update: Fri Sep 20 09:15:46 CDT 2019_\n diff --git a/dependency-check/Dockerfile b/dependency-check/Dockerfile index f2e77c8bfa65061ba51ed5e4928d6f1148ffbb7d..eff438612e8f973ea137e35537f05326d626a7dd 100644 --- a/dependency-check/Dockerfile +++ b/dependency-check/Dockerfile @@ -17,7 +17,7 @@ ENV DEPENDENCY_CHECK_VERSION 5.2.1-release WORKDIR /opt -RUN apk add --no-cache curl jq su-exec && \ +RUN apk add --no-cache curl jq su-exec bash && \ curl --insecure -o ./dependency-check.zip -L https://dl.bintray.com/jeremy-long/owasp/dependency-check-${DEPENDENCY_CHECK_VERSION}.zip && \ unzip dependency-check.zip && \ rm dependency-check.zip && \ @@ -31,6 +31,6 @@ WORKDIR /work COPY docker-entrypoint.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/docker-entrypoint.sh -ENTRYPOINT ["docker-entrypoint.sh"] +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] -CMD ["/bin/sh"] +CMD ["/bin/bash"] diff --git a/dependency-check/docker-entrypoint.sh b/dependency-check/docker-entrypoint.sh index 01a573578f5ab3c7d8031dbb938555c46ccad113..14aea3c7abeaab09a6ba40d603b85456737e1599 100644 --- a/dependency-check/docker-entrypoint.sh +++ b/dependency-check/docker-entrypoint.sh @@ -1,34 +1,8 @@ -#!/bin/sh +#!/bin/bash set -e -if [ "${1#-}" != "$1" ]; then - echo "OK" - set -- dependency-check "$@" -fi +USER_ID=${LOCAL_USER_ID:-9001} -exec "$@" +su-exec user "$@" -#VERSION=0.1 - -#echo ${VERSION} - -#if [ $1 == '-v' ]; then -# dependency-check.sh -v -# exit 0 -#fi - -#DEPENDENCY_CHECK_OUT_DIR=${DEPENDENCY_CHECK_OUT_DIR-"`pwd`/dependency-check-report/"} -#SRC_DIR=${SRC_DIR-"./"} - -#mkdir -p ${DEPENDENCY_CHECK_OUT_DIR} -#dependency-check.sh --format ALL -s ${SRC_DIR} --out ${DEPENDENCY_CHECK_OUT_DIR} --project ${CI_PROJECT_NAMESPACE} -n - -#cat ${DEPENDENCY_CHECK_OUT_DIR}/dependency-check-report.json | jq '.dependencies | .[] | select (.vulnerabilities) | [.fileName, .filePath, .vulnerabilities]' | sed -e "s/\"\/work\///g" -#RESULT=`cat ${DEPENDENCY_CHECK_OUT_DIR}/dependency-check-report.json | jq '.dependencies | .[] | select (.vulnerabilities) | [.fileName, .filePath, .vulnerabilities] | length == 0' | sed -e "s/\"\/work\///g"` - -#if [ "${RESULT}" = "" ]; then -# exit 0 -#else -# exit 1 -#fi diff --git a/dependency-check/entrypoint.sh b/dependency-check/entrypoint.sh deleted file mode 100644 index 28b365290cc5051076646d095ea41f991de6c291..0000000000000000000000000000000000000000 --- a/dependency-check/entrypoint.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -set -e - -if [ $1 == '-v' ]; then - dependency-check.sh -v - exit 0 -fi - -DEPENDENCY_CHECK_OUT_DIR=${DEPENDENCY_CHECK_OUT_DIR-"`pwd`/dependency-check-report/"} - -mkdir -p ${DEPENDENCY_CHECK_OUT_DIR} -dependency-check.sh --format ALL -s ./ --out ${DEPENDENCY_CHECK_OUT_DIR} --project ${CI_PROJECT_NAMESPACE} -n - -cat ${DEPENDENCY_CHECK_OUT_DIR}/dependency-check-report.json | jq '.dependencies | .[] | select (.vulnerabilities) | [.fileName, .filePath, .vulnerabilities]' | sed -e "s/\"\/work\///g" -RESULT=`cat ${DEPENDENCY_CHECK_OUT_DIR}/dependency-check-report.json | jq '.dependencies | .[] | select (.vulnerabilities) | [.fileName, .filePath, .vulnerabilities] | length == 0' | sed -e "s/\"\/work\///g"` - -if [ "${RESULT}" = "" ]; then - exit 0 -else - exit 1 -fi