mirror of https://github.com/CISOfy/lynis.git
Improved core dump checking
This commit is contained in:
parent
017c145357
commit
a29335823f
|
@ -383,12 +383,12 @@
|
|||
if [ -f /etc/security/limits.conf ]; then
|
||||
logtext "Result: file /etc/security/limits.conf exists"
|
||||
logtext "Test: Checking if core dumps are disabled in /etc/security/limits.conf"
|
||||
FIND1=`cat /etc/security/limits.conf | grep -v "^#" | grep -v "^$" | awk '{ if ($1=="*" && $2=="soft" && $3=="core") { print "soft core enabled" } }'`
|
||||
FIND2=`cat /etc/security/limits.conf | grep -v "^#" | grep -v "^$" | awk '{ if ($1=="*" && $2=="hard" && $3=="core") { print "hard core enabled" } }'`
|
||||
FIND1=`cat /etc/security/limits.conf | grep -v "^#" | grep -v "^$" | awk '{ if ($1=="*" && $2=="soft" && $3=="core" && $4=="1") { print "soft core enabled" } }'`
|
||||
FIND2=`cat /etc/security/limits.conf | grep -v "^#" | grep -v "^$" | awk '{ if ($1=="*" && $2=="hard" && $3=="core" && $4=="1") { print "hard core enabled" } }'`
|
||||
if [ "${FIND1}" = "soft core enabled" -o "${FIND2}" = "hard core enabled" ]; then
|
||||
logtext "Result: core dumps (soft or hard) are enabled"
|
||||
Display --indent 2 --text "- Checking core dumps configuration" --result ENABLED --color YELLOW
|
||||
#YYY suggestion
|
||||
AddSuggestion "${TEST_NO}" "Check if core dumps need to be enabled on this system"
|
||||
AddHP 1 2
|
||||
else
|
||||
logtext "Result: core dumps (soft and hard) are both disabled"
|
||||
|
|
Loading…
Reference in New Issue