From 2999f1d214d12a6b58eefc0e5c9cb0b4588eeb65 Mon Sep 17 00:00:00 2001 From: maniacikarus Date: Thu, 26 Jul 2007 20:23:40 +0000 Subject: [PATCH] IDS nochmal angepasst git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@722 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- doc/packages-list.txt | 1 + html/cgi-bin/ids.cgi | 39 ++++++++++++++++++++++----------------- make.sh | 1 + 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/doc/packages-list.txt b/doc/packages-list.txt index 1a1b9afcfe..062d74f336 100644 --- a/doc/packages-list.txt +++ b/doc/packages-list.txt @@ -104,6 +104,7 @@ * grep-2.5.1a * groff-1.18.1.1 * grub-0.97 +* guardian-1.7.0 * gzip-1.3.5 * hddtemp-0.3-beta14 * hdparm-6.6 diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 16a9445118..51c9f8c69c 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -67,22 +67,27 @@ my $border = ''; my $checkboxname = ''; if (-e "/etc/snort/snort.conf") { + + # Open snort.conf file, read it in, close it, and re-open for writing open(FILE, "/etc/snort/snort.conf") or die 'Unable to read snort config file.'; @snortconfig = ; close(FILE); open(FILE, ">/etc/snort/snort.conf") or die 'Unable to write snort config file.'; + my @rules = `cd /etc/snort/rules/ && ls *.rules`; # With this loop the rule might be display with correct rulepath set + foreach (@rules) { + chomp $_; + my $temp = join(";",@snortconfig); + if ( $temp =~ /$_/ ){next;} + else { push(@snortconfig,"#include \$RULE_PATH/".$_);} + } + # Loop over each line foreach my $line (@snortconfig) { # Trim the line chomp $line; - # my @rules = `ls $snortrulepath`; With this loop the rule might be display with correct rulepath set - # foreach my $line (@rules) { - # # Trim the line - # chomp $line; - # Check for a line with .rules if ($line =~ /\.rules$/) { # Parse out rule file name @@ -474,7 +479,7 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable if ($ruledisplaycnt > $rulecnt) { print ""; $ruledisplaycnt = 0; - } + } # Check if rule file is enabled if ($snortrules{$rulefile}{"State"} eq 'Enabled') { @@ -482,7 +487,7 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable } # Create rule file link, vars array, and display flag - my $rulefilelink = "?RULEFILE=$rulefile"; + my $rulefilelink = "?RULEFILE=$rulefile"; my $rulefiletoclose = ''; my @queryvars = (); my $displayrulefilerules = 0; @@ -490,12 +495,12 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable # Check for passed in query string if ($ENV{'QUERY_STRING'}) { # Split out vars - @queryvars = split(/\&/, $ENV{'QUERY_STRING'}); + @queryvars = split(/\&/, $ENV{'QUERY_STRING'}); # Loop over values foreach $value (@queryvars) { # Split out var pairs - ($var, $linkedrulefile) = split(/=/, $value); + ($var, $linkedrulefile) = split(/=/, $value); # Check if var is 'RULEFILE' if ($var eq 'RULEFILE') { @@ -513,6 +518,7 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable } } } + # Strip out extra & & ? from rulefilelink $rulefilelink =~ s/^\?\&/\?/i; @@ -576,27 +582,26 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable # Close display table print "
"; - } + } # Close display table print ""; # Increment ruledisplaycnt - $ruledisplaycnt++; + $ruledisplaycnt++; } - print ""; print < - + + - -
   
- + + + END ; &Header::closebox(); diff --git a/make.sh b/make.sh index 4f4500da2a..37dffe5b13 100755 --- a/make.sh +++ b/make.sh @@ -644,6 +644,7 @@ ipfirepackages() { ipfiredist cyrus-sasl # ipfiredist fetchmail # ipfiredist gnump3d + ipfiredist guardian ipfiredist ipfireseeder ipfiredist java ipfiredist libogg -- 2.39.2