X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fids.cgi;h=ff72b7894b2457754a55021124a0d78e396599b5;hb=c9ac8b8052842049694565bedeffc26d651ef093;hp=5c0bcffe3f7984e3def120c46a489d4ad732a6bc;hpb=2795e579303e847e245204fe48141444a66a9235;p=ipfire-2.x.git diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 5c0bcffe3f..ff72b7894b 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -263,9 +263,11 @@ if (-e "/etc/snort/snort.conf") { ####################### End added for snort rules control ################################# if ($snortsettings{'RULES'} eq 'subscripted') { - $url=" http://www.snort.org/sub-rules/snortrules-snapshot-2940.tar.gz/$snortsettings{'OINKCODE'}"; + $url=" https://www.snort.org/rules/snortrules-snapshot-2961.tar.gz?oinkcode=$snortsettings{'OINKCODE'}"; } elsif ($snortsettings{'RULES'} eq 'registered') { - $url=" http://www.snort.org/reg-rules/snortrules-snapshot-2940.tar.gz/$snortsettings{'OINKCODE'}"; + $url=" https://www.snort.org/rules/snortrules-snapshot-2961.tar.gz?oinkcode=$snortsettings{'OINKCODE'}"; +} elsif ($snortsettings{'RULES'} eq 'community') { + $url=" https://www.snort.org/rules/community"; } else { $url="http://rules.emergingthreats.net/open/snort-2.9.0/emerging.rules.tar.gz"; } @@ -274,8 +276,9 @@ if ($snortsettings{'ACTION'} eq $Lang::tr{'save'} && $snortsettings{'ACTION2'} e { $errormessage = $Lang::tr{'invalid input for oink code'} unless ( ($snortsettings{'OINKCODE'} =~ /^[a-z0-9]+$/) || - ($snortsettings{'RULESTYPE'} eq 'nothing' ) || - ($snortsettings{'RULESTYPE'} eq 'community' )); + ($snortsettings{'RULES'} eq 'nothing' ) || + ($snortsettings{'RULES'} eq 'emerging' ) || + ($snortsettings{'RULES'} eq 'community' )); &General::writehash("${General::swroot}/snort/settings", \%snortsettings); if ($snortsettings{'ENABLE_SNORT'} eq 'on') @@ -402,6 +405,7 @@ $checked{'ENABLE_GUARDIAN'}{'on'} = ''; $checked{'ENABLE_GUARDIAN'}{$snortsettings{'ENABLE_GUARDIAN'}} = "checked='checked'"; $selected{'RULES'}{'nothing'} = ''; $selected{'RULES'}{'community'} = ''; +$selected{'RULES'}{'emerging'} = ''; $selected{'RULES'}{'registered'} = ''; $selected{'RULES'}{'subscripted'} = ''; $selected{'RULES'}{$snortsettings{'RULES'}} = "selected='selected'"; @@ -409,9 +413,9 @@ $selected{'RULES'}{$snortsettings{'RULES'}} = "selected='selected'"; &Header::openpage($Lang::tr{'intrusion detection system'}, 1, ''); ####################### Added for snort rules control ################################# -print ""; +print ""; print < + + END ; ####################### End added for snort rules control ################################# @@ -468,7 +472,7 @@ if ($return) { $Lang::tr{'snort working'}
- +
 END
@@ -487,7 +491,7 @@ END
 	refreshpage();
 }
 
-&Header::openbox('100%', 'left', $Lang::tr{'intrusion detection system2'});
+&Header::openbox('100%', 'left', $Lang::tr{'intrusion detection system'});
 print <
-	
+	
@@ -515,6 +519,7 @@ print <
 	
-	"
 print <
 
GREEN Snort @@ -507,7 +511,7 @@ if ( -e "/var/ipfire/guardian/guardian.conf" ) { print <



$Lang::tr{'ids rules update'}
+
END ; if ( -e "/var/tmp/snortrules.tar.gz"){ @@ -543,10 +548,10 @@ print " $Lang::tr{'updates installed'}: $snortsettings{'INSTALLDATE'}
-
+

- +
@@ -574,7 +579,7 @@ END print `cat /var/ipfire/guardian/guardian.ignore`; print < - + END @@ -589,7 +594,7 @@ END if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable_green" || -e "${General::swroot}/snort/enable_blue" || -e "${General::swroot}/snort/enable_orange" ) { &Header::openbox('100%', 'LEFT', $Lang::tr{'intrusion detection system rules'}); # Output display table for rule files - print "
"; + print "
"; print ""; @@ -610,7 +615,7 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable # Check if reached half-way through rule file rules to start new column if ($ruledisplaycnt > $rulecnt) { - print "
"; + print "
"; $ruledisplaycnt = 0; } @@ -661,21 +666,21 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable } # Output rule file name and checkbox - print ""; - print ""; + print "
$rulefile
"; + print "
$rulefile
"; # Check for empty 'Description' if ($snortrules{$rulefile}{'Description'} eq '') { - print ""; + print "
No description available
"; } else { # Output rule file 'Description' - print "
No description available
"; + print "
$snortrules{$rulefile}{'Description'}
"; } # Check for display flag if ($displayrulefilerules) { # Rule file definition rule display - print ""; } # Close display table - print "
$snortrules{$rulefile}{'Description'}
"; + print ""; + print "
"; # Local vars my $ruledefdisplaycnt = 0; @@ -690,7 +695,7 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable # If have display 2 rules, start new row if (($ruledefdisplaycnt % 2) == 0) { - print ""; + print ""; $ruledefdisplaycnt = 0; } @@ -702,7 +707,7 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable # Create rule file rule's checkbox $checkboxname = "SNORT_RULE_$rulefile"; $checkboxname .= "_$ruledef"; - print ""; + print ""; # Increment count $ruledefdisplaycnt++; @@ -710,26 +715,24 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable # If do not have second rule for row, create empty cell if (($ruledefdisplaycnt % 2) != 0) { - print ""; + print ""; } # Close display table - print "
$snortrules{$rulefile}{'Definition'}{$ruledef}{'Description'} $snortrules{$rulefile}{'Definition'}{$ruledef}{'Description'}
"; + print "
"; # Increment ruledisplaycnt $ruledisplaycnt++; } - print "
"; + print ""; print < -   - - +