mirror of
https://github.com/hardenedlinux/harbian-audit.git
synced 2025-07-31 01:24:58 +02:00
Fix some bug for 7.7.4 and 7.7.5
This commit is contained in:
parent
86ca90d417
commit
f9c5a21dff
@ -20,9 +20,9 @@ IPS6=$(which ip6tables)
|
|||||||
|
|
||||||
# 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 () {
|
||||||
if [ $(${IPS4} -S | egrep "\-P") -eq 0 ]; then
|
if [ $(${IPS4} -S | grep -c "\-P") -eq 0 ]; then
|
||||||
crit "Ip4tables: Firewall policy is not default deny!"
|
crit "Ip4tables: Firewall policy is not default deny!"
|
||||||
if [ $(${IPS6} -S | egrep "\-P") -eq 0 ]; then
|
if [ $(${IPS6} -S | grep -c "\-P") -eq 0 ]; then
|
||||||
crit "Ip6tables: Firewall policy is not default deny!"
|
crit "Ip6tables: Firewall policy is not default deny!"
|
||||||
FNRET=1
|
FNRET=1
|
||||||
else
|
else
|
||||||
|
@ -15,13 +15,14 @@ set -u # One variable unset, it's over
|
|||||||
|
|
||||||
HARDENING_LEVEL=2
|
HARDENING_LEVEL=2
|
||||||
|
|
||||||
IPS4=$(which iptables)
|
INPUT_ACCEPT=1
|
||||||
IPS6=$(which ip6tables)
|
OUTPUT_ACCEPT=1
|
||||||
|
INPUT_DENY=1
|
||||||
|
|
||||||
# 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 () {
|
||||||
# Check the loopback interface to accept INPUT traffic.
|
# Check the loopback interface to accept INPUT traffic.
|
||||||
ensure_lo_traffic_input_is_accept()
|
ensure_lo_traffic_input_is_accept
|
||||||
if [ $FNRET = 0 ]; then
|
if [ $FNRET = 0 ]; then
|
||||||
INPUT_ACCEPT=0
|
INPUT_ACCEPT=0
|
||||||
ok "Iptables loopback traffic INPUT has configured!"
|
ok "Iptables loopback traffic INPUT has configured!"
|
||||||
@ -30,7 +31,7 @@ audit () {
|
|||||||
crit "Iptables: loopback traffic INPUT is not configured!"
|
crit "Iptables: loopback traffic INPUT is not configured!"
|
||||||
fi
|
fi
|
||||||
# Check the loopback interface to accept OUTPUT traffic.
|
# Check the loopback interface to accept OUTPUT traffic.
|
||||||
ensure_lo_traffic_output_is_accept()
|
ensure_lo_traffic_output_is_accept
|
||||||
if [ $FNRET = 0 ]; then
|
if [ $FNRET = 0 ]; then
|
||||||
OUTPUT_ACCEPT=0
|
OUTPUT_ACCEPT=0
|
||||||
ok "Iptables loopback traffic OUTPUT has configured!"
|
ok "Iptables loopback traffic OUTPUT has configured!"
|
||||||
@ -39,7 +40,7 @@ audit () {
|
|||||||
crit "Iptables: loopback traffic OUTPUT is not configured!"
|
crit "Iptables: loopback traffic OUTPUT is not configured!"
|
||||||
fi
|
fi
|
||||||
# all other interfaces to deny traffic to the loopback network.
|
# all other interfaces to deny traffic to the loopback network.
|
||||||
ensure_lo_traffic_other_if_input_is_deny()
|
ensure_lo_traffic_other_if_input_is_deny
|
||||||
if [ $FNRET = 0 ]; then
|
if [ $FNRET = 0 ]; then
|
||||||
INPUT_DENY=0
|
INPUT_DENY=0
|
||||||
ok "Iptables loopback traffic INPUT deny from other interfaces has configured!"
|
ok "Iptables loopback traffic INPUT deny from other interfaces has configured!"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user