]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
Merge remote-tracking branch 'pmueller/temp-c164-development' into next
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Feb 2022 19:46:13 +0000 (19:46 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Feb 2022 19:46:13 +0000 (19:46 +0000)
config/rootfiles/core/164/filelists/files
html/cgi-bin/ids.cgi
src/initscripts/system/firewall
src/pakfire/lib/functions.pl

index e774b116bc901bdbd65a487a00a9c7cd048c15d6..278dc20a6943fc57a593188dd2b5cf6f573aca75 100644 (file)
@@ -5,6 +5,7 @@ etc/rc.d/init.d/partresize
 etc/rc.d/init.d/squid
 etc/suricata/suricata.yaml
 etc/sysctl.conf
+opt/pakfire/lib/functions.pl
 srv/web/ipfire/cgi-bin/ids.cgi
 srv/web/ipfire/cgi-bin/logs.cgi/log.dat
 srv/web/ipfire/cgi-bin/optionsfw.cgi
index 161464d0d9990998ad23bcd67c826611a3d5065f..27e61e9bb5e0da01f83237e6b98a057cc12015d0 100644 (file)
@@ -1019,7 +1019,7 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'ids apply'}) {
                        &IDS::call_suricatactrl("stop");
                }
        }
-       
+
        # Undefine providers flag.
        undef($cgiparams{'PROVIDERS'});
 
@@ -1468,7 +1468,7 @@ print <<END;
                <br>
                <hr>
                <br>
-       
+
                <div align='center'>
                        <table width='100%'>
 END
