Modified flow scripts in view of the new trigger_status (#4710)

* Modified blacklisted script in view of the new flow_script API

* Modified plugins scripting in view of the new API

* Modified flow scripts with the new trigger API

* Fixed creators severity

Co-authored-by: matteo <biscosi@ntop.org>
This commit is contained in:
Matteo Biscosi 2020-11-12 13:52:53 +01:00 committed by GitHub
parent 283bd7179c
commit 0e341f3d0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 146 additions and 209 deletions

View file

@ -4,6 +4,8 @@
local flow_consts = require("flow_consts")
local user_scripts = require("user_scripts")
local alerts_api = require "alerts_api"
local alert_consts = require("alert_consts")
-- #################################################################
@ -24,13 +26,9 @@ local script = {
function script.hooks.protocolDetected(now)
if(flow.getnDPICategoryName() == "Mining") then
flow.triggerStatus(
flow_consts.status_types.status_web_mining_detected.create(
flow_consts.status_types.status_web_mining_detected.alert_severity
),
50 --[[ flow score]],
50 --[[ cli score ]],
10 --[[ srv score ]])
local web_mining_detected_type = flow_consts.status_types.status_web_mining_detected.create()
alerts_api.trigger_status(web_mining_detected_type, alert_consts.alert_severities.error, 50, 10, 50)
end
end