Chapter 24: Threshold Rules

Overview

The objective of the threshold rules feature is to provide a means of reacting to abnormal flow activity. An example of such activity might be an internal host becoming infected with a virus so that it repeatedly opens new flows to external IP addresses.

Alternatively, an external network device might try to open excessive numbers of flows to some protected resource. (A "flow" in this context refers to any type of connections, such as TCP, UDP or ICMP, which is being tracked by the system's state-engine).

Threshold Rule Object Structure

The object structure used with threshold rules is as follows:

ThresholdRule Properties

A ThresholdRule object is a child of the single predefined ThresholdRules object and has the properties listed below to filter the targeted traffic:

This filtering combination of source/destination network/interface and service is common to other rules, such as IPRule objects.

ThresholdSet Properties

A ThresholdSet object is a child of a ThresholdRule object and has the following key properties:

ThresholdDefinition Properties

One or more ThresholdDefinition objects are children of a ThresholdSet object and the threshold limit(s) that must be triggered before the parent ThresholdSet action is applied.

The key properties for this object are the following:

[Note] Note: Limit can optionally have a unit specified

The property Limit can optionally be specified with a unit of measurement. Any of the following unit notations can be used:

  • K - Thousands (examples: 2K, 2.5K, 900K)
  • M - Millions (examples: 5M, 2.25M).
  • G - Billions (examples: 3G, 4.125G).

As shown in the above examples, the numeric value used can be integer or decimal. Also, different units cannot be mixed in a single value.

[Note] Note: Time values must be specified with a unit notation

Both the above time properties Interval and Duration must be specified with their units of measurement, unless the value is zero. Any of the following unit notations can be used:

  • s - Seconds (examples: 2s, 2.5s, 1000s)
  • m - Minutes (examples: 5m, 2.25m).
  • h - Hours (examples: 3h, 4.125h).
  • d - Days (examples: 1d, 3.5d). This can only be used with Duration.

As shown in the above examples, the numeric value used can be integer or decimal. Also, different units cannot be mixed in a single time value.

Triggering Multiple Actions

If one or more ThresholdSet objects trigger at the same time then the following rules apply to decide which action has priority:

Example 24.1. Creating a Threshold Rule

This example creates threshold rules that are applied to HTTP traffic passing between the if1 and if2 interface. Once the number of concurrent flows reaches 1000, subsequent new flows will be dropped.

Command-Line Interface

Change the current CLI context to be the threshold rule set:

System:/> cc ThresholdRules
System:/ThresholdRules> 

Add a new ThresholdRule object:

System:/ThresholdRules> add ThresholdRule
			SourceNetwork=if1_net
			SourceInterface=if1
			DestinationNetwork=if2_net
			DestinationInterface=if2
			Service=http
			Name=my_rule

Change the CLI context to be the new ThresholdRule object:

System:/ThresholdRules> cc ThresholdRule my_rule

Note that the object could have been referred to by its name my_rule or its position in the set of rules, as shown below:

System:/ThresholdRules> cc ThresholdRule 1

Add a new ThresholdSet object:

System:/ThresholdRules/ThresholdRule/1(my_rule)> add ThresholdSet
			Action=Drop
			Name=my_set

Change the CLI context to be the new ThresholdSet object:

System:/ThresholdRules/ThresholdRule/1(my_rule)> cc ThresholdSet my_set

Add a new ThresholdDefinition object:

System:/ThresholdRules/ThresholdRule/1(my_rule)/ThresholdSet/1(my_set)> 
			add ThresholdDefinition
			Type=ConcurrentFlows
			Limit=1000
			Name=my_def

To return to the parent CLI context use the cc.. command:

System:/ThresholdRules/ThresholdRule/1(my_rule)/ThresholdSet/1(my_set)> 
			cc..
System:/ThresholdRules/ThresholdRule/1(my_rule)> 

To return to the default top-level CLI context use the cc command:

System:/ThresholdRules/ThresholdRule/1(my_rule)/ThresholdSet/1(my_set)> cc
System:/> 

Advanced Settings for Threshold Rules

The threshold rules subsystem has the following associated global setting which is a property of the MiscSettings object: