Fixes risk not shown in generated flow-risk alerts

Fixes #4594
This commit is contained in:
Simone Mainardi 2020-10-19 11:10:19 +02:00
parent 5c8e247723
commit 27c1318ab6
5 changed files with 15 additions and 8 deletions

View file

@ -14,16 +14,17 @@ local handler = {}
-- @brief Called by flow_risks.lua when a risk for the flow is detected.
-- flow_risks.lua also passes flow-, client- and server-score as parameters
-- @param risk_id Integer nDPI flow risk identifier
-- @param flow_score An integer score that will be added to the total flow score
-- @param cli_score An integer score that will be added to the client score
-- @param srv_score An integer score that will be added to the server score
function handler.handle_risk(flow_score, cli_score, srv_score)
function handler.handle_risk(risk_id, flow_score, cli_score, srv_score)
-- Set a flow status for the generic flow_risk. This will also
-- cause an alert to be generated.
flow.triggerStatus(
flow_consts.status_types.status_flow_risk.create(
flow_consts.status_types.status_flow_risk.alert_severity,
flow.getInfo()
risk_id
),
flow_score or 0, -- flow_score
cli_score or 0, -- cli_score