Add systemd-timesyncd server

This commit is contained in:
root 2023-03-07 13:55:24 +01:00
parent 235c85c3d8
commit 1b7ee81794
2 changed files with 9 additions and 7 deletions

View File

@ -15,7 +15,7 @@ set -u # One variable unset, it's over
HARDENING_LEVEL=3
HARDENING_EXCEPTION=ntp
ANALOGOUS_PKG='ntp'
ANALOGOUS_PKG='ntp systemd-timesyncd'
PACKAGE='chrony'
NTP_CONF_FILE='/etc/chrony/chrony.conf'
NTP_SERVER_PATTERN='^(server|pool)'
@ -26,10 +26,13 @@ audit () {
if [ $OS_RELEASE -eq 2 ]; then
ok "Redhat or CentOS does not have this check, so PASS"
else
is_pkg_installed $ANALOGOUS_PKG
if [ $FNRET = 0 ]; then
ok "Analogous pagkage $ANALOGOUS_PKG is installed. So pass check."
else
for PKG in $ANALOGOUS_PKG; do
is_pkg_installed $PKG
if [ $FNRET = 0 ]; then
ok "Analogous pagkage $PKG is installed. So pass check."
exit
fi
done
is_pkg_installed $PACKAGE
if [ $FNRET != 0 ]; then
crit "$PACKAGE is not installed!"
@ -42,7 +45,6 @@ audit () {
ok "$NTP_SERVER_PATTERN found in $NTP_CONF_FILE"
fi
fi
fi
fi
}

View File

@ -13,7 +13,7 @@ set -e # One error, it's over
set -u # One variable unset, it's over
HARDENING_LEVEL=3
PACKAGES='ntp chrony'
PACKAGES='ntp chrony systemd-timesyncd'
# This function will be called if the script status is on enabled / audit mode
audit () {