mirror of
https://github.com/ovh/debian-cis.git
synced 2025-04-20 00:56:13 +02:00
feat: enhance NIS check
This commit is contained in:
parent
7fa2d5f516
commit
68f2c640b1
@ -17,7 +17,7 @@ HARDENING_LEVEL=3
|
|||||||
# shellcheck disable=2034
|
# shellcheck disable=2034
|
||||||
DESCRIPTION="Disable NIS Server."
|
DESCRIPTION="Disable NIS Server."
|
||||||
|
|
||||||
PACKAGES='nis'
|
PACKAGES='nis ypserv'
|
||||||
|
|
||||||
# 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() {
|
||||||
|
@ -17,29 +17,32 @@ HARDENING_LEVEL=3
|
|||||||
# shellcheck disable=2034
|
# shellcheck disable=2034
|
||||||
DESCRIPTION="Ensure that Network Information Service is not installed. Recommended alternative : LDAP."
|
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
|
# This function will be called if the script status is on enabled / audit mode
|
||||||
audit() {
|
audit() {
|
||||||
is_pkg_installed "$PACKAGE"
|
for PACKAGE in $PACKAGES; do
|
||||||
if [ "$FNRET" = 0 ]; then
|
is_pkg_installed "$PACKAGE"
|
||||||
crit "$PACKAGE is installed!"
|
if [ "$FNRET" = 0 ]; then
|
||||||
else
|
crit "$PACKAGE is installed!"
|
||||||
ok "$PACKAGE is absent"
|
else
|
||||||
fi
|
ok "$PACKAGE is absent"
|
||||||
:
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# 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
|
||||||
apply() {
|
apply() {
|
||||||
is_pkg_installed "$PACKAGE"
|
for PACKAGE in $PACKAGES; do
|
||||||
if [ "$FNRET" = 0 ]; then
|
is_pkg_installed "$PACKAGE"
|
||||||
crit "$PACKAGE is installed, purging it"
|
if [ "$FNRET" = 0 ]; then
|
||||||
apt-get purge "$PACKAGE" -y
|
crit "$PACKAGE is installed, purging it"
|
||||||
apt-get autoremove -y
|
apt-get purge "$PACKAGE" -y
|
||||||
else
|
apt-get autoremove -y
|
||||||
ok "$PACKAGE is absent"
|
else
|
||||||
fi
|
ok "$PACKAGE is absent"
|
||||||
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function will check config parameters required
|
# This function will check config parameters required
|
||||||
|
Loading…
x
Reference in New Issue
Block a user