mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 09:20:10 +00:00
Fixed #4737 integration with fail2ban
This commit is contained in:
parent
8eb29b3716
commit
e94f2cb0b4
18 changed files with 151 additions and 20 deletions
|
|
@ -52,9 +52,14 @@ local script = {
|
|||
function script.hooks.min(params)
|
||||
local sf = host.getSynScan()
|
||||
local value = sf["hits.syn_scan_attacker"] or 0
|
||||
local attacker = nil
|
||||
|
||||
if value ~= 0 then
|
||||
attacker = params.alert_entity.alert_entity_val
|
||||
end
|
||||
|
||||
-- Check if the configured threshold is crossed by the value and possibly trigger an alert
|
||||
alerts_api.checkThresholdAlert(params, alert_consts.alert_types.alert_tcp_syn_scan, value)
|
||||
alerts_api.checkThresholdAlert(params, alert_consts.alert_types.alert_tcp_syn_scan, value, attacker)
|
||||
end
|
||||
|
||||
-- #################################################################
|
||||
|
|
|
|||
|
|
@ -53,9 +53,14 @@ local script = {
|
|||
function script.hooks.min(params)
|
||||
local sf = host.getSynScan()
|
||||
local value = sf["hits.syn_scan_victim"] or 0
|
||||
local victim = nil
|
||||
|
||||
if value ~= 0 then
|
||||
victim = params.alert_entity.alert_entity_val
|
||||
end
|
||||
|
||||
-- Check if the configured threshold is crossed by the value and possibly trigger an alert
|
||||
alerts_api.checkThresholdAlert(params, alert_consts.alert_types.alert_tcp_syn_scan, value)
|
||||
alerts_api.checkThresholdAlert(params, alert_consts.alert_types.alert_tcp_syn_scan, value, nil, victim)
|
||||
end
|
||||
|
||||
-- #################################################################
|
||||
|
|
|
|||
|
|
@ -49,9 +49,14 @@ local script = {
|
|||
-- Defines an hook which is executed every minute
|
||||
function script.hooks.min(params)
|
||||
local value = params.entity_info["hits.syn_scan_victim"] or 0
|
||||
local victim = nil
|
||||
|
||||
if value ~= 0 then
|
||||
victim = params.alert_entity.alert_entity_val
|
||||
end
|
||||
|
||||
-- Check if the configured threshold is crossed by the value and possibly trigger an alert
|
||||
alerts_api.checkThresholdAlert(params, alert_consts.alert_types.alert_tcp_syn_scan, value)
|
||||
alerts_api.checkThresholdAlert(params, alert_consts.alert_types.alert_tcp_syn_scan, value, nil, victim)
|
||||
end
|
||||
|
||||
-- #################################################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue