diff options
author | superpoussin22 <vincent.nadal@orange.fr> | 2018-08-15 14:54:56 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2018-08-15 14:54:56 +0300 |
commit | 6ba7bad34eb3fb10dab6bee9d51d54940798a86a (patch) | |
tree | 72f5bd0fc8aef70b6592359affb19532d16c2371 /include | |
parent | 6567b167305024481e9b2b125c667caa17664057 (diff) |
add a few basic test (#572)
Diffstat (limited to 'include')
-rw-r--r-- | include/helper_audit_dockerfile | 25 |
1 files changed, 25 insertions, 0 deletions
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 + # ################################################################################################## |