Fixed #4737 integration with fail2ban

This commit is contained in:
Matteo Biscosi 2020-12-30 11:44:36 +01:00
parent 8eb29b3716
commit e94f2cb0b4
18 changed files with 151 additions and 20 deletions

View file

@ -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
-- #################################################################

View file

@ -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
-- #################################################################

View file

@ -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
-- #################################################################