diff --git a/bin/v-add-cron-report b/bin/v-add-cron-reports similarity index 100% rename from bin/v-add-cron-report rename to bin/v-add-cron-reports diff --git a/bin/v-update-sys-firewall b/bin/v-update-sys-firewall index 041e509c..95770c62 100755 --- a/bin/v-update-sys-firewall +++ b/bin/v-update-sys-firewall @@ -55,7 +55,6 @@ IFS=$'\n' for line in $(sort -r -n -k 2 -t \' $rules); do eval $line if [ "$SUSPENDED" = 'no' ]; then - chain="-A INPUT" proto="-p $PROTOCOL" port="--dport $PORT" ip="-s $IP" @@ -83,22 +82,22 @@ for line in $(sort -r -n -k 2 -t \' $rules); do fi # Adding firewall rule - echo "$iptables $chain $proto $port $ip $state $action" >> $tmp + echo "$iptables -A INPUT $proto $port $ip $state $action" >> $tmp fi done -# Handling DNS replies -proto="-p udp" -port="--sport 53" -action="-j ACCEPT" -echo "$iptables $chain $proto $port $state $action" >> $tmp +# Handling local traffic +echo "$iptables -A INPUT -p udp --sport 53 -j ACCEPT" >> $tmp +echo "$iptables -A INPUT -s 127.0.0.1 -j ACCEPT" >> $tmp +for ip in $(ls $VESTA/data/ips); do + echo "$iptables -A INPUT -s $ip -j ACCEPT" >> $tmp +done # Enabling stateful firewall if [ "$stateful" != 'no' ]; then - proto="-p tcp" - state="-m state --state ESTABLISHED,RELATED" - action="-j ACCEPT" - echo "$iptables $chain $proto $state $action" >> $tmp + str="$iptables -A INPUT -p tcp -m state" + str="$str --state ESTABLISHED,RELATED -j ACCEPT" + echo "$str" >> $tmp fi # Switching chain policy to DROP @@ -107,6 +106,9 @@ echo "$iptables -P INPUT DROP" >> $tmp # Applying rules bash $tmp +# Deleting temporary file +rm -f $tmp + # Saving rules to the master iptables file if [ -e "/etc/redhat-release" ]; then /sbin/iptables-save > /etc/sysconfig/iptables diff --git a/web/add/cron/reports/index.php b/web/add/cron/reports/index.php new file mode 100644 index 00000000..4b0424e3 --- /dev/null +++ b/web/add/cron/reports/index.php @@ -0,0 +1,13 @@ + +
diff --git a/web/templates/user/list_cron.html b/web/templates/user/list_cron.html index ee253758..6fc387a2 100644 --- a/web/templates/user/list_cron.html +++ b/web/templates/user/list_cron.html @@ -19,6 +19,19 @@ +