From 93a71539d58251b47f07783b4a7d97813460bb81 Mon Sep 17 00:00:00 2001 From: Simon Biewald Date: Thu, 27 Aug 2020 21:44:40 +0200 Subject: [PATCH 01/23] Add support for Flatcar Container Linux Fixes cisofy/lynis#1014. Flatcar is a for of CoreOS. Thus the variable LINUX_VERSION_LIKE (introduced with #1004) for Flatcar is CoreOS. --- include/osdetection | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/osdetection b/include/osdetection index c2726d31..d12cab48 100644 --- a/include/osdetection +++ b/include/osdetection @@ -190,6 +190,12 @@ OS_REDHAT_OR_CLONE=1 OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') ;; + "flatcar") + LINUX_VERSION="Flatcar" + LINUX_VERSION_LIKE="CoreOS" + OS_NAME="Flatcar Linux" + OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + ;; "gentoo") LINUX_VERSION="Gentoo" OS_NAME="Gentoo Linux" From a1f794cc75295fc458c0121903cfe82a1353ee78 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Thu, 3 Sep 2020 10:54:21 +0200 Subject: [PATCH 02/23] Don't provide suggestion to install pseudo rng at this moment --- include/tests_crypto | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/include/tests_crypto b/include/tests_crypto index ddf1406a..40828175 100644 --- a/include/tests_crypto +++ b/include/tests_crypto @@ -21,6 +21,10 @@ # Cryptography # ################################################################################# +# + RNG_FOUND=0 +# +################################################################################# # InsertSection "Cryptography" # @@ -181,20 +185,28 @@ if [ ${SKIPTEST} -eq 0 ]; then ENCRYPTED_SWAPS=0 UNENCRYPTED_SWAPS=0 - SWAPS=$(${SWAPONBINARY} --show=NAME --noheadings) - for BLOCK_DEV in ${SWAPS}; do - if ${CRYPTSETUPBINARY} isLuks "${BLOCK_DEV}" 2> /dev/null; then - LogText "Result: Found LUKS encrypted swap device: ${BLOCK_DEV}" - ENCRYPTED_SWAPS=$((ENCRYPTED_SWAPS +1)) - elif ${CRYPTSETUPBINARY} status "${BLOCK_DEV}" 2> /dev/null | ${GREPBINARY} --quiet "cipher:"; then - LogText "Result: Found non-LUKS encrypted swap device: ${BLOCK_DEV}" - ENCRYPTED_SWAPS=$((ENCRYPTED_SWAPS +1)) - else - LogText "Result: Found unencrypted swap device: ${BLOCK_DEV}" - UNENCRYPTED_SWAPS=$((UNENCRYPTED_SWAPS +1)) - fi - done - Display --indent 2 --text "- Found ${ENCRYPTED_SWAPS} encrypted and ${UNENCRYPTED_SWAPS} unencrypted swap devices in use." --result OK --color WHITE + # Redirect errors, as RHEL 5/6 and others don't have the --show option + SWAPS=$(${SWAPONBINARY} --show=NAME --noheadings 2> /dev/null) + if [ $? -eq 0 ]; then + for BLOCK_DEV in ${SWAPS}; do + if ${CRYPTSETUPBINARY} isLuks "${BLOCK_DEV}" 2> /dev/null; then + LogText "Result: Found LUKS encrypted swap device: ${BLOCK_DEV}" + ENCRYPTED_SWAPS=$((ENCRYPTED_SWAPS + 1)) + Report "encrypted_swap[]=${BLOCK_DEV},LUKS" + elif ${CRYPTSETUPBINARY} status "${BLOCK_DEV}" 2> /dev/null | ${GREPBINARY} --quiet "cipher:"; then + LogText "Result: Found non-LUKS encrypted swap device: ${BLOCK_DEV}" + ENCRYPTED_SWAPS=$((ENCRYPTED_SWAPS + 1)) + Report "encrypted_swap[]=${BLOCK_DEV},other" + else + LogText "Result: Found unencrypted swap device: ${BLOCK_DEV}" + UNENCRYPTED_SWAPS=$((UNENCRYPTED_SWAPS +1)) + Report "non_encrypted_swap[]=${BLOCK_DEV}" + fi + done + Display --indent 2 --text "- Found ${ENCRYPTED_SWAPS} encrypted and ${UNENCRYPTED_SWAPS} unencrypted swap devices in use." --result OK --color WHITE + else + LogText "Result: skipping testing as swapon returned an error." + fi fi # ################################################################################# @@ -232,6 +244,7 @@ if IsRunning "rngd"; then Display --indent 2 --text "- HW RNG & rngd" --result "${STATUS_YES}" --color GREEN LogText "Result: rngd is running" + RNG_FOUND=1 else Display --indent 2 --text "- HW RNG & rngd" --result "${STATUS_NO}" --color YELLOW # TODO - enable suggestion when website has listing for this control @@ -263,8 +276,9 @@ done if [ -z "${FOUND}" ]; then Display --indent 2 --text "- SW prng" --result "${STATUS_NO}" --color YELLOW - ReportSuggestion "${TEST_NO}" "Utilize software pseudo random number generators" + # ReportSuggestion "${TEST_NO}" "Utilize software pseudo random number generators" else + RNG_FOUND=1 Display --indent 2 --text "- SW prng" --result "${STATUS_YES}" --color GREEN LogText "Result: found ${FOUND} running" fi From 768d8a62e8de6f63d5ace28b92dffed17a0a6061 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Fri, 2 Oct 2020 10:55:36 +0200 Subject: [PATCH 03/23] Updated log --- CHANGELOG.md | 3 ++- include/tests_crypto | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4935044..3181544b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,8 @@ ### Changed - AUTH-9229 - Added option for LOCKED accounts and bugfix for older bash versions - BOOT-5122 - Presence check for grub.d added -- CRYP-7931 - Redirect errors (e.g. when swap is not encrypted) +- CRYP-7931 - Redirect errors +- CRYP-7931 - Added data to report - FILE-6430 - Don't grep nonexistant modprobe.d files - FIRE-4535 - Set initial firewall state - INSE-8312 - Corrected text on screen diff --git a/include/tests_crypto b/include/tests_crypto index 40828175..976ba7b1 100644 --- a/include/tests_crypto +++ b/include/tests_crypto @@ -285,6 +285,10 @@ fi # ################################################################################# +# + Report "rng_found=${RNG_FOUND}" +# +################################################################################# # WaitForKeyPress From 5e0a4e685d84cf736c1c4795cd1b95bb24005eff Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Fri, 2 Oct 2020 10:57:58 +0200 Subject: [PATCH 04/23] Added CloudLinux --- include/osdetection | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/osdetection b/include/osdetection index c2726d31..9910b307 100644 --- a/include/osdetection +++ b/include/osdetection @@ -173,6 +173,12 @@ OS_REDHAT_OR_CLONE=1 OS_VERSION="Rolling release" ;; + "cloudlinux") + LINUX_VERSION="CloudLinux" + OS_NAME="CloudLinux" + OS_REDHAT_OR_CLONE=1 + OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + ;; "coreos") LINUX_VERSION="CoreOS" OS_NAME="CoreOS Linux" From 11be8b03ae5c2e79625e6c6af1ca3c773f478132 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Fri, 2 Oct 2020 10:58:06 +0200 Subject: [PATCH 05/23] Updated log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3181544b..5a28590a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Lynis 3.0.1 (not released yet) ### Added +- Detection of CloudLinux - Detection of Kali Linux - Detection of Linux Mint - Detection of macOS Big Sur (11.0) From 21b5493a1cb679d68e3da15ffdfc4f0a46a76776 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Mon, 5 Oct 2020 13:22:39 +0200 Subject: [PATCH 06/23] Release 3.0.1 --- CHANGELOG.md | 2 +- lynis | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57a314b6..0728f8c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Lynis Changelog -## Lynis 3.0.1 (not released yet) +## Lynis 3.0.1 (2020-10-05) ### Added - Detection of Alpine Linux diff --git a/lynis b/lynis index 09f6f727..4d5306ff 100755 --- a/lynis +++ b/lynis @@ -43,9 +43,9 @@ PROGRAM_WEBSITE="https://cisofy.com/lynis/" # Version details - PROGRAM_RELEASE_DATE="2020-06-26" - PROGRAM_RELEASE_TIMESTAMP=1593159916 - PROGRAM_RELEASE_TYPE="pre-release" # pre-release or release + PROGRAM_RELEASE_DATE="2020-10-05" + PROGRAM_RELEASE_TIMESTAMP=1601896929 + PROGRAM_RELEASE_TYPE="release" # pre-release or release PROGRAM_VERSION="3.0.1" # Source, documentation and license From 85d36db113fc3584df9ef70b7ec8bb3abf835c45 Mon Sep 17 00:00:00 2001 From: Sergey Zhemoitel Date: Thu, 8 Oct 2020 23:06:35 +0300 Subject: [PATCH 07/23] Add ROSA Linux detection --- include/osdetection | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/osdetection b/include/osdetection index 9910b307..66592a8f 100644 --- a/include/osdetection +++ b/include/osdetection @@ -273,6 +273,12 @@ OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_NAME="Ubuntu" ;; + "rosa") + LINUX_VERSION="ROSA Linux" + OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + OS_NAME="ROSA Desktop Fresh R11.1" + ;; *) ReportException "OS Detection" "Unknown OS found in /etc/os-release - Please create issue on GitHub project page: ${PROGRAM_SOURCE}" ;; From ba1cff941fdc41c06f2cabe494cac3420144e92b Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Fri, 16 Oct 2020 13:02:01 +0200 Subject: [PATCH 08/23] Improved detection of kernel by ignoring known incorrect values --- include/tests_kernel | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/tests_kernel b/include/tests_kernel index 011d02c6..7bd11e59 100644 --- a/include/tests_kernel +++ b/include/tests_kernel @@ -680,8 +680,19 @@ elif [ -f "${FOUND_VMLINUZ}" ]; then VERSION_ON_DISK=$(echo ${FOUND_VMLINUZ} | ${SEDBINARY} 's#^/boot/##' | ${SEDBINARY} 's/^vmlinuz-//') LogText "Result: version derived from file name is '${VERSION_ON_DISK}'" + fi + # Data check: perform reset if we found a version but looks incomplete + # Example: Arch Linux will return only 'linux' as its version after it discovered /boot/vmlinuz-linux + case ${VERSION_ON_DISK} in + "linux" | "linux-lts") + LogText "Result: reset of version (${VERSION_ON_DISK}) as it looks incomplete" + VERSION_ON_DISK="" + ;; + esac + + # If we did not find the version yet, see if we can extract it from the magic data that 'file' returns if [ -z "${VERSION_ON_DISK}" ]; then LogText "Test: checking kernel version on disk" NEXTLINE=0 @@ -697,6 +708,7 @@ done fi + # Last check if we finally got a version or not if [ -z "${VERSION_ON_DISK}" ]; then LogText "Result: could not find the version on disk" ReportException "${TEST_NO}:4" "Could not find the kernel version" From 1c0c9d78583b82ce2fe43aad6fc98634478c0bde Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Fri, 16 Oct 2020 13:02:35 +0200 Subject: [PATCH 09/23] Move to pre-release --- lynis | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lynis b/lynis index 4d5306ff..17cd9e91 100755 --- a/lynis +++ b/lynis @@ -45,8 +45,8 @@ # Version details PROGRAM_RELEASE_DATE="2020-10-05" PROGRAM_RELEASE_TIMESTAMP=1601896929 - PROGRAM_RELEASE_TYPE="release" # pre-release or release - PROGRAM_VERSION="3.0.1" + PROGRAM_RELEASE_TYPE="pre-release" # pre-release or release + PROGRAM_VERSION="3.0.2" # Source, documentation and license PROGRAM_SOURCE="https://github.com/CISOfy/lynis" From 5d9c85a35cb26b04459f38e62fb5d805e2c193ea Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Fri, 16 Oct 2020 13:02:57 +0200 Subject: [PATCH 10/23] Preparations for 3.0.2 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0728f8c9..5c85a577 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Lynis Changelog +## Lynis 3.0.2 (not released yet) + +### Changed +- KRNL-5830 - Improved reboot test by ignoring known bad values + +--------------------------------------------------------------------------------- + ## Lynis 3.0.1 (2020-10-05) ### Added From eaca6127eca8176d48479d8044847e942465c3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Sat, 17 Oct 2020 00:04:09 +0200 Subject: [PATCH 11/23] Improvements and addition of strings --- db/languages/fr | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/db/languages/fr b/db/languages/fr index 51b4da41..848dd94e 100644 --- a/db/languages/fr +++ b/db/languages/fr @@ -1,38 +1,45 @@ +ERROR_NO_LICENSE="Pas de clé de licence configurée" +ERROR_NO_UPLOAD_SERVER="Pas de serveur de transfert configuré" GEN_CHECKING="Vérification" GEN_CURRENT_VERSION="Version actuelle" GEN_DEBUG_MODE="mode debug" GEN_INITIALIZE_PROGRAM="Initialisation" +GEN_LATEST_VERSION="Dernière version" GEN_PHASE="phase" GEN_PLUGINS_ENABLED="Plugins activés" -GEN_VERBOSE_MODE="mode verbeux" GEN_UPDATE_AVAILABLE="mise à jour disponible" +GEN_VERBOSE_MODE="mode verbeux" GEN_WHAT_TO_DO="Que faire" NOTE_EXCEPTIONS_FOUND="Exceptions trouvées" NOTE_EXCEPTIONS_FOUND_DETAILED="Des événements ou informations exceptionnels ont été trouvés" -NOTE_PLUGINS_TAKE_TIME="Note: les plugins ont des tests plus poussés et peuvent prendre plusieurs minutes" +NOTE_PLUGINS_TAKE_TIME="Note : Les plugins ont des tests plus poussés et peuvent prendre plusieurs minutes" NOTE_SKIPPED_TESTS_NON_PRIVILEGED="Tests ignorés faute de privilèges" -SECTION_CUSTOM_TESTS="Tests Personnalisés" +SECTION_CUSTOM_TESTS="Tests personnalisés" +SECTION_DATA_UPLOAD="Téléchargement de données" +SECTION_INITIALIZING_PROGRAM="Initialisation du programme" SECTION_MALWARE="Malware" -SECTION_MEMORY_AND_PROCESSES="Mémoire et Processus" +SECTION_MEMORY_AND_PROCESSES="Mémoire et processus" +SECTION_SYSTEM_TOOLS="Outils système" +STATUS_DISABLED="DÉSACTIVÉ" STATUS_DONE="FAIT" +STATUS_ENABLED="ACTIVÉ" +STATUS_ERROR="ERREUR" +STATUS_FAILED="ÉCHOUÉ" STATUS_FOUND="TROUVÉ" -STATUS_YES="OUI" -STATUS_NO="NON" STATUS_OFF="OFF" STATUS_OK="OK" STATUS_ON="ON" +STATUS_NO="NON" STATUS_NONE="AUCUN" +STATUS_NOT_CONFIGURED="NON CONFIGURÉ" STATUS_NOT_FOUND="NON TROUVÉ" STATUS_NOT_RUNNING="NON LANCÉ" -STATUS_RUNNING="EN COURS": +STATUS_RUNNING="EN COURS" STATUS_SKIPPED="IGNORÉ" STATUS_SUGGESTION="SUGGESTION" STATUS_UNKNOWN="INCONNU" STATUS_WARNING="ATTENTION" +STATUS_WEAK="FAIBLE" +STATUS_YES="OUI" TEXT_YOU_CAN_HELP_LOGFILE="Vous pouvez aider en envoyant votre fichier journal" TEXT_UPDATE_AVAILABLE="Mise à jour disponible" -STATUS_DISABLED="DÉSACTIVÉ" -STATUS_ENABLED="ACTIVÉ" -STATUS_ERROR="ERREUR" -ERROR_NO_LICENSE="Pas de clé de licence configurée" -ERROR_NO_UPLOAD_SERVER="Pas de serveur de transfert configuré" From 760460528b7141fb0f0741c4d76787a2ca406488 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sat, 17 Oct 2020 12:55:20 +0200 Subject: [PATCH 12/23] Added variable --- include/consts | 1 + 1 file changed, 1 insertion(+) diff --git a/include/consts b/include/consts index 053147a4..2224057b 100644 --- a/include/consts +++ b/include/consts @@ -58,6 +58,7 @@ ETC_PATHS="/etc /usr/local/etc" APPLICATION_FIREWALL_ACTIVE=0 BINARY_SCAN_FINISHED=0 BLKIDBINARY="" + BOOTCTLBINARY="" CAT_BINARY="" CFAGENTBINARY="" CHECK=0 From 791800f95d1e1090efc0ba29d958fa1a6d80ab7d Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sat, 17 Oct 2020 13:15:06 +0200 Subject: [PATCH 13/23] Added Zorin OS detection --- CHANGELOG.md | 3 +++ include/osdetection | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c85a577..17562153 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Lynis 3.0.2 (not released yet) +### Added +- Detection of Zorin OS + ### Changed - KRNL-5830 - Improved reboot test by ignoring known bad values diff --git a/include/osdetection b/include/osdetection index 9910b307..843a932b 100644 --- a/include/osdetection +++ b/include/osdetection @@ -273,6 +273,13 @@ OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_NAME="Ubuntu" ;; + "zorin") + LINUX_VERSION="Zorin OS" + OS_NAME="Zorin OS" + OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + ;; + *) ReportException "OS Detection" "Unknown OS found in /etc/os-release - Please create issue on GitHub project page: ${PROGRAM_SOURCE}" ;; From 6238f5bc8f821ddc8aab371d9bb36e025c281c07 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sat, 17 Oct 2020 13:26:11 +0200 Subject: [PATCH 14/23] Define RHEL as 'RHEL' --- include/osdetection | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/osdetection b/include/osdetection index 107ee28f..5aa5878b 100644 --- a/include/osdetection +++ b/include/osdetection @@ -255,7 +255,7 @@ ;; "rhel") LINUX_VERSION="RHEL" - OS_NAME=$(grep "^PRETTY_NAME=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + OS_NAME="RHEL" OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_FULLNAME="${OS_NAME} ${OS_VERSION_FULL}" From 577a8b201fbe03f19e6d04a2c5e2538f624eefc8 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sat, 17 Oct 2020 13:26:39 +0200 Subject: [PATCH 15/23] Updated log --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17562153..ee64679c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,12 @@ ## Lynis 3.0.2 (not released yet) ### Added +- Detection of ROSA Linux - Detection of Zorin OS ### Changed - KRNL-5830 - Improved reboot test by ignoring known bad values +- Set 'RHEL' as OS_NAME for Red Hat Enterprise Linux --------------------------------------------------------------------------------- From 61c6d5df8d156cdbfc670c3f641db06aa1b761db Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sat, 17 Oct 2020 13:40:09 +0200 Subject: [PATCH 16/23] [PKGS-7410] Don't show exception if no kernels were found on the disk --- include/tests_ports_packages | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/tests_ports_packages b/include/tests_ports_packages index 286da608..e1071474 100644 --- a/include/tests_ports_packages +++ b/include/tests_ports_packages @@ -1289,7 +1289,7 @@ KERNELS=$(${ZYPPERBINARY} --non-interactive -n se --type package --match-exact --installed-only "kernel-default" 2> /dev/null | ${GREPBINARY} "kernel-default" | ${WCBINARY} -l) if [ ${KERNELS} -eq 0 ]; then LogText "Result: found no kernels from zypper output, which is unexpected." - ReportException "KRNL-5840:3" "Could not find any kernel packages via package manager. Maybe using a different kernel package?" + ReportException "${TEST_NO}" "Could not find any kernel packages via package manager. Maybe using a different kernel package?" elif [ ${KERNELS} -gt 3 ]; then LogText "Result: found more than 5 kernel packages on the system, which might indicate lack of regular cleanups" ReportSuggestion "${TEST_NO}" "Remove any unneeded kernel packages" @@ -1299,7 +1299,19 @@ fi if [ ${KERNELS} -eq 0 -a ${TESTED} -eq 1 ]; then - ReportException "KRNL-5840:1" "Could not find any kernel packages via package manager" + # Only report exception if there are kernels actually there. For example, LXC use the kernel of host system + case "${OS}" in + "Linux") + if [ -d "${ROOTDIR}boot" ]; then + if [ -z "$(${FINDBINARY} /boot -maxdepth 1 -type f -name 'vmlinuz*' -print -quit)" ]; then + ReportException "${TEST_NO}" "Could not find any kernel packages via package manager" + fi + fi + ;; + *) + ReportException "${TEST_NO}" "Could not find any kernel packages via package manager" + ;; + esac fi Report "installed_kernel_packages=${KERNELS}" From 3b240d250d8762891aaa2265e77fd78d6f60fca4 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sat, 17 Oct 2020 13:40:17 +0200 Subject: [PATCH 17/23] Updated log --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee64679c..0b486c6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,9 @@ ### Changed - KRNL-5830 - Improved reboot test by ignoring known bad values +- PKGS-7410 - Don't show exception if no kernels were found on the disk - Set 'RHEL' as OS_NAME for Red Hat Enterprise Linux +- Small code enhancements --------------------------------------------------------------------------------- From 644683a0e4efabef007a3f3e6fe36d9eb2e7d3c3 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sat, 17 Oct 2020 14:11:45 +0200 Subject: [PATCH 18/23] Updated log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b486c6e..86974a3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - KRNL-5830 - Improved reboot test by ignoring known bad values - PKGS-7410 - Don't show exception if no kernels were found on the disk - Set 'RHEL' as OS_NAME for Red Hat Enterprise Linux +- French translation improved - Small code enhancements --------------------------------------------------------------------------------- From af57959d6a63fdbc501c3dc2dd475f1618d25759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Mon, 19 Oct 2020 00:41:11 +0200 Subject: [PATCH 19/23] Add missing constants From #1035 issue --- include/consts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/consts b/include/consts index 2224057b..bb1d63ff 100644 --- a/include/consts +++ b/include/consts @@ -82,6 +82,7 @@ ETC_PATHS="/etc /usr/local/etc" CONTROL_URL_PROTOCOL="" CONTAINER_TYPE="" CREATE_REPORT_FILE=1 + CRYPTSETUPBINARY="" CSUMBINARY="" CURRENT_TS=0 CUSTOM_URL_APPEND="" @@ -100,12 +101,14 @@ ETC_PATHS="/etc /usr/local/etc" DISCOVERED_BINARIES="" DMIDECODEBINARY="" DNFBINARY="" + DNSDOMAINNAMEBINARY="" DOCKERBINARY="" DOCKER_DAEMON_RUNNING=0 DPKGBINARY="" ECHOCMD="" ERROR_ON_WARNINGS=0 EQUERYBINARY="" + EVMCTLBINARY="" EXIMBINARY="" FAIL2BANBINARY="" FILEBINARY="" @@ -131,6 +134,7 @@ ETC_PATHS="/etc /usr/local/etc" HTTPDBINARY="" IDS_IPS_TOOL_FOUND=0 IFCONFIGBINARY="" + INTEGRITYSETUPBINARY="" IPBINARY="" IPFBINARY="" IPTABLESBINARY="" @@ -149,6 +153,7 @@ ETC_PATHS="/etc /usr/local/etc" LOGDIR="" LOGROTATEBINARY="" LOGTEXT=1 + LSBLKBINARY="" LSMODBINARY="" LSOFBINARY="" LSOF_EXTRA_OPTIONS="" @@ -192,6 +197,7 @@ ETC_PATHS="/etc /usr/local/etc" NGINX_RETURN_FOUND=0 NGINX_ROOT_FOUND=0 NGINX_WEAK_SSL_PROTOCOL_FOUND=0 + NTPCTLBINARY="" NTPD_ROLE="" NTPQBINARY="" OPENSSLBINARY="" @@ -205,6 +211,7 @@ ETC_PATHS="/etc /usr/local/etc" OS_REDHAT_OR_CLONE=0 OSIRISBINARY="" PACMANBINARY="" + PAM_PASSWORD_PWHISTORY_AMOUNT="" PASSWORD_MAXIMUM_DAYS=-1 PASSWORD_MINIMUM_DAYS=-1 PAM_2F_AUTH_ENABLED=0 @@ -239,6 +246,7 @@ ETC_PATHS="/etc /usr/local/etc" REFRESH_REPOSITORIES=1 REMOTE_LOGGING_ENABLED=0 RESOLV_DOMAINNAME="" + RESOLVECTLBINARY="" RKHUNTERBINARY="" ROOTDIR="/" ROOTSHBINARY="" @@ -277,6 +285,7 @@ ETC_PATHS="/etc /usr/local/etc" SLOW_TEST_THRESHOLD=10 SMTPCTLBINARY="" SNORTBINARY="" + SSBINARY="" SSHKEYSCANBINARY="" SSHKEYSCANFOUND=0 SSL_CERTIFICATE_INCLUDE_PACKAGES=0 @@ -286,6 +295,7 @@ ETC_PATHS="/etc /usr/local/etc" SWUPDBINARY="" SYSLOGNGBINARY="" SYSTEMCTLBINARY="" + SYSTEMDANALYZEBINARY="" SYSTEM_IS_NOTEBOOK=255 TEMP_FILE="" TEMP_FILES="" @@ -295,6 +305,7 @@ ETC_PATHS="/etc /usr/local/etc" TEST_GROUP_TO_CHECK="all" TESTS_EXECUTED="" TESTS_SKIPPED="" + TIMEDATECTL="" TMPFILE="" TOMOYOINITBINARY="" TOOLTIP_SHOWED=0 @@ -320,6 +331,7 @@ ETC_PATHS="/etc /usr/local/etc" USBGUARD_ROOT="" VALUE="" VERBOSE=0 + VERITYSETUPBINARY="" VGDISPLAYBINARY="" VMTYPE="" VULNERABLE_PACKAGES_FOUND=0 From f0ded6c2a3408d361145952234bfcd306eae0d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Mon, 19 Oct 2020 12:07:16 +0200 Subject: [PATCH 20/23] add Mageia EOL dates and grep /etc/mageia-release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- db/software-eol.db | 10 ++++++++++ include/osdetection | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/db/software-eol.db b/db/software-eol.db index 2412a203..ea7d5888 100644 --- a/db/software-eol.db +++ b/db/software-eol.db @@ -68,6 +68,16 @@ os:Linux Mint 18:2021-04-01:1617228000: os:Linux Mint 19:2023-04-01:1680300000: os:Linux Mint 20:2025-04-01:1743458400: # +# Mageia - https://www.mageia.org/en/support/ +# +os:Mageia 1:2012-12-01:1354316400 +os:Mageia 2:2013-11-22:1385074800 +os:Mageia 3:2014-11-26:1416956400 +os:Mageia 4:2015-09-19:1442613600 +os:Mageia 5:2017-12-31:1514674800 +os:Mageia 6:2019-09-30:1569794400 +os:Mageia 7:2020-12-30:1609282800 +# # NetBSD - https://www.netbsd.org/support/security/release.html and # https://www.netbsd.org/releases/formal.html # diff --git a/include/osdetection b/include/osdetection index 5aa5878b..441ef6bd 100644 --- a/include/osdetection +++ b/include/osdetection @@ -396,11 +396,11 @@ LINUX_VERSION="Fedora" fi - # Mageia (has also /etc/megaia-release) - FIND=$(grep "Mageia" /etc/redhat-release) + # Mageia (/etc/redhat-release -> /etc/mageia-release link) + FIND=$(grep "Mageia" /etc/mageia-release) if [ ! "${FIND}" = "" ]; then - OS_FULLNAME=$(grep "^Mageia" /etc/redhat-release) - OS_VERSION=$(grep "^Mageia" /etc/redhat-release | awk '{ if ($2=="release") { print $3 } }') + OS_FULLNAME=$(grep "^Mageia" /etc/mageia-release) + OS_VERSION=$(grep "^Mageia" /etc/mageia-release | awk '{ if ($2=="release") { print $3 } }') LINUX_VERSION="Mageia" fi From 68e8ef862e4da525efc1b157e74e8789a50b32e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Mon, 19 Oct 2020 12:38:59 +0200 Subject: [PATCH 21/23] mageia got /etc/os-release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- include/osdetection | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/include/osdetection b/include/osdetection index 441ef6bd..34667ca8 100644 --- a/include/osdetection +++ b/include/osdetection @@ -212,6 +212,12 @@ OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') ;; + "mageia") + LINUX_VERSION="Mageia" + OS_NAME="Mageia" + OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + ;; "manjaro") LINUX_VERSION="Manjaro" OS_FULLNAME="Manjaro Linux" @@ -396,13 +402,6 @@ LINUX_VERSION="Fedora" fi - # Mageia (/etc/redhat-release -> /etc/mageia-release link) - FIND=$(grep "Mageia" /etc/mageia-release) - if [ ! "${FIND}" = "" ]; then - OS_FULLNAME=$(grep "^Mageia" /etc/mageia-release) - OS_VERSION=$(grep "^Mageia" /etc/mageia-release | awk '{ if ($2=="release") { print $3 } }') - LINUX_VERSION="Mageia" - fi # Oracle Enterprise Linux FIND=$(grep "Enterprise Linux Enterprise Linux Server" /etc/redhat-release) From bc85cbb0ba2a200509c0cc4fc56cdc1d27efc50b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Tue, 20 Oct 2020 11:49:05 +0200 Subject: [PATCH 22/23] add Void Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- include/osdetection | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/osdetection b/include/osdetection index 5aa5878b..49dba032 100644 --- a/include/osdetection +++ b/include/osdetection @@ -279,6 +279,11 @@ OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_NAME="Ubuntu" ;; + "void") + LINUX_VERSION="Void Linux" + OS_VERSION="Rolling release" + OS_NAME="Void Linux" + ;; "zorin") LINUX_VERSION="Zorin OS" OS_NAME="Zorin OS" From 77b93ae73df0de716f7dd56f85a8c51406607a54 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Tue, 20 Oct 2020 13:06:40 +0200 Subject: [PATCH 23/23] Added SLES detection via /etc/os-release --- include/osdetection | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/osdetection b/include/osdetection index 49dba032..eac5eadf 100644 --- a/include/osdetection +++ b/include/osdetection @@ -273,6 +273,12 @@ OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') ;; + "sles") + LINUX_VERSION="SLES" + OS_NAME="openSUSE" + OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + OS_VERSION_FULL=$(grep "^PRETTY_NAME=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + ;; "ubuntu") LINUX_VERSION="Ubuntu" OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"')