2014-08-26 17:33:55 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#################################################################################
|
|
|
|
#
|
|
|
|
# Lynis
|
|
|
|
# ------------------
|
|
|
|
#
|
2016-03-13 16:00:39 +01:00
|
|
|
# Copyright 2007-2013, Michael Boelen
|
2021-01-07 15:22:19 +01:00
|
|
|
# Copyright 2007-2021, CISOfy
|
2016-03-13 16:00:39 +01:00
|
|
|
#
|
|
|
|
# Website : https://cisofy.com
|
|
|
|
# Blog : http://linux-audit.com
|
|
|
|
# GitHub : https://github.com/CISOfy/lynis
|
2014-08-26 17:33:55 +02:00
|
|
|
#
|
|
|
|
# Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
|
|
|
|
# welcome to redistribute it under the terms of the GNU General Public License.
|
|
|
|
# See LICENSE file for usage of this software.
|
|
|
|
#
|
|
|
|
#################################################################################
|
|
|
|
#
|
2020-10-22 00:13:42 +02:00
|
|
|
InsertSection "${SECTION_STORAGE}"
|
2014-08-26 17:33:55 +02:00
|
|
|
#
|
|
|
|
#################################################################################
|
|
|
|
#
|
|
|
|
AUTOMOUNTER_DAEMON_RUNNING=0
|
|
|
|
NFS_DAEMON_RUNNING=0
|
|
|
|
AUTOMOUNTER_DAEMON_TOOL=""
|
|
|
|
#
|
|
|
|
#################################################################################
|
|
|
|
#
|
|
|
|
# Test : STRG-1846
|
|
|
|
# Description : Check for disabled firewire storage
|
2019-09-29 21:13:47 +02:00
|
|
|
# Explanation : Best option is to use the install function, otherwise drivers can still be loaded manually
|
2016-07-24 17:22:00 +02:00
|
|
|
Register --test-no STRG-1846 --os Linux --weight L --network NO --category security --description "Check if firewire storage is disabled"
|
2019-09-29 21:15:29 +02:00
|
|
|
if [ "${SKIPTEST}" -eq 0 ]; then
|
2014-08-26 17:33:55 +02:00
|
|
|
FOUND=0
|
2015-12-21 21:17:15 +01:00
|
|
|
LogText "Test: Checking firewire storage driver in directory /etc/modprobe.d and configuration file /etc/modprobe.conf"
|
2019-09-29 21:15:29 +02:00
|
|
|
if [ -d "${ROOTDIR}etc/modprobe.d" ]; then
|
2017-04-23 20:06:54 +02:00
|
|
|
FIND=$(${LSBINARY} ${ROOTDIR}etc/modprobe.d/* 2> /dev/null)
|
2019-07-16 13:20:30 +02:00
|
|
|
if [ -n "${FIND}" ]; then
|
2023-04-23 23:38:21 +02:00
|
|
|
FIND1=$(${GREPBINARY} -E "blacklist (ohci1394|firewire[-_]ohci|firewire-core)" ${ROOTDIR}etc/modprobe.d/* | ${GREPBINARY} -v "#")
|
|
|
|
FIND2=$(${GREPBINARY} -E "install (ohci1394|firewire[-_]ohci|firewire-core) /bin/(false|true)" ${ROOTDIR}etc/modprobe.d/* | ${GREPBINARY} -v "#")
|
2019-09-29 21:17:52 +02:00
|
|
|
if [ -n "${FIND1}" ] || [ -n "${FIND2}" ]; then
|
2014-08-28 13:58:41 +02:00
|
|
|
FOUND=1
|
2015-12-21 21:17:15 +01:00
|
|
|
LogText "Result: found firewire ohci driver in disabled state"
|
2014-08-28 13:58:41 +02:00
|
|
|
fi
|
2017-04-23 20:06:54 +02:00
|
|
|
else
|
|
|
|
LogText "Result: skipping ${ROOTDIR}etc/modprobe.d, directory found but no files in it"
|
2014-08-26 17:33:55 +02:00
|
|
|
fi
|
|
|
|
fi
|
2019-09-29 21:15:29 +02:00
|
|
|
if [ -f "${ROOTDIR}etc/modprobe.conf" ]; then
|
2023-04-23 23:38:21 +02:00
|
|
|
FIND1=$(${GREPBINARY} -E -r "blacklist (ohci1394|firewire[-_]ohci|firewire-core)" "${ROOTDIR}etc/modprobe.conf" | ${GREPBINARY} -v "#")
|
|
|
|
FIND2=$(${GREPBINARY} -E -r "install (ohci1394|firewire[-_]ohci|firewire-core) /bin/(false|true)" "${ROOTDIR}etc/modprobe.conf" | ${GREPBINARY} -v "#")
|
2019-09-29 21:17:52 +02:00
|
|
|
if [ -n "${FIND1}" ] || [ -n "${FIND2}" ]; then
|
2014-08-26 17:33:55 +02:00
|
|
|
FOUND=1
|
2015-12-21 21:17:15 +01:00
|
|
|
LogText "Result: found firewire ohci driver in disabled state"
|
2014-08-26 17:33:55 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ${FOUND} -eq 0 ]; then
|
2015-12-21 21:17:15 +01:00
|
|
|
LogText "Result: firewire ohci driver is not explicitly disabled"
|
2020-12-16 01:07:27 +01:00
|
|
|
Display --indent 2 --text "- Checking firewire ohci driver (modprobe config)" --result "${STATUS_NOT_DISABLED}" --color WHITE
|
2019-09-29 21:15:29 +02:00
|
|
|
ReportSuggestion "${TEST_NO}" "Disable drivers like firewire storage when not used, to prevent unauthorized storage or data theft"
|
2014-08-26 17:33:55 +02:00
|
|
|
# after blacklisting modules, make sure to remove them from the initram filesystem: update-initramfs -u
|
|
|
|
AddHP 2 3
|
2017-04-23 20:06:54 +02:00
|
|
|
else
|
2015-12-21 21:17:15 +01:00
|
|
|
LogText "Result: firewire ohci driver is disabled"
|
2016-06-18 11:14:01 +02:00
|
|
|
Display --indent 2 --text "- Checking firewire ohci driver (modprobe config)" --result "${STATUS_DISABLED}" --color GREEN
|
2014-08-26 17:33:55 +02:00
|
|
|
AddHP 3 3
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
#################################################################################
|
|
|
|
#
|
|
|
|
|
2016-04-28 12:31:57 +02:00
|
|
|
WaitForKeyPress
|
2014-08-26 17:33:55 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
#================================================================================
|
2021-01-07 15:22:19 +01:00
|
|
|
# Lynis - Copyright 2007-2021, CISOfy, Michael Boelen - https://cisofy.com
|