Implemented skeleton of CustomFlowLuaScriptAlert check

This commit is contained in:
Luca Deri 2022-11-19 20:31:24 +01:00
parent 5f7bc4c542
commit 80db634bfe
15 changed files with 268 additions and 27 deletions

View file

@ -93,7 +93,8 @@ local flow_alert_keys = {
flow_alert_ndpi_http_obsolete_server = 84,
flow_alert_ndpi_risky_asn = 85,
flow_alert_ndpi_risky_domain = 86,
flow_alert_custom_lua_script = 87,
-- NOTE: for flow alerts not not go beyond the size of Bitmap alert_map inside Flow.h (currently 128)
}

View file

@ -0,0 +1,27 @@
--
-- (C) 2019-22 - ntop.org
--
local checks = require("checks")
local flow_consts = require("flow_consts")
local alerts_api = require "alerts_api"
local alert_consts = require("alert_consts")
local flow_alert_keys = require "flow_alert_keys"
-- #################################################################
local script = {
-- Script category
category = checks.check_categories.security,
alert_id = flow_alert_keys.flow_alert_custom_lua_script,
gui = {
i18n_title = "flow_checks_config.custom_lua_script",
i18n_description = "flow_checks_config.custom_lua_script_description",
}
}
-- #################################################################
return script

View file

@ -43,7 +43,9 @@ function multi_threshold_cross:describeConfig(hooks_conf)
local msg = ''
for field, value in pairs(configured_threshold) do
msg = msg .. i18n(field) .. ": " .. value.threshold .. "%, "
if(value.threshold ~= nil) then
msg = msg .. i18n(field) .. ": " .. value.threshold .. "%, "
end
end
return msg