Skip to content
Snippets Groups Projects
Commit 907443f1 authored by Tomáš Plesník's avatar Tomáš Plesník
Browse files

opravena zamena attack_scale pri kontrole timeoutu; doplnena kontrola definice...

opravena zamena attack_scale pri kontrole timeoutu; doplnena kontrola definice polozky udalosti; predelano generovani hlasky zmenenych polozek udalosti serverem
parent 08c8d528
No related branches found
No related tags found
No related merge requests found
...@@ -240,36 +240,25 @@ sub saveNewEvent ...@@ -240,36 +240,25 @@ sub saveNewEvent
"Unknown detected time format: '$detected'"); "Unknown detected time format: '$detected'");
} }
my $change_string = ""; my @change_list;
if ($target_port !~ /^\d+\z/) { if (defined $target_port && $target_port !~ /^\d+\z/) {
$change_string = $change_string . "target_port: '$target_port'"; push(@change_list, "target_port: '$target_port'");
$target_port = undef; $target_port = undef;
} }
if ($attack_scale !~ /^\d+\z/) { if (defined $attack_scale && $attack_scale !~ /^\d+\z/) {
if ($change_string eq "") { push(@change_list, "attack_scale: '$attack_scale'");
$change_string = $change_string . "attack_scale: '$attack_scale'";
} else {
$change_string = $change_string . ", attack_scale: '$attack_scale'";
}
$attack_scale = undef; $attack_scale = undef;
} }
if ($priority !~ /^\d+\z/) { if (defined $priority && $priority !~ /^\d+\z/) {
if ($change_string eq "") { push(@change_list, "priority: '$priority'");
$change_string = $change_string . "priority: '$priority'";
} else {
$change_string = $change_string . ", priority: '$priority'";
}
$priority = undef; $priority = undef;
} }
if ($timeout !~ /^\d+\z/) { if (defined $timeout && $timeout !~ /^\d+\z/) {
if ($change_string eq "") { push(@change_list, "timeout: '$timeout'");
$change_string = $change_string . "attack_scale: '$timeout'";
} else {
$change_string = $change_string . ", attack_scale: '$timeout'";
}
$timeout = undef; $timeout = undef;
} }
if ($change_string ne ""){ my $change_string = join(", ", @change_list);
if ($change_string ne "") {
sendMsg("info", sendMsg("info",
"Unknown event items detected {originaly - $change_string} received in $received from [IP '$ip'; CN(AN): $alt_names; Service: '$service'; Type: '$type'; Detected: $detected]", "Unknown event items detected {originaly - $change_string} received in $received from [IP '$ip'; CN(AN): $alt_names; Service: '$service'; Type: '$type'; Detected: $detected]",
undef); undef);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment