From ba1cff941fdc41c06f2cabe494cac3420144e92b Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Fri, 16 Oct 2020 13:02:01 +0200 Subject: [PATCH 1/5] 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 2/5] 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 3/5] 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 760460528b7141fb0f0741c4d76787a2ca406488 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sat, 17 Oct 2020 12:55:20 +0200 Subject: [PATCH 4/5] 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 5/5] 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}" ;;