]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/ids.cgi
Fixed detection of snort description if there is no CRLF and the
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / ids.cgi
index dc31c485046ad6e3d971648c55b762551a775819..1d0f4abc81e0a56686deacb7c57c6feeed5008b5 100644 (file)
@@ -143,7 +143,7 @@ if (-e "/etc/snort/snort.conf") {
                                        # If see more than one dashed line, (start to) create rule file description
                                        if ($dashlinecnt > 1) {
                                                # Check for a line starting with a #
-                                               if ($ruleline =~ /^\#/) {
+                                               if ($ruleline =~ /^\#/ and $ruleline !~ /^\#alert/) {
                                                        # Create tempruleline
                                                        my $tempruleline = $ruleline;
 
@@ -265,10 +265,10 @@ if ($snortsettings{'RULES'} eq 'subscripted') {
        #$url="http://www.snort.org/pub-bin/oinkmaster.cgi/$snortsettings{'OINKCODE'}/snortrules-snapshot-2.8_s.tar.gz";
 } elsif ($snortsettings{'RULES'} eq 'registered') {
        #$url="http://dl.snort.org/reg-rules/snortrules-snapshot-2.8.tar.gz?oink_code=$snortsettings{'OINKCODE'}";
-       $url="http://dl.snort.org/reg-rules/snortrules-snapshot-2860_s.tar.gz?oink_code=$snortsettings{'OINKCODE'}";
+       $url="http://dl.snort.org/reg-rules/snortrules-snapshot-2860.tar.gz?oink_code=$snortsettings{'OINKCODE'}";
        #$url="http://www.snort.org/pub-bin/oinkmaster.cgi/$snortsettings{'OINKCODE'}/snortrules-snapshot-2.8.tar.gz";
 } else {
-       $url="http://www.snort.org/pub-bin/downloads.cgi/Download/comm_rules/Community-Rules-CURRENT.tar.gz";
+       $url="http://www.emergingthreats.net/rules/emerging.rules.tar.gz";
 }
 
 if ($snortsettings{'ACTION'} eq $Lang::tr{'save'} && $snortsettings{'ACTION2'} eq "snort" )
@@ -353,8 +353,8 @@ if ($snortsettings{'ACTION'} eq $Lang::tr{'download new ruleset'}) {
                if ($line =~ m/dev/ ) {
                $line =~ m/^.* (\d+)M.*$/;
                my @temp = split(/ +/,$line);
-                       if ($1<600) {
-                               $errormessage = "$Lang::tr{'not enough disk space'} < 600MB, /var $1MB";
+                       if ($1<300) {
+                               $errormessage = "$Lang::tr{'not enough disk space'} < 300MB, /var $1MB";
                        } else {
                                my $filename = &downloadrulesfile();
                                if (defined $filename) {
@@ -559,6 +559,11 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable
                foreach my $rulefile (sort keys(%snortrules)) {
                        my $rulechecked = '';
 
+                       # Hide inkompatible Block rules
+                       if ($rulefile =~'-BLOCK.rules') {
+                               next;
+                       }
+
                        # Check if reached half-way through rule file rules to start new column
                if ($ruledisplaycnt > $rulecnt) {
                                print "</TABLE></TD><TD VALIGN='TOP'><TABLE>";