Add ability to separate bans and attack details collection
This commit is contained in:
parent
7f5b49d10f
commit
81404769c2
|
@ -2504,7 +2504,7 @@ void execute_ip_ban(uint32_t client_ip, map_element speed_element, unsigned int
|
|||
print_attack_details_to_file(full_attack_description, client_ip_as_string, current_attack);
|
||||
|
||||
if (file_exists(notify_script_path)) {
|
||||
string script_call_params = notify_script_path + " " + client_ip_as_string + " " + data_direction_as_string + " " + pps_as_string + " ban";
|
||||
string script_call_params = notify_script_path + " " + client_ip_as_string + " " + data_direction_as_string + " " + pps_as_string + " attack_details";
|
||||
logger<<log4cpp::Priority::INFO<<"Call script for ban client: "<<client_ip_as_string;
|
||||
|
||||
// We should execute external script in separate thread because any lag in this code will be very distructive
|
||||
|
|
|
@ -23,3 +23,7 @@ if [ "$4" = "ban" ]; then
|
|||
# iptables -A INPUT -d $1 -j DROP
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$4" == "attack_details" ]; then
|
||||
cat | mail -s "FastNetMon Guard: IP $1 blocked because $2 attack with power $3 pps" $email_notify;
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue