Fixes Host/Flow anomaly description

Implements #5337
Implements #5333
This commit is contained in:
Matteo Biscosi 2021-05-17 14:52:17 +02:00
parent c3dfe67eb5
commit fdf8fbadb8
9 changed files with 31 additions and 20 deletions

View file

@ -48,11 +48,14 @@ end
function host_alert_flow_anomaly.format(ifid, alert, alert_type_params)
local alert_consts = require("alert_consts")
local json = json.decode(alert.json)
local is_client_alert = json.is_client_alert
local is_both = alert_type_params["is_both"]
local is_client_alert = alert_type_params["is_client_alert"]
local role
local host = alert_consts.formatHostAlert(ifid, alert["ip"], alert["vlan_id"])
if(is_client_alert) then
if(is_both) then
role = "client and server"
elseif(is_client_alert) then
role = "client"
else
role = "server"

View file

@ -47,12 +47,14 @@ end
-- @return A human-readable string
function host_alert_score_anomaly.format(ifid, alert, alert_type_params)
local alert_consts = require("alert_consts")
local json = json.decode(alert.json)
local is_client_alert = json.is_client_alert
local is_client_alert = alert_type_params["is_client_alert"]
local is_both = alert_type_params["is_both"]
local role
local host = alert_consts.formatHostAlert(ifid, alert["ip"], alert["vlan_id"])
if(is_client_alert) then
if(is_both) then
role = "client and server"
elseif(is_client_alert) then
role = "client"
else
role = "server"