mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-21 21:17:00 +01:00
feat: Dissociate iptables pkg name from command (#137)
Signed-off-by: Tarik Megzari <tarik.megzari@corp.ovh.com> Co-authored-by: Tarik Megzari <tarik.megzari@corp.ovh.com>
This commit is contained in:
parent
f1c1517bd2
commit
17d272420a
@ -20,6 +20,7 @@ DESCRIPTION="Check iptables firewall default policy for DROP on INPUT and FORWAR
|
|||||||
PACKAGE="iptables"
|
PACKAGE="iptables"
|
||||||
FW_CHAINS="INPUT FORWARD"
|
FW_CHAINS="INPUT FORWARD"
|
||||||
FW_POLICY="DROP"
|
FW_POLICY="DROP"
|
||||||
|
FW_CMD="iptables"
|
||||||
|
|
||||||
# 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() {
|
||||||
@ -27,9 +28,9 @@ audit() {
|
|||||||
if [ "$FNRET" != 0 ]; then
|
if [ "$FNRET" != 0 ]; then
|
||||||
crit "$PACKAGE is not installed!"
|
crit "$PACKAGE is not installed!"
|
||||||
else
|
else
|
||||||
ipt=$($SUDO_CMD "$PACKAGE" -nL 2>/dev/null || true)
|
ipt=$($SUDO_CMD "$FW_CMD" -nL 2>/dev/null || true)
|
||||||
if [[ -z "$ipt" ]]; then
|
if [[ -z "$ipt" ]]; then
|
||||||
crit "Empty return from $PACKAGE command. Aborting..."
|
crit "Empty return from $FW_CMD command. Aborting..."
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
for chain in $FW_CHAINS; do
|
for chain in $FW_CHAINS; do
|
||||||
|
Loading…
Reference in New Issue
Block a user