}
# Call responsible message parser.
- my $action = $logfile_parsers{$parser}->(@message);
+ my @actions = $logfile_parsers{$parser}->(@message);
# In case an action has been returned, return it too.
- if (defined($action)) {
- # Return which action should be performed.
- return "count $action";
+ if (@actions) {
+ # Return which actions should be performed.
+ return @actions;
}
- # Return undef, no action required.
+ # Return undef, if no actions are required.
return undef;
}
#
sub message_parser_ssh (@) {
my @message = @_;
+ my @actions;
# The name of the parser module.
my $name = "SSH";
# Set event message.
$message = "Possible SSH-Bruteforce Attack - failed preauth.";
}
+
+ # Check if at least the IP-address information has been extracted.
+ if (defined ($address)) {
+ # Add the extracted values and event message for the computed
+ # event to the actions array.
+ push(@actions, "count $address $name $message");
+ }
}
- # Check if at least the IP-address information has been extracted.
- if (defined ($address)) {
- # Return the extracted values and event message.
- return "$address $name $message";
+ # If any actions are required, return the array.
+ if (@actions) {
+ return (@actions);
}
# If we got here, the provided message is not affected by any filter and
#
sub message_parser_httpd (@) {
my @message = @_;
+ my @actions;
# The name of the parser module.
my $name = "HTTPD";
# Set event message.
$message = "Possible WUI brute-force attack, wrong password for user: $2.";
}
+
+ # Check if at least the IP-address information has been extracted.
+ if (defined ($address)) {
+ # Add the extracted values and event message to the actions array.
+ push(@actions, "count $address $name $message");
+ }
}
- # Check if at least the IP-address information has been extracted.
- if (defined ($address)) {
- # Return the extracted values and event message.
- return "$address $name $message";
+ # If any actions are required, return the array.
+ if (@actions) {
+ return @actions;
}
# If we got here, the provided message is not affected by any filter and