From d64f4808234da4449d7c29fd8de6280f70a45d0e Mon Sep 17 00:00:00 2001 From: nser77 <104022475+nser77@users.noreply.github.com> Date: Wed, 9 Oct 2024 09:40:01 +0200 Subject: [PATCH] Update tests_firewalls --- include/tests_firewalls | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/include/tests_firewalls b/include/tests_firewalls index a73d8fc3..89170a0b 100644 --- a/include/tests_firewalls +++ b/include/tests_firewalls @@ -112,7 +112,7 @@ tables="filter nat mangle raw security" for t in ${tables} do - ${iptables_binary} -t "${t}" -S -v -w 1 2>/dev/zero | while read -r line + ${IPTABLESBINARY} -t "${t}" -S -v -w 1 2>/dev/zero | while read -r line do set -- ${line} while [ $# -gt 0 ] @@ -199,16 +199,25 @@ # logics if [ "${t}" = "filter" ] || [ "${t}" = "security" ] then - if [ "${c}" = "INPUT" ] && [ "${j}" = "ACCEPT" ] + if [ "${c}" = "INPUT" ] then - LogText "Result: Found ${j} for ${c} (table: ${t})" - Display --indent 6 --text "- Checking chain ${c} (table: ${t}, chain ${c})" --result "${j}" --color YELLOW - AddHP 1 3 - elif [ "${c}" = "INPUT" ] && [ "${j}" = "DROP" ] + if [ "${j}" = "ACCEPT" ] + then + LogText "Result: Found ${j} for ${c} (table: ${t})" + Display --indent 6 --text "- Checking chain ${c} (table: ${t}, chain ${c})" --result "${j}" --color YELLOW + AddHP 1 3 + elif [ "${j}" = "DROP" ] + then + LogText "Result: Found ${j} for ${c} (table: ${t})" + Display --indent 6 --text "- Checking chain ${c} (table: ${t}, chain ${c})" --result "${j}" --color GREEN + AddHP 3 3 + fi + elif [ "${c}" = "FORWARD" ] then - LogText "Result: Found ${j} for ${c} (table: ${t})" - Display --indent 6 --text "- Checking chain ${c} (table: ${t}, chain ${c})" --result "${j}" --color GREEN - AddHP 3 3 + : + elif [ "${c}" = "OUTPUT" ] + then + : elif [ "${c}" = "INPUT" ] || [ "${c}" = "FORWARD" ] || [ "${c}" = "OUTPUT" ] then if [ "${j}" = "NFQUEUE" ]