diff --git a/README.md b/README.md index 8d2d8ded842db189bdc0598508eee1cbbbdfdb69..33fb738a3ab594e66386461b619ad00e8df81b7d 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: Wed Sep 18 15:39:40 CDT 2019_\n +- 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 diff --git a/dependency-check/Dockerfile b/dependency-check/Dockerfile index 93f3a7f87b25d72b198b600d91dce1842c9a9246..f2e77c8bfa65061ba51ed5e4928d6f1148ffbb7d 100644 --- a/dependency-check/Dockerfile +++ b/dependency-check/Dockerfile @@ -12,8 +12,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.schema-version="1.0" \ maintainer="J.R. Barreras <rbarrerasmilanes@nebraska.edu>" -#ENV DEPENDENCY_CHECK_VERSION 4.0.2-release -ENV DEPENDENCY_CHECK_VERSION 5.0.0-M3-release +ENV DEPENDENCY_CHECK_VERSION 5.2.1-release WORKDIR /opt @@ -22,15 +21,16 @@ RUN apk add --no-cache curl jq su-exec && \ 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 && \ - /opt/dependency-check/bin/dependency-check.sh --updateonly + /opt/dependency-check/bin/dependency-check.sh --updateonly && \ + ln -s /opt/dependency-check/bin/dependency-check.sh /opt/dependency-check/bin/dependency-check ENV PATH $PATH:/opt/dependency-check/bin WORKDIR /work -COPY entrypoint.sh /usr/local/bin/ -RUN chmod +x /usr/local/bin/entrypoint.sh -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +COPY docker-entrypoint.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/docker-entrypoint.sh +ENTRYPOINT ["docker-entrypoint.sh"] -CMD ["/usr/local/bin/entrypoint.sh"] +CMD ["/bin/sh"] diff --git a/dependency-check/docker-entrypoint.sh b/dependency-check/docker-entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..01a573578f5ab3c7d8031dbb938555c46ccad113 --- /dev/null +++ b/dependency-check/docker-entrypoint.sh @@ -0,0 +1,34 @@ +#!/bin/sh +set -e + +if [ "${1#-}" != "$1" ]; then + echo "OK" + set -- dependency-check "$@" +fi + +exec "$@" + + +#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