feat: enhance NIS check

This commit is contained in:
thibault.dewailly 2024-12-24 09:34:10 +00:00
parent 7fa2d5f516
commit 68f2c640b1
2 changed files with 20 additions and 17 deletions

View File

@ -17,7 +17,7 @@ HARDENING_LEVEL=3
# shellcheck disable=2034
DESCRIPTION="Disable NIS Server."
PACKAGES='nis'
PACKAGES='nis ypserv'
# This function will be called if the script status is on enabled / audit mode
audit() {

View File

@ -17,21 +17,23 @@ HARDENING_LEVEL=3
# shellcheck disable=2034
DESCRIPTION="Ensure that Network Information Service is not installed. Recommended alternative : LDAP."
PACKAGE='nis'
PACKAGES='nis ypbind-mt'
# This function will be called if the script status is on enabled / audit mode
audit() {
for PACKAGE in $PACKAGES; do
is_pkg_installed "$PACKAGE"
if [ "$FNRET" = 0 ]; then
crit "$PACKAGE is installed!"
else
ok "$PACKAGE is absent"
fi
:
done
}
# This function will be called if the script status is on enabled mode
apply() {
for PACKAGE in $PACKAGES; do
is_pkg_installed "$PACKAGE"
if [ "$FNRET" = 0 ]; then
crit "$PACKAGE is installed, purging it"
@ -40,6 +42,7 @@ apply() {
else
ok "$PACKAGE is absent"
fi
done
}
# This function will check config parameters required