Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuperpoussin22 <vincent.nadal@orange.fr>2018-08-15 14:54:56 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2018-08-15 14:54:56 +0300
commit6ba7bad34eb3fb10dab6bee9d51d54940798a86a (patch)
tree72f5bd0fc8aef70b6592359affb19532d16c2371 /include/helper_audit_dockerfile
parent6567b167305024481e9b2b125c667caa17664057 (diff)
add a few basic test (#572)
Diffstat (limited to 'include/helper_audit_dockerfile')
-rw-r--r--include/helper_audit_dockerfile25
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
+
#
##################################################################################################