You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sudo lynis --tests-from-group filesystems --verbose --debug|grep hfs
- Module hfs not present in the kernel [ OK ]
[DEBUG] Module hfsplus present in the kernel
- Module hfsplus not loaded (lsmod) [ OK ]
- Module squashfs not present in the kernel [ OK ]
Lynis return that hfs is not present in the kernel, while module is loaded and test get 3 points attributed.
test could be simplified as this:
FIND=$(modprobe -v -n hfs 2>/dev/null | grep -E "/hfs.ko" | tail -1)
if [ -n "${FIND}" ]; then
echo "module loaded";
else
echo "module not loaded";
fi
this return module not loaded, because modprobe return nothing when module is already loaded.
Fact is that test can't differenciates if module exists and is loaded and if module is not supported by kernel.
If testing an unexisting module, we have the same return:
FIND=$(modprobe -v -n hfszzz 2>/dev/null | grep -E "/hfszzz.ko" | tail -1)
if [ -n "${FIND}" ]; then
echo "module loaded";
else
echo "module not loaded";
fi
this return module not loaded too.
I would suggest to rather test something like command value returned:
modprobe -v -n hfs;echo $? return 0 value
modprobe -v -n hfszz;echo $? return 1 value
In this case, code could be modified with something like this:
FIND=$(modprobe -v -n hfsplus 2>/dev/null)
if [ $? -eq 0 ]; then
echo "module loaded";
else
echo "module not loaded";
fi
Then line LogText "Result: found ${FS} support in the kernel (output = ${FIND})" would return (output = ) if module is loaded and if module is not loaded (output = insmod /lib/modules/6.8.0-48-generic/kernel/fs/hfs/hfs.ko)
The text was updated successfully, but these errors were encountered:
Neixen911
pushed a commit
to Neixen911/lynis
that referenced
this issue
Dec 13, 2024
In
lynis/include/tests_filesystems
Line 849 in d76bfdb
Version
Expected behavior
Lynis should not attribute points to loaded modules
Verify test case
load hfs module using
sudo insmod /lib/modules/6.8.0-48-generic/kernel/fs/hfs/hfs.ko
orsudo modprobe hfs
verify hfs module is loaded
run lynis filesystems tests
sudo lynis --tests-from-group filesystems --verbose --debug|grep hfs
Lynis return that hfs is not present in the kernel, while module is loaded and test get 3 points attributed.
test could be simplified as this:
this return
module not loaded
, because modprobe return nothing when module is already loaded.Fact is that test can't differenciates if module exists and is loaded and if module is not supported by kernel.
If testing an unexisting module, we have the same return:
this return
module not loaded
too.I would suggest to rather test something like command value returned:
modprobe -v -n hfs;echo $?
return 0 valuemodprobe -v -n hfszz;echo $?
return 1 valueIn this case, code could be modified with something like this:
Then line
LogText "Result: found ${FS} support in the kernel (output = ${FIND})"
would return (output = ) if module is loaded and if module is not loaded (output = insmod /lib/modules/6.8.0-48-generic/kernel/fs/hfs/hfs.ko)The text was updated successfully, but these errors were encountered: