mirror of
https://github.com/hardenedlinux/harbian-audit.git
synced 2025-09-25 18:58:58 +02:00
Merge pull request #47 from dominiquefournier/master
Add systemd-timesyncd to tests
This commit is contained in:
commit
07f7f86612
@ -15,7 +15,7 @@ set -u # One variable unset, it's over
|
|||||||
HARDENING_LEVEL=3
|
HARDENING_LEVEL=3
|
||||||
HARDENING_EXCEPTION=ntp
|
HARDENING_EXCEPTION=ntp
|
||||||
|
|
||||||
ANALOGOUS_PKG='chrony'
|
ANALOGOUS_PKG='chrony systemd-timesyncd'
|
||||||
PACKAGE='ntp'
|
PACKAGE='ntp'
|
||||||
NTP_CONF_DEFAULT_PATTERN='^restrict -4 default (kod nomodify notrap nopeer noquery|ignore)'
|
NTP_CONF_DEFAULT_PATTERN='^restrict -4 default (kod nomodify notrap nopeer noquery|ignore)'
|
||||||
NTP_CONF_FILE='/etc/ntp.conf'
|
NTP_CONF_FILE='/etc/ntp.conf'
|
||||||
@ -26,10 +26,14 @@ NTP_POOL_CFG='pool 2.debian.pool.ntp.org iburst'
|
|||||||
|
|
||||||
# This function will be called if the script status is on enabled / audit mode
|
# This function will be called if the script status is on enabled / audit mode
|
||||||
audit () {
|
audit () {
|
||||||
is_pkg_installed $ANALOGOUS_PKG
|
for PKG in $ANALOGOUS_PKG; do
|
||||||
|
is_pkg_installed $PKG
|
||||||
if [ $FNRET = 0 ]; then
|
if [ $FNRET = 0 ]; then
|
||||||
ok "Analogous pagkage $ANALOGOUS_PKG is installed. So pass check."
|
ok "Analogous pagkage $PKG is installed. So pass check."
|
||||||
else
|
exit
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
is_pkg_installed $PACKAGE
|
is_pkg_installed $PACKAGE
|
||||||
if [ $FNRET != 0 ]; then
|
if [ $FNRET != 0 ]; then
|
||||||
crit "$PACKAGE is not installed!"
|
crit "$PACKAGE is not installed!"
|
||||||
@ -54,7 +58,6 @@ audit () {
|
|||||||
ok "$NTP_INIT_PATTERN found in $NTP_INIT_FILE"
|
ok "$NTP_INIT_PATTERN found in $NTP_INIT_FILE"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function will be called if the script status is on enabled mode
|
# This function will be called if the script status is on enabled mode
|
||||||
|
@ -15,7 +15,7 @@ set -u # One variable unset, it's over
|
|||||||
HARDENING_LEVEL=3
|
HARDENING_LEVEL=3
|
||||||
HARDENING_EXCEPTION=ntp
|
HARDENING_EXCEPTION=ntp
|
||||||
|
|
||||||
ANALOGOUS_PKG='ntp'
|
ANALOGOUS_PKG='ntp systemd-timesyncd'
|
||||||
PACKAGE='chrony'
|
PACKAGE='chrony'
|
||||||
NTP_CONF_FILE='/etc/chrony/chrony.conf'
|
NTP_CONF_FILE='/etc/chrony/chrony.conf'
|
||||||
NTP_SERVER_PATTERN='^(server|pool)'
|
NTP_SERVER_PATTERN='^(server|pool)'
|
||||||
@ -26,10 +26,13 @@ audit () {
|
|||||||
if [ $OS_RELEASE -eq 2 ]; then
|
if [ $OS_RELEASE -eq 2 ]; then
|
||||||
ok "Redhat or CentOS does not have this check, so PASS"
|
ok "Redhat or CentOS does not have this check, so PASS"
|
||||||
else
|
else
|
||||||
is_pkg_installed $ANALOGOUS_PKG
|
for PKG in $ANALOGOUS_PKG; do
|
||||||
|
is_pkg_installed $PKG
|
||||||
if [ $FNRET = 0 ]; then
|
if [ $FNRET = 0 ]; then
|
||||||
ok "Analogous pagkage $ANALOGOUS_PKG is installed. So pass check."
|
ok "Analogous pagkage $PKG is installed. So pass check."
|
||||||
else
|
exit
|
||||||
|
fi
|
||||||
|
done
|
||||||
is_pkg_installed $PACKAGE
|
is_pkg_installed $PACKAGE
|
||||||
if [ $FNRET != 0 ]; then
|
if [ $FNRET != 0 ]; then
|
||||||
crit "$PACKAGE is not installed!"
|
crit "$PACKAGE is not installed!"
|
||||||
@ -43,7 +46,6 @@ audit () {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function will be called if the script status is on enabled mode
|
# This function will be called if the script status is on enabled mode
|
||||||
|
@ -13,7 +13,7 @@ set -e # One error, it's over
|
|||||||
set -u # One variable unset, it's over
|
set -u # One variable unset, it's over
|
||||||
|
|
||||||
HARDENING_LEVEL=3
|
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
|
# This function will be called if the script status is on enabled / audit mode
|
||||||
audit () {
|
audit () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user