Rework alert serialization. Change alert info format (info for all triggered alerts are now generated)

This commit is contained in:
Alfredo Cardigliano 2024-12-10 13:27:57 +01:00
parent 88e17d53d8
commit d8d7330f11
9 changed files with 134 additions and 123 deletions

View file

@ -360,10 +360,9 @@ end
-- Return a risk info (raw text, do not return a formatted value)
function alert_utils.get_flow_risk_info(alert_risk, alert_json)
if (alert_json) and (alert_json.alert_generation) and (alert_json.alert_generation.flow_risk_info) then
local flow_risk_info = json.decode(alert_json.alert_generation.flow_risk_info)
if (flow_risk_info) and (flow_risk_info[tostring(alert_risk)]) then
return flow_risk_info[tostring(alert_risk)]
if alert_json and alert_json.flow_risk_info then
if alert_json.flow_risk_info[tostring(alert_risk)] then
return alert_json.flow_risk_info[tostring(alert_risk)]
end
end