All of the Cisco IDS signatures are specified in textual form in two different configuration files. One configuration file contains the definition for all the system-defined signatures. This configuration file is shipped with Cisco IDS. There is also another user configuration file. This file contains the definitions for all the custom user-defined signatures, as well as any tuning changes that you have applied to the system signatures.
The valid parameters for a signature are divided into parameters that are valid for all signatures (known as Master Parameters) and other parameters that are valid only for specific signature engines (known as Engine Specific Parameters). Several engine-specific parameters have been covered in the descriptions for the different types of signature engines (for a complete listing of the engine specific parameters refer to "Cisco Intrusion Detection System Signature Engines Version 3.0"). The Master Parameters will be covered in the following section.
Each signature for every signature engine shares the following master parameters:
- SIGID and SubSig
When creating any custom signatures, you need to know how to configure these parameters so that your signatures will operate correctly and reduce their overall impact on the operation of your Cisco IDS.
The AlarmThrottle is actually composed of four different values that affect that number of alarms generated by a specific signature. By correctly configuring this parameter, you can reduce the ability of an attacker to consume the resources of your IDS by flooding it with attacks. The values that you can specify for the AlarmThrottle parameter are as follows:
AlarmThrottle FireOnce enables you to create signatures that will only trigger one time for a specific set of addresses. After firing once, the signature will not fire on that same set of addresses until a preset period of time has expired.
Configuring a signature with the AlarmThrottle FireAll causes the Cisco IDS to trigger an alarm for all activity that matches the signature's characteristics. This is effectively the opposite of configuring a signature to fire only once using the AlarmThrottle FireOnce parameter.
You also have two summarization options. Whenever you specify a summarization option, you will receive one normal alarm at the beginning of the summarization period and one SUMMARY alarm per ThrottleInterval for as long as the summarization remains valid. The summarization remains valid until a defined quiescent period has elapsed. Furthermore, the purpose of summarization options is to reduce the processing impact on the IDS by reducing the number of alarms that it needs to manage, thereby making it more difficult for an attacker to perform a DoS attack with multiple alarms.
When using alarm summarization, the first instance of the intrusive activity triggers a normal alarm. Then, other instances of the same alarm (between the same address combination) are counted up until the end of the signature's ThrottleInterval. At the end of the signature's ThrottleInterval a SUMMARY alarm is sent, indicating the count of alarms that occurred during the ThrottleInterval. The difference between the two different summarization modes is that AlarmThrottle GlobalSummarize consolidates all address combinations instead of consolidating only a single address pair. As long as the summary mode remains active, Cisco IDS generates only one SUMMARY alarm per ThrottleInterval for the specific signature.
In conjunction with the basic alarm processing modes, you can also specify signatures to operate in one of the following three modes of operation:
- Variable summary mode
- Limited summary mode
- Sliding window interval mode
The variable summary modes are controlled by the ChokeThreshold parameter. This parameter enables you to configure a signature to automatically switch between AlarmThrottle modes, based on the number of alarms detected per throttle interval for a specific signature.
To use the ChokeThreshold, you start by configuring a value for the ChokeThreshold (a value of ANY disables variable summary mode). Then you assign to the signature one of the AlarmThrottle modes (FireAll, Summarize, or GlobalSummarize). When the rate of alarms generated exceeds the ChokeThreshold rate, the signature automatically switches to the next higher summarization mode. If you start with AlarmThrottle FireAll, then after ChokeThreshold alarms are detected in one throttle interval, the mode switches to AlarmThrottle Summarize. If the number of alarms detected exceeds twice the ChokeThreshold rate, the mode switches to AlarmThrottle GlobalSummarize. Summarization remains in effect until the end of the throttle interval, at which time the signature reverts back to its original summarization technique (normally FireAll).
Limited summary mode is controlled by the LimitSummary parameter. To enable this parameter, you specify a value of TRUE. Basically, this parameter disables the FireOnce and Summarize AlarmThottle modes, which forces the signature to use either FireAll or GlobalSummarize. You normally configure the LimitSummary option on signatures that do not store state information, such as Atomic signatures. You can still use the variable summary with these alarms, but they will only cycle between FireAll and GlobalSummarize.
The final signature mode that you can utilize uses a Sliding Window Mode. All the other modes are based on a fixed window (ThrottleInterval) for determining alarm counts. This window counts only the alarms detected in each throttle interval time slot, and each new interval starts at the end of the previous interval (there is no overlap). For some signatures, you may want a higher degree of fidelity. You may want to know if a certain number of alarms occur within a defined window, regardless of where the window starts in the alarm stream. To determine this information, the window for counting alarms needs to move or slide as time progresses.
To define an alarm to use a sliding window interval, you need to use the AlarmInterval parameter to define your window size and the MinHits parameter to set the minimum number of alarms that must occur within the window to trigger the alarm. When using the Sliding Window Mode, Cisco IDS essentially creates another new window each time it sees an alarm. If any of these windows exceeds the MinHits value before its AlarmInterval has expired, then an alarm is triggered. Additionally, to use the AlarmInterval parameter, your signature definition is constrained by the following requirements:
- You must specify a MinHits value greater than or equal to 2.
- You must set your ChokeThreshold to ANY.
- Your AlarmThrottle must be set to FireAll.
When an alarm is fired, the destination address is usually the victim, and the source address is usually the attacker. This information is stored into an alarm record. The source address of the alarm record is treated as the attacker. In some instances, however, the situation is actually reversed, and the destination of the packet is actually the attacker. This occurs when the Cisco IDS is triggering on return traffic from the host being attacked. In these cases, you can use the FlipAddr parameter to reverse the addresses so that the source address of the alarm becomes the actual attacker, instead of the host being attacked.
Sometimes, you do not want a specific signature to generate an alarm unless the signature fires multiple times. You can use the MinHits parameter to define the minimum number of occurrences of a signature that must be detected before an alarm is generated. This can be especially useful when you are looking for specific string signatures, such as Login incorrect. By placing a minimum threshold, you can reduce your number of false positives significantly.
The SigComment parameter simply enables you to supply descriptive information about the signature. The information, however, is not included in the actual alarm message, but it can be used to document the signatures in the user configuration file.
SIGID and SubSig
For each signature, the combination of the SignatureID and the SubSignatureID must be unique. You use the SIGID and SubSig parameters to identify your custom signatures (system signatures are also identified with these parameters). SIGID parameters in the range of 20,000—50,000 are reserved for your custom alarm signatures. It is recommended, however, that you do not use the SubSig parameter in your custom signatures.
The SigStringInfo parameter enables you define textual information that appears in the actual alarm message. Using this field, you can provide some descriptive information to the alarms generated. This descriptive information is easier to understand than remembering what SIGID XXXX means.
The ThrottleInterval parameter is used in conjunction with the AlarmThrottle parameters. It defines the length of time, in seconds, over which certain events must occur.
You use the WantFrag parameter to specify whether a signature examines fragmented packets when checking for traffic that matches the signature's characteristics. You control how a signature treats fragmented packets via three different keywords: TRUE, FALSE, and ANY. TRUE is used to inspect only fragmented IP packets or packets that were reassembled when determining whether a specific signature needs to fire. The FALSE option causes the signature to only inspect packets that are not fragmented when determining whether the signature should fire. Finally, the ANY option informs the signature engine to examine all packets for the given signature when determining whether it should fire.
Understanding how to create custom signatures is probably best covered through some actual examples. Once you create a couple of your own signatures, adding other custom signatures becomes easier and easier.
The first sample signature that we will examine is based on the ATOMIC.ICMP signature engine:
Engine ATOMIC.ICMP 30000 IcmpType 0 IcmpSeq 11 AlarmThrottle _____GlobalSummarize ThrottleInterval 5
This signature generates a regular alarm when an ICMP packet with an ICMP header sequence value of 11 is detected on the network. Then, at the end of the ThrottleInterval (five seconds for this example), a SUMMARY alarm is generated, indicating the total number of times that the signature fired during this interval period. Summary alarms continue to be generated (one every five seconds) as long as summarization is active. Summarization remains active until no traffic matching this signature is seen for five seconds (the length of the ThrottleInterval).
Our next example is a slightly more complicated example based on the ATOMIC.L3.IP signature engine:
Engine ATOMIC.L3.IP SIGID 40000 IpProto 6 _____RecordOfInternalAddress 184.108.40.206 255.255.255.0 _____RecordOfExcludedPattern 40000 * * * _____RecordOfIncludedPattern 40000 * 10.2.1/24 IN
This example demonstrates a signature that triggers when a TCP packet (IP Protocol 6) is sent from the 10.2.1.0 network to your protected network (220.127.116.11). This signature uses the RecordOfExcludedPattern, the RecordOfIncludedPattern, and the RecordOfInternalAddress parameters to define the appropriate addresses that this signature should apply to. The RecordOfInternalAddress parameter defines your internal network address space. The RecordOfExcludedPattern and RecordOfIncludedPattern parameters both accept four fields: SIGID, SubsigID, Source Address, and Destination Address. The RecordOfExcludedPattern line excludes all address combinations from firing on SIGID 40000 (with any SubsigID). Then, the RecordOfIncludedPattern includes the following address combinations for SIGID 40000 (with any SubsigID):
- Source Address—Any address on class C network 10.2.1.0.
- Destination Address—The IN keyword specifies any internal address.
Our last sample signature demonstrates how you can configure a custom signature to watch for a flood of specific packets on your network. To create a signature to detect a flood of traffic on your network first requires you to determine the amount of traffic that occurs during routine network operations. Normally, it is difficult to obtain this information because it varies from network to network. Therefore, you can run a FLOOD signature in diagnostic mode to actually monitor the amount of traffic on your network, and report this information in alarm messages.
Suppose you want to determine the normal amount of ICMP traffic on your network. You could use the following custom signature:
Engine FLOOD.NET SIGID 35000 IcmpType 0 Rate 0 Peaks 5 Gap 5
Using a rate of 0 places the signature in diagnostic mode. It monitors the network, and provides you with one alarm per ThrottleInterval, indicating the maximum packets-per-second during that interval. This information is presented in the alarm's details string.
After examining the alarms over a period of time, you can determine what the normal level of traffic is on your network. Then you can change the signature into an actual working signature by specifying a rate that indicates abnormal activity. Suppose your analysis indicates that your network normally has 10 ICMP packets/second. You can then create the following signature:
Engine FLOOD.NET SIGID 35000 IcmpType 0 Rate 50 Peaks 2 Gap 5
This signature fires if the number of ICMP packets on your network exceeds 50 ICMP packets/second for more than two seconds (the Peaks parameter) without a gap of five seconds (the Gap parameter).