@@ -1522,7 +1522,7 @@ sub show_customize_ruleset() {
        print"var hide = \"$Lang::tr{'ids hide'}\"\;\n";
 
 print <<END
-       // Tiny java script function to show/hide the rules
+       // Tiny javascript function to show/hide the rules
        // of a given category.
        function showhide(tblname) {
                \$("#" + tblname).toggle();
@@ -1540,97 +1540,97 @@ print <<END
 END
 ;
        &Header::openbox('100%', 'LEFT', "$Lang::tr{'intrusion detection system rules'}" );
-               print"<form method='POST' action='$ENV{'SCRIPT_NAME'}'>\n";
-
-               # Output display table for rule files
-               print "<table width='100%'>\n";
+       print"<form method='POST' action='$ENV{'SCRIPT_NAME'}'>\n";
 
-               # Loop over each rule file
-               foreach my $rulefile (sort keys(%idsrules)) {
-                       my $rulechecked = '';
+       # Output display table for rule files
+       print "<table width='100%'>\n";
 
-                       # Check if rule file is enabled
-                       if ($idsrules{$rulefile}{'Rulefile'}{'State'} eq 'on') {
-                               $rulechecked = 'CHECKED';
-                       }
-
-                       # Convert rulefile name into category name.
-                       my $categoryname = &_rulefile_to_category($rulefile);
+       # Loop over each rule file
+       foreach my $rulefile (sort keys(%idsrules)) {
+               my $rulechecked = '';
 
-                       # Table and rows for the rule files.
-                       print"<tr>\n";
-                       print"<td class='base' width='5%'>\n";
-                       print"<input type='checkbox' name='$rulefile' $rulechecked>\n";
-                       print"</td>\n";
-                       print"<td class='base' width='90%'><b>$rulefile</b></td>\n";
-                       print"<td class='base' width='5%' align='right'>\n";
-                       print"<a href=\"javascript:showhide('$categoryname')\"><span id='span_$categoryname'>$Lang::tr{'ids show'}</span></a>\n";
-                       print"</td>\n";
-                       print"</tr>\n";
+               # Check if rule file is enabled
+               if ($idsrules{$rulefile}{'Rulefile'}{'State'} eq 'on') {
+                       $rulechecked = 'CHECKED';
+               }
 
-                       # Rows which will be hidden per default and will contain the single rules.
-                       print"<tr  style='display:none' id='$categoryname'>\n";
-                       print"<td colspan='3'>\n";
+               # Convert rulefile name into category name.
+               my $categoryname = &_rulefile_to_category($rulefile);
+
+               # Table and rows for the rule files.
+               print"<tr>\n";
+               print"<td class='base' width='5%'>\n";
+               print"<input type='checkbox' name='$rulefile' $rulechecked>\n";
+               print"</td>\n";
+               print"<td class='base' width='90%'><b>$rulefile</b></td>\n";
+               print"<td class='base' width='5%' align='right'>\n";
+               print"<a href=\"javascript:showhide('$categoryname')\"><span id='span_$categoryname'>$Lang::tr{'ids show'}</span></a>\n";
+               print"</td>\n";
+               print"</tr>\n";
+
+               # Rows which will be hidden per default and will contain the single rules.
+               print"<tr  style='display:none' id='$categoryname'>\n";
+               print"<td colspan='3'>\n";
+
+               # Local vars
+               my $lines;
+               my $rows;
+               my $col;
+
+               # New table for the single rules.
+               print "<table width='100%'>\n";
 
+               # Loop over rule file rules
+               foreach my $sid (sort {$a <=> $b} keys(%{$idsrules{$rulefile}})) {
                        # Local vars
-                       my $lines;
-                       my $rows;
-                       my $col;
+                       my $ruledefchecked = '';
 
-                       # New table for the single rules.
-                       print "<table width='100%'>\n";
-
-                       # Loop over rule file rules
-                       foreach my $sid (sort {$a <=> $b} keys(%{$idsrules{$rulefile}})) {
-                               # Local vars
-                               my $ruledefchecked = '';
-
-                               # Skip rulefile itself.
-                               next if ($sid eq "Rulefile");
-
-                               # If 2 rules have been displayed, start a new row
-                               if (($lines % 2) == 0) {
-                                       print "</tr><tr>\n";
-
-                                       # Increase rows by once.
-                                       $rows++;
-                               }
-
-                               # Colour lines.
-                               if ($rows % 2) {
-                                       $col="bgcolor='$color{'color20'}'";
-                               } else {
-                                       $col="bgcolor='$color{'color22'}'";
-                               }
+                       # Skip rulefile itself.
+                       next if ($sid eq "Rulefile");
 
-                               # Set rule state
-                               if ($idsrules{$rulefile}{$sid}{'State'} eq 'on') {
-                                       $ruledefchecked = 'CHECKED';
-                               }
+                       # If 2 rules have been displayed, start a new row
+                       if (($lines % 2) == 0) {
+                               print "</tr><tr>\n";
 
-                               # Create rule checkbox and display rule description
-                               print "<td class='base' width='5%' align='right' $col>\n";
-                               print "<input type='checkbox' NAME='$sid' $ruledefchecked>\n";
-                               print "</td>\n";
-                               print "<td class='base' width='45%' $col>$idsrules{$rulefile}{$sid}{'Description'}</td>";
+                               # Increase rows by once.
+                               $rows++;
+                       }
 
-                               # Increment rule count
-                               $lines++;
+                       # Colour lines.
+                       if ($rows % 2) {
+                               $col="bgcolor='$color{'color20'}'";
+                       } else {
+                               $col="bgcolor='$color{'color22'}'";
                        }
 
-                       # If do not have a second rule for row, create empty cell
-                       if (($lines % 2) != 0) {
-                               print "<td class='base'></td>";
+                       # Set rule state
+                       if ($idsrules{$rulefile}{$sid}{'State'} eq 'on') {
+                               $ruledefchecked = 'CHECKED';
                        }
 
-                       # Close display table
-                       print "</tr></table></td></tr>";
+                       # Create rule checkbox and display rule description
+                       print "<td class='base' width='5%' align='right' $col>\n";
+                       print "<input type='checkbox' NAME='$sid' $ruledefchecked>\n";
+                       print "</td>\n";
+                       print "<td class='base' width='45%' $col>$idsrules{$rulefile}{$sid}{'Description'}</td>";
+
+                       # Increment rule count
+                       $lines++;
+               }
+
+               # If do not have a second rule for row, create empty cell
+               if (($lines % 2) != 0) {
+                       print "<td class='base'></td>";
                }
 
                # Close display table
-               print "</table>";
+               print "</tr></table></td></tr>";
+       }
 
-               print <<END
+       # Close display table
+       print "</table>";
+
+       print <<END
 <table width='100%'>
 <tr>
        <td width='100%' align='right'>
@@ -1642,8 +1642,7 @@ END
 </form>
 END
 ;
-               &Header::closebox();
-       }
+       &Header::closebox();
 }
 
 #
@@ -1905,7 +1904,7 @@ sub show_additional_provider_actions() {
                                        </td>
                                </tr>
                        </table>
-               </form>                 
+               </form>
 END
 ;
        &Header::closebox();
index ebc8168ae7e219c6dea70bbf1e04001f4153fb5d..7d081bbc36678bbc35a656281b583f41f0ca7bcc 100644 (file)
@@ -141,17 +141,15 @@ iptables_init() {
 
        # Log and drop any traffic from and to networks known as being hostile, posing
        # a technical threat to our users (i. e. listed at Spamhaus DROP et al.)
+       iptables -N HOSTILE
        if [ "$DROPHOSTILE" == "on" ]; then
-               iptables -N DROP_HOSTILE
-               iptables -A DROP_HOSTILE  -m limit --limit 10/second -j LOG  --log-prefix "DROP_HOSTILE "
-
-               iptables -A INPUT   -i $IFACE -m geoip --src-cc XD -j DROP_HOSTILE
-               iptables -A FORWARD -i $IFACE -m geoip --src-cc XD -j DROP_HOSTILE
-               iptables -A FORWARD -o $IFACE -m geoip --dst-cc XD -j DROP_HOSTILE
-               iptables -A OUTPUT  -o $IFACE -m geoip --src-cc XD -j DROP_HOSTILE
-
-               iptables -A DROP_HOSTILE -j DROP -m comment --comment "DROP_HOSTILE"
+               iptables -A HOSTILE -m limit --limit 10/second -j LOG  --log-prefix "DROP_HOSTILE "
+               iptables -A INPUT   -i $IFACE -m geoip --src-cc XD -j HOSTILE
+               iptables -A FORWARD -i $IFACE -m geoip --src-cc XD -j HOSTILE
+               iptables -A FORWARD -o $IFACE -m geoip --dst-cc XD -j HOSTILE
+               iptables -A OUTPUT  -o $IFACE -m geoip --src-cc XD -j HOSTILE
        fi
+       iptables -A HOSTILE -j DROP -m comment --comment "DROP_HOSTILE"
 
        # P2PBLOCK
        iptables -N P2PBLOCK
index 2f34763d5d324a06446d7a64c3d213e580a2ba70..cb448a766a01cd4f7692b119005ee14e65a5e478 100644 (file)
@@ -524,13 +524,13 @@ sub dblist {
                foreach $line (sort @db) {
                        next unless ($line =~ /.*;.*;.*;/ );
                        $use_color = "";
-                       $count++;
                        @templine = split(/\;/,$line);
                        if ("$filter" eq "notinstalled") {
                                next if ( -e "$Conf::dbdir/installed/meta-$templine[0]" );
                        } elsif ("$filter" eq "installed") {
                                next unless ( -e "$Conf::dbdir/installed/meta-$templine[0]" );
                        }
+                       $count++;
                        if ("$forweb" eq "forweb")
                         {
                                if ("$filter" eq "notinstalled") {