X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fids.cgi;h=984e795e72bf002446ee150166a174ef56c114e5;hp=31b873056281a04e55e39317c0e06c5334fcd566;hb=e6d8a42109651b5054eec7a9b613f732bf8d323f;hpb=6c22de5561913d751954df791ebf29e00c33f867 diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 31b873056..984e795e7 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2005-2011 IPFire Team # +# Copyright (C) 2007-2013 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -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/reg-rules/snortrules-snapshot-2912_s.tar.gz/$snortsettings{'OINKCODE'}"; + $url=" http://www.snort.org/sub-rules/snortrules-snapshot-2953.tar.gz/$snortsettings{'OINKCODE'}"; } elsif ($snortsettings{'RULES'} eq 'registered') { - $url=" http://www.snort.org/reg-rules/snortrules-snapshot-2912.tar.gz/$snortsettings{'OINKCODE'}"; + $url=" http://www.snort.org/reg-rules/snortrules-snapshot-2950.tar.gz/$snortsettings{'OINKCODE'}"; +} elsif ($snortsettings{'RULES'} eq 'community') { + $url=" http://s3.amazonaws.com/snort-org/www/rules/community/community-rules.tar.gz"; } 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 ################################# @@ -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 < -   - - +