Site icon FastNetMon DDoS Detection Tool

Flexible thresholds

In addition to wide range of static thresholds FastNetMon offers capability to create completely custom thresholds using almost all fields available in L3 and L4 OSI model layers. Flexible dashboards can be used for both per_host and total hostgroups.

To enable this logic you will need to set following flag:

sudo fcli set main flexible_thresholds true

Then you will need to create up to 16 traffic rules using following fields:

Create new traffic rule:

sudo fcli set traffic_rule new_rule

You may find example configuration below:

sudo fcli set traffic_rule dns protocols udp
sudo fcli set traffic_rule dns active true
sudo fcli set traffic_rule dns source_ports 53
sudo fcli commit

To list all available traffic rules you can use following command:

sudo fcli show traffic_rule

If you configured everything correctly you will be able to see byte and packet counters from fcli:

sudo fcli show single_host_counters 1.2.3.4
dns_in_bytes             0
dns_in_packets           0
dns_out_bytes            0
dns_out_packets          0

In addition to command line you can use following pre-defined dashboards for InfluxDB:

To use these dashboards you will need to enable following metrics:

sudo fcli set main influxdb_push_host_ipv4_flexible_counters true
sudo fcli set main influxdb_push_host_ipv6_flexible_counters true

Please not that flexible metrics export to Clickhouse is not supported yet. You can fill feature request for it.

To enable flexible thresholds for specific hostgroup you need to assign it to specific hostgroup this way:

sudo fcli set hostgroup flex flexible_thresholds dns

After that, you need to set threshold values (please adjust value to be relevant for your specific network) for traffic rule with same name:

sudo fcli set hostgroup flex flexible_thresholds dns active true

sudo fcli set hostgroup flex flexible_thresholds dns incoming_mbits_enable false
sudo fcli set hostgroup flex flexible_thresholds dns incoming_mbits_value 100000

sudo fcli set hostgroup flex flexible_thresholds dns incoming_packets_enable false
sudo fcli set hostgroup flex flexible_thresholds dns incoming_packets_value 100000

sudo fcli set hostgroup flex flexible_thresholds dns outgoing_mbits_enable false
sudo fcli set hostgroup flex flexible_thresholds dns outgoing_mbits_value 100000

sudo fcli set hostgroup flex flexible_thresholds dns outgoing_packets_enable false
sudo fcli set hostgroup flex flexible_thresholds dns outgoing_packets_value 100000

sudo fcli commit

Flexible thresholds may work with both per_direction_hostgroup_thresholds enabled or disabled but you must explicitly set enable_ban_incoming or enable_ban_outgoing on hostgroups basis to enable flexible thresholds for them.

It can be done that way:

sudo fcli set hostgroup <hostgroup_name> enable_ban_incoming true
sudo fcli set hostgroup <hostgroup_name> enable_ban_outgoing true
sudo fcli commit

After FastNetMon detects an attack using any of these thresholds it will trigger standard actions exactly as for static thresholds (email alert, BGP, Grafana notification). In callback script you will see addition information which explains which threshold was triggered.

For all attacks triggered via flexible thresholds FastNetMon will add current values of all flexible counters for affected host during attack time to email reports:

Incoming tcp_ack traffic: 27 mbps
Outgoing tcp_ack traffic: 0 mbps
Incoming tcp_ack pps: 2283 packets per second
Outgoing tcp_ack pps: 1087 packets per second
Exit mobile version