Implements #4919 custom alert severity

This commit is contained in:
Matteo Biscosi 2021-01-27 12:01:52 +01:00
parent 89b21df6f6
commit 10fb8bbecc
64 changed files with 317 additions and 49 deletions

View file

@ -19,6 +19,13 @@ local script = {
l4_proto = "udp",
-- This script is only for alerts generation
is_alert = true,
default_value = {
severity = alert_severities.notice,
},
-- NOTE: hooks defined below
hooks = {},
@ -48,13 +55,13 @@ end
-- #################################################################
function script.hooks.all(now)
function script.hooks.all(now, conf)
if((flow.getPacketsRcvd() == 0) and (flow.getPacketsSent() > 0)) then
-- Now check if the recipient isn't a broadcast/multicast address
if not flow.isClientNoIP() and flow.isServerUnicast() and not unidirectionalProtoWhitelist(flow.getnDPIAppProtoId()) then
local alert = alert_consts.alert_types.alert_udp_unidirectional.new()
alert:set_severity(alert_severities.notice)
alert:set_severity(conf.severity)
alert:trigger_status(5, 1, 5)
end