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:47:17 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2018-08-15 14:47:17 +0300
commit6567b167305024481e9b2b125c667caa17664057 (patch)
tree69fe200f72cd0b02b005c518d4e5a435b5d7db01 /include/helper_audit_dockerfile
parent50374ecd0ec90f298cf44c59877542f61ce09771 (diff)
add alpine support (#569)
also initialize a few variables which wasn't initialyzed
Diffstat (limited to 'include/helper_audit_dockerfile')
-rw-r--r--include/helper_audit_dockerfile18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/helper_audit_dockerfile b/include/helper_audit_dockerfile
index bf55dee9..23c01e16 100644
--- a/include/helper_audit_dockerfile
+++ b/include/helper_audit_dockerfile
@@ -63,17 +63,21 @@ fi
IMAGE=$(echo ${I} | sed 's/:space:/ /g' | awk '{ if ($1=="FROM") { print $2 }}')
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)
+
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
case ${IMAGE} in
"debian")
LogText "Image = Debian based"
PKGMGR="apt"
;;
-
"fedora*")
LogText " Image = Fedora based"
PKGMGR="yum"
@@ -82,6 +86,10 @@ fi
LogText " Image = Ubuntu based"
PKGMGR="apt"
;;
+ "alpine")
+ LogText " Image = Alpine based"
+ PKGMGR="apk"
+ ;;
*)
Display --indent 2 --text "Unknown image" --result "" --color YELLOW
;;
@@ -119,6 +127,14 @@ InsertSection "Basics"
LogText "No installations found via apt-get"
fi
;;
+ "apk")
+ FIND=$(egrep "apk(.*) add" ${AUDIT_FILE})
+ if [ ! "${FIND}" = "" ]; then
+ LogText "Found installation via apk"
+ else
+ LogText "No installations found via apk"
+ fi
+ ;;
*)
LogText "Unknown package manager"
;;