diff --git a/src/warden-server/lib/Warden.pm b/src/warden-server/lib/Warden.pm index a42eb590f4650f60320ff4b7ca39857d17022b93..0fcc219bc0f83835b4ead81378b26d837e8ecf59 100755 --- a/src/warden-server/lib/Warden.pm +++ b/src/warden-server/lib/Warden.pm @@ -220,9 +220,8 @@ sub saveNewEvent my %client = authorizeClient($alt_names, $ip, $service, $client_type, $function_name); if(defined %client) { - # check validity of event attributes - TYPE - my $match = grep /$type/, @{$VALID_STRINGS{'type'}}; - if ($match) { + # if validator is configured, check validity of event attributes - TYPE + if (!exists $VALID_STRINGS{'type'} or grep $type eq $_, @{$VALID_STRINGS{'type'}}) { $sth=$DBH->prepare("INSERT INTO events VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);"); if (!defined $sth) { die("Cannot do insert statement in $function_name: $DBI::errstr\n") } $sth->execute(undef, $client{'dns'}, $service, $detected, $received, $type, $source_type, $source, $target_proto, $target_port, $attack_scale, $note, $priority, $timeout, $valid);