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-28 09:45:04 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2018-08-28 09:45:04 +0300
commit9fe6dcde7612be127280da8136fd22a38812b446 (patch)
treee6312543fa07d8de707dd08ebc83e0becc1cbf37 /include/helper_audit_dockerfile
parent52e71b7e9349bed94385fef8e6c38b6477a76202 (diff)
detect if latest TAG is used (#575)
that's always better to specify the version, latest desn't mean latest version it can be a suggestion if you prefer
Diffstat (limited to 'include/helper_audit_dockerfile')
-rw-r--r--include/helper_audit_dockerfile6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/helper_audit_dockerfile b/include/helper_audit_dockerfile
index 05c9ad6f..1185fb2e 100644
--- a/include/helper_audit_dockerfile
+++ b/include/helper_audit_dockerfile
@@ -61,17 +61,23 @@ fi
FIND=$(grep "^FROM" ${AUDIT_FILE} | sed 's/ /:space:/g')
for I in ${FIND}; do
IMAGE=$(echo ${I} | sed 's/:space:/ /g' | awk '{ if ($1=="FROM") { print $2 }}')
+ TAG=$(echo ${IMAGE} | cut -d':' -f2)
Display --indent 2 --text "Found image:" --result "${IMAGE}"
IS_DEBIAN=$(echo ${IMAGE} | grep -i debian)
IS_FEDORA=$(echo ${IMAGE} | grep -i fedora)
IS_UBUNTU=$(echo ${IMAGE} | grep -i ubuntu)
IS_ALPINE=$(echo ${IMAGE} | grep -i alpine)
+ IS_LATEST=$(echo ${TAG} | grep -i latest)
if [ ! "${IS_DEBIAN}" = "" ]; then IMAGE="debian"; fi
if [ ! "${IS_FEDORA}" = "" ]; then IMAGE="fedora"; fi
if [ ! "${IS_UBUNTU}" = "" ]; then IMAGE="ubuntu"; fi
if [ ! "${IS_ALPINE}" = "" ]; then IMAGE="alpine"; fi
+
+ if [ ! "${IS_LATEST}" = "" ]; then
+ ReportWarning "dockerfile" "latest TAG used. Specifying the version is better."
+ fi
case ${IMAGE} in
"debian")