Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dumbpig.pl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
my @blackArray=();
my $fixnormbug=1; # I found a bug in Parse::Snort with whitespace normalization,
# this is a quick fix while waiting for patch upstream
my $chgexitcode=0;

sub convert_bl{
# Convert a load of snort rule header format IPs (or CIDR) to the format used by the blacklist patch
Expand Down Expand Up @@ -119,6 +120,7 @@ sub usage{
print " -v or --verbose Verbose output for debugging\n";
print " -c or --censor Censor rules in the output, in case you dont trust everyone\n";
print " -f or --forcefail Force good rules to FAIL. Allows output of all rules\n";
print " -e or --error Use nonzero return code if bad rules are found\n";
exit 1;
}

Expand All @@ -132,6 +134,7 @@ sub usage{
'f|forcefail' => \$forcefail,
'c|censor' => \$censor,
'q|quiet' => \$q,
'e|error' => \$chgexitcode,
);

unless ( $q ) {
Expand Down Expand Up @@ -619,3 +622,4 @@ sub usage{
print "--------------------------------------\n";
print "Total: $failnum fails over $rulecount rules ($linenum lines) in $rulefile\n";
print "- Contact leon.ward\@sourcefire.com\n";
exit $failnum if $chgexitcode;