ON THIS PAGE
IDP Signature Language Constructs
IDP Signature language constructs enable IDP to create efficient signatures, reducing false positives. The Signature Language achieves this by defining attack patterns with rule-based syntax, contexts, and match conditions.
The IDP Signature Language Constructs within Junos OS offer advanced capabilities for enhancing network security through the precise definition of security signatures. These constructs enable you to specify detailed traffic patterns, set alert conditions, and incorporate contextual information, thus improving the accuracy and relevance of threat detection. By leveraging these constructs, you gain fine-grained control over security management, enabling tailored responses to specific network environments.
Benefits
-
Enhance threat detection accuracy by allowing precise definition of traffic patterns and alert conditions, reducing false positives and negatives.
-
Improve security management flexibility by enabling the integration of contextual information, aiding in the differentiation between legitimate and malicious activities.
-
Provide tailored security responses by allowing network administrators to specify detailed monitoring criteria suited to their specific network environment.
-
Facilitate efficient threat mitigation through advanced customization options, enabling the creation of sophisticated security signatures.
-
Support proactive security measures by enabling early detection of anomalous traffic patterns, helping to prevent potential security breaches.
Constructs
Following are the signature language constructs supported in IDP:
-
Depth—Specifies the depth in a packet to search for the given pattern. The depth value is not relative. For example, you can specify the depth as 100.
<Depth>100</Depth>
-
Offset—Allows you to specify where to start searching for a pattern within a packet. The offset value is not relative. For example, you can specify a value for offset as 100.
<Offset>100</Offset>
-
Within—Ensures that a maximum of N bytes exist between pattern matches. The pattern match is always relative to a previous match. For example, if the value of N is 10.
As per the example, after m01 match, m02 match occurs within 10 bytes to trigger an attack notification.<Attack> <Member>m01</Member> - - - - - - </Attack> <Attack> <Member>m02</Member> - - - - - - <Within>10</Within> - - - - - - </Attack>
-
Distance—Specify where the IDP engine searches for the pattern relative to the previous pattern. The distance can be negative. For example, if the value of N is 10, once m01 matches, m02 should occur 10 bytes following the end of m01 match:
<Attack> <Member>m01</Member> - - - - - - </Attack> <Attack> <Member>m02</Member> - - - - - - <Distance>10</Distance> - - - - - - </Attack>
-
Ipopts—All the listed ipopts have corresponding anomalies defined in the security package and can be detected when configured on the device or IDP engine:
-
rr - Record Route
-
eol - End of list
-
nop - No Op
-
ts - Time Stamp
-
sec - IP Security
-
esec - IP Extended Security
-
lsrr - Loose Source Routing
-
ssrr - Strict Source Routing
-
satid - Stream identifier
-
-
Byte extract—The Byte extract keyword helps in writing signatures against length-encoded protocols,reads the packet payload in bytes and saves it as a variable for later use. The byte extract can be both relative and non-relative. There can be any number of byte extracts used per chain attack. For example:
<Byte_Extract> <Byte>4</Byte> <Offset>12</Offset> <Relative>True</Relative> <Endian>Big</Endian> <Bitmask>0x45</Bitmask> <Multiplier>2</Multiplier> <String>dec</String> <align>True</align> <Name>msg_len</align> </Byte_Extract>
IDP Signature Language Constructs lists the fields for the
Byte extractconstruct.Table 1: Byte Extract Output Fields Field
Field Description
alignSpecify the byte alignment.
bitmaskSpecify the bitmask (1-4 bytes) for AND operation in hexadecimal format.
bytesSpecify the number of bytes to extract from packet (1..10).
endiannessSpecify the endianness with which the bytes read by the IDP engine should be processed.
multiplierSpecify the value to be multiplied against the bytes read.
offsetSpecify the offset number of bytes in the payload from where the IDP engine should start processing.
relativeSpecify whether to use an offset relative to last pattern match or not.
stringSpecify the data type in which string data should be parsed.
var-nameSpecify the name of the variable to reference in other rule options.
-
Byte test—The Byte test keyword allows you to test the byte field with an operative value. The byte test can be both relative and non relative.
> , < , =, &, ^ ,<=,>=are the supported operators. The maximum number of bytes extracted is 4. For example:M02 <SLE_Constructs> <Within>50</Within> <Byte_Test> <Byte>4</Byte> <Operator>=</Operator> <Offset>12</Offset> <Value>12</Value> <Relative>True</Relative> <Endian>Big</Endian> <Bitmask>0x45</Bitmask> <String>dec</String> <align>True</align> </Byte_Test>
IDP Signature Language Constructs lists the fields for the
Byte testconstruct.Table 2: Byte Test Output Field
Field Description
bitmaskSpecify the bitmask (1-4 bytes) for AND operation in hexadecimal format.
bytesSpecify the number of bytes to extract from packet (1..10).
endiannessSpecify the endianness with which the bytes read by the IDP engine should be processed.
negateCheck if the operator is not true.
offsetMention the offset variable name or offset value.
operatorSpecify the operation to perform on an extracted value.
relativeSpecify whether to use an offset relative to last pattern match or not.
rvalueThe converted value is tested with rvalue. .
stringSpecify the data type in which string data should be parsed.
-
Byte jump—The Byte jump keyword is used for signatures written for length encoded protocols to skip over specific portions of payload, and perform detection in very specific locations. The byte jump value can be both relative and non-relative. For example:
<Byte_jump> <Byte>2</Byte> <Offset>8</Offset> <Relative>true</Relative> <Multiplier>2</Multiplier> <From_beginning>true</From_beginning> Endianess>little</Endianess> </Byte_jump>
IDP Signature Language Constructs lists the fields for the
Byte jumpconstruct.Table 3: Byte Jump Output Field
Field Description
alignSpecify the endianness with which bytes read by the IDP engine should be processed.
bitmaskSpecify the bitmask (1-4 bytes) for AND operation in hexadecimal format.
bytesSpecify the number of bytes to extract from packet (1-10).
endiannessSpecify the endianness with which bytes read by the IDP engine, should be processed.
from-beginningEnable jump from the beginning of the payload.
from-endEnable jump from the end of the payload.
multiplierSpecify the value to be multiplied against the bytes read.
offsetMention the offset variable name or offset value to be used.
post-offsetSpecify the number of bytes to skip forward or backward (-65535..65535).
relativeSpecify whether to use an offset relative to last pattern match or not.
stringSpecify the data type in which string data should be parsed.
-
Byte math—The Byte math keyword allows you to perform a mathematical operation on an extracted value, a specified value, or existing variable. The byte math value stores the outcome in a new resulting variable. The operations such as
1) '+' | '-' | '*' | '/' | '<<' | '>>'are supported. It can be both relative and non-relative. For example:<SLE_Constructs> <Byte_Math> <Byte>4</Byte> <Operator>+</Operator> <Offset>12</Offset> <rValue>12</rValue> <Relative>True</Relative> <Endian>Big</Endian> <Bitmask>0x45</Bitmask> <String>dec</String> <align>True</align> <result_var>var1</result_var> </Byte_Math> <SLE_Constructs>IDP Signature Language Constructs lists the fields for the
Byte mathconstruct.Table 4: Byte Math Output Field
Field Description
bitmaskSpecify the bitmask (1-4 bytes) for AND operation in hexadecimal format.
bytesSpecify the number of bytes to extract from packet (1-10).
endiannessSpecify the endianness with which bytes read should be processed.
offsetSpecify the number of bytes in to payload to start processing (0-65535).
operatorSpecify the operation to perform on extracted value.
relativeSpecify whether to use an offset relative to last pattern match or not.
resultSpecify the variable name to which the result should be stored.
rvalueSpecify the value to use for the specific mathematical operation.
stringSpecify the data type in which the string data should be parsed.
-
Is-data-at— The is-data-at keyword allows you to verify that the payload contains the required data at a specified location. For example:
M02 <SLE_Constructs> <Isdataat> <Value>50</Value> <negate>false</negate> </Isdataat> <SLE_Constructs>IDP Signature Language Constructs lists the fields for the
Is-data-atconstruct.Table 5: Isdataat Output Field
Field Description
negateNegates the results of the is-data-at test.
offsetMention the offset variable name or offset value.
relativeSpecify whether to use an offset relative to the last pattern match or not.
-
Detection Filter— The detection filter defines the rate at which the attack should match. A count is maintained for either source or destination as per the option value specified in the signature. Detection filter is outside
<SLE_Constructs>and is specified per attack and not per member of attack. If an attack is detected 5 times in an interval of 10 seconds from the same source IP, it will be flagged as an attack. For example:<Detection_filter> <count>5</count> <scope>src</scope> other options dst/session <time>10</time> </Detection_filter>