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:
authorTopi Miettinen <toiwoton@gmail.com>2020-03-25 10:18:16 +0300
committerTopi Miettinen <toiwoton@gmail.com>2020-03-25 10:18:16 +0300
commit339e0c3207f5c4064bc9efa8172c6606779b6ec9 (patch)
treef8c3929987221b66f89fe18f1f70a03dbdd18ec6 /include/tests_filesystems
parent3c8e3b0adb9bae3c3464d9e5f39bea7af6967ad7 (diff)
[FILE-6374]: Summarize unhardened file system
Report total numbers of unhardened filesystems. Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
Diffstat (limited to 'include/tests_filesystems')
-rw-r--r--include/tests_filesystems7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/tests_filesystems b/include/tests_filesystems
index 70efd2cc..38b4c0d0 100644
--- a/include/tests_filesystems
+++ b/include/tests_filesystems
@@ -628,6 +628,13 @@
fi
done
fi
+ NMOUNTS=$(mount | ${WCBINARY} --lines)
+ NDEVMOUNTS=$(mount | ${AWKBINARY} '{print $6}' | ${GREPBINARY} -v nodev | ${WCBINARY} --lines)
+ NEXECMOUNTS=$(mount | ${AWKBINARY} '{print $6}' | ${GREPBINARY} -v noexec | ${WCBINARY} --lines)
+ NSUIDMOUNTS=$(mount | ${AWKBINARY} '{print $6}' | ${GREPBINARY} -v nosuid | ${WCBINARY} --lines)
+ NWRITEANDEXECMOUNTS=$(mount | ${AWKBINARY} '{print $6}' | ${GREPBINARY} -v noexec | ${EGREPBINARY} -v '^\(ro[,)]' | ${WCBINARY} --lines)
+ LogText "Result: Total without nodev:${NDEVMOUNTS} noexec:${NEXECMOUNTS} nosuid:${NSUIDMOUNTS} ro or noexec (W^X): ${NWRITEANDEXECMOUNTS}, of total ${NMOUNTS}"
+ Display --indent 2 --text "- Total without nodev:${NDEVMOUNTS} noexec:${NEXECMOUNTS} nosuid:${NSUIDMOUNTS} ro or noexec (W^X): ${NWRITEANDEXECMOUNTS} of total ${NMOUNTS}"
fi
#
#################################################################################