From 6ba7bad34eb3fb10dab6bee9d51d54940798a86a Mon Sep 17 00:00:00 2001 From: superpoussin22 Date: Wed, 15 Aug 2018 13:54:56 +0200 Subject: add a few basic test (#572) --- include/helper_audit_dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include/helper_audit_dockerfile') diff --git a/include/helper_audit_dockerfile b/include/helper_audit_dockerfile index 23c01e16..5b77e033 100644 --- a/include/helper_audit_dockerfile +++ b/include/helper_audit_dockerfile @@ -111,6 +111,31 @@ InsertSection "Basics" MAINTAINER=$(echo ${FIND}) Display --indent 2 --text "Maintainer" --result "${MAINTAINER}" fi + + FIND=$(grep "^ENTRYPOINT" ${AUDIT_FILE} | cut -d' ' -f2 ) + if [ "${FIND}" = "" ]; then + ReportWarning "dockerfile" "No ENTRYPOINT defined in Dockerfile." + else + ENTRYPOINT=$(echo ${FIND}) + Display --indent 2 --text "ENTRYPOINT" --result "${ENTRYPOINT}" + fi + + FIND=$(grep "^CMD" ${AUDIT_FILE} | cut -d' ' -f2 ) + if [ "${FIND}" = "" ]; then + ReportWarning "dockerfile" "No CMD defines in Dockerfile." + else + CMD=$(echo ${FIND}) + Display --indent 2 --text "CMD" --result "${CMD}" + fi + + FIND=$(grep "^USER" ${AUDIT_FILE} | cut -d' ' -f2 ) + if [ "${FIND}" = "" ]; then + ReportWarning "dockerfile" "No user declared in Dockerlfile. Container will execute command as root" + else + USER=$(echo ${FIND}) + Display --indent 2 --text "User" --result "${USER}" + fi + # ################################################################################################## -- cgit v1.2.3