Hello,
I'm hoping someone will help me complete the last part of this puzzle. I want to send the reason the firewall was triggered in the email: Firewall rules updated
I was combing the web one day and came across these mods. Below are changes I made to two of the perl scripts.
----------------
/usr/local/bin/guardian.pl
sub ipchain {
my ($source, $dest, $type) = @_;
&write_log ("$source\t$type\n");
if ($hash{$source} eq "") {
&write_log ("Running '$blockpath $source $interface'\n");
system ("$blockpath $source $interface \"$type\"");
$hash{$source} = time() + $TimeLimit;
} else {
# We have already blocked this one, but snort detected another
attack. So
# we should update the time blocked..
$hash{$source} = time() + $TimeLimit;
}
}
---------------
/bin/guardian_unblock.sh
source=$1
interface=$2
alert=$3 <---{added}
/sbin/ipchains -I input -s $source -i $interface -j DENY
echo "The Snort-Guardian service has updated your firewall rules by
blocking th$
This IP address will be blocked for 24 hours unless the server is
rebooted.
$alert <---{added}
For detailed information: /var/log/guardian.log
/var/log/snort/alert
" | mail -s "Firewall rules updated" admin
-----
And wouldn't you know it doens't work. I know a bit of perl and so I think my problem is here, but I dont know enough about IPChains to know whats going on here:
/sbin/ipchains -I input -s $source -i $interface -j DENY