mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-28 00:04:16 +02:00
Don't provide suggestion to install pseudo rng at this moment
This commit is contained in:
parent
343e9bdc1c
commit
a1f794cc75
@ -21,6 +21,10 @@
|
|||||||
# Cryptography
|
# Cryptography
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
#
|
||||||
|
RNG_FOUND=0
|
||||||
|
#
|
||||||
|
#################################################################################
|
||||||
#
|
#
|
||||||
InsertSection "Cryptography"
|
InsertSection "Cryptography"
|
||||||
#
|
#
|
||||||
@ -181,20 +185,28 @@
|
|||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
ENCRYPTED_SWAPS=0
|
ENCRYPTED_SWAPS=0
|
||||||
UNENCRYPTED_SWAPS=0
|
UNENCRYPTED_SWAPS=0
|
||||||
SWAPS=$(${SWAPONBINARY} --show=NAME --noheadings)
|
# Redirect errors, as RHEL 5/6 and others don't have the --show option
|
||||||
for BLOCK_DEV in ${SWAPS}; do
|
SWAPS=$(${SWAPONBINARY} --show=NAME --noheadings 2> /dev/null)
|
||||||
if ${CRYPTSETUPBINARY} isLuks "${BLOCK_DEV}" 2> /dev/null; then
|
if [ $? -eq 0 ]; then
|
||||||
LogText "Result: Found LUKS encrypted swap device: ${BLOCK_DEV}"
|
for BLOCK_DEV in ${SWAPS}; do
|
||||||
ENCRYPTED_SWAPS=$((ENCRYPTED_SWAPS +1))
|
if ${CRYPTSETUPBINARY} isLuks "${BLOCK_DEV}" 2> /dev/null; then
|
||||||
elif ${CRYPTSETUPBINARY} status "${BLOCK_DEV}" 2> /dev/null | ${GREPBINARY} --quiet "cipher:"; then
|
LogText "Result: Found LUKS encrypted swap device: ${BLOCK_DEV}"
|
||||||
LogText "Result: Found non-LUKS encrypted swap device: ${BLOCK_DEV}"
|
ENCRYPTED_SWAPS=$((ENCRYPTED_SWAPS + 1))
|
||||||
ENCRYPTED_SWAPS=$((ENCRYPTED_SWAPS +1))
|
Report "encrypted_swap[]=${BLOCK_DEV},LUKS"
|
||||||
else
|
elif ${CRYPTSETUPBINARY} status "${BLOCK_DEV}" 2> /dev/null | ${GREPBINARY} --quiet "cipher:"; then
|
||||||
LogText "Result: Found unencrypted swap device: ${BLOCK_DEV}"
|
LogText "Result: Found non-LUKS encrypted swap device: ${BLOCK_DEV}"
|
||||||
UNENCRYPTED_SWAPS=$((UNENCRYPTED_SWAPS +1))
|
ENCRYPTED_SWAPS=$((ENCRYPTED_SWAPS + 1))
|
||||||
fi
|
Report "encrypted_swap[]=${BLOCK_DEV},other"
|
||||||
done
|
else
|
||||||
Display --indent 2 --text "- Found ${ENCRYPTED_SWAPS} encrypted and ${UNENCRYPTED_SWAPS} unencrypted swap devices in use." --result OK --color WHITE
|
LogText "Result: Found unencrypted swap device: ${BLOCK_DEV}"
|
||||||
|
UNENCRYPTED_SWAPS=$((UNENCRYPTED_SWAPS +1))
|
||||||
|
Report "non_encrypted_swap[]=${BLOCK_DEV}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
Display --indent 2 --text "- Found ${ENCRYPTED_SWAPS} encrypted and ${UNENCRYPTED_SWAPS} unencrypted swap devices in use." --result OK --color WHITE
|
||||||
|
else
|
||||||
|
LogText "Result: skipping testing as swapon returned an error."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
@ -232,6 +244,7 @@
|
|||||||
if IsRunning "rngd"; then
|
if IsRunning "rngd"; then
|
||||||
Display --indent 2 --text "- HW RNG & rngd" --result "${STATUS_YES}" --color GREEN
|
Display --indent 2 --text "- HW RNG & rngd" --result "${STATUS_YES}" --color GREEN
|
||||||
LogText "Result: rngd is running"
|
LogText "Result: rngd is running"
|
||||||
|
RNG_FOUND=1
|
||||||
else
|
else
|
||||||
Display --indent 2 --text "- HW RNG & rngd" --result "${STATUS_NO}" --color YELLOW
|
Display --indent 2 --text "- HW RNG & rngd" --result "${STATUS_NO}" --color YELLOW
|
||||||
# TODO - enable suggestion when website has listing for this control
|
# TODO - enable suggestion when website has listing for this control
|
||||||
@ -263,8 +276,9 @@
|
|||||||
done
|
done
|
||||||
if [ -z "${FOUND}" ]; then
|
if [ -z "${FOUND}" ]; then
|
||||||
Display --indent 2 --text "- SW prng" --result "${STATUS_NO}" --color YELLOW
|
Display --indent 2 --text "- SW prng" --result "${STATUS_NO}" --color YELLOW
|
||||||
ReportSuggestion "${TEST_NO}" "Utilize software pseudo random number generators"
|
# ReportSuggestion "${TEST_NO}" "Utilize software pseudo random number generators"
|
||||||
else
|
else
|
||||||
|
RNG_FOUND=1
|
||||||
Display --indent 2 --text "- SW prng" --result "${STATUS_YES}" --color GREEN
|
Display --indent 2 --text "- SW prng" --result "${STATUS_YES}" --color GREEN
|
||||||
LogText "Result: found ${FOUND} running"
|
LogText "Result: found ${FOUND} running"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user