Kaspersky Next XDR Expert

Standard correlation rules

Standard correlation rules are used to identify complex patterns in processed events.

The search for patterns is conducted by using buckets

Bucket is a data container that is used by the Correlation rule resources to determine if the correlation event should be created. It has the following functions:

  • Group together events that were matched by the filters in the Selectors group of settings of the Correlation rule resource. Events are grouped by the fields that were selected by user in the Identical fields field.
  • Determine the instance when the Correlation rule should trigger, affecting the events that are grouped in the bucket.
  • Perform the actions that are selected in the Actions group of settings.
  • Create correlation events.

Available states of the Bucket:

  • Empty—the bucket has no events. This can happen only when it was created by the correlation rule triggering.
  • Partial Match—the bucket has some of the expected events (recovery events are not counted).
  • Full Match—the bucket has all of the expected events (recovery events are not counted). When this condition is achieved:
    • The Correlation rule triggers
    • Events are cleared from the bucket
    • The trigger counter of the bucket is updated
    • The state of the bucket becomes Empty
  • False Match—this state of the Bucket is possible:
    • when the Full Match state was achieved but the join-filter returned false.
    • when Recovery check box was selected and the recovery events were received.

    When this condition is achieved the Correlation rule does not trigger. Events are cleared from the bucket, the trigger counter is updated, and the state of the bucket becomes Empty.

The correlation rule window contains the following tabs:

  • General—used to specify the main settings of the correlation rule. On this tab, you can select the type of correlation rule.
  • Selectors—used to define the conditions that the processed events must fulfill to trigger the correlation rule. Available settings vary based on the selected rule type.
  • Actions—used to set the triggers that will activate when the conditions configured in the Selectors settings block are fulfilled. The Correlation rule resource must have at least one trigger. Available settings vary based on the selected rule type.
  • Correlators—used for linking correlators. Available only for created correlation rules that are open for editing.

General tab

  • Name (required)—a unique name for this type of resource. Must contain 1 to 128 Unicode characters.
  • Tenant (required)—the tenant that owns the correlation rule.
  • Type (required)—a drop-down list for selecting the type of correlation rule. Select standard if you want to create a standard correlation rule.
  • Identical fields (required)—the event fields that should be grouped in a Bucket. The hash of the values of the selected fields is used as the Bucket key. If the selector (see below) triggers, the selected fields will be copied to the correlation event.

    If different selectors of the correlation rule use fields that have different values ​​in events, do not specify these fields in the Identical fields section.

  • Unique fields—event fields that should be sent to the Bucket. If this parameter is set, the Bucket will receive only unique events. The hash of the selected fields' values is used as the Bucket key.

    You can use local variables in the Identical fields and Unique fields sections. To access a variable, its name must be preceded with the "$" character.
    For an example of using local variables in these sections, refer to the rule provided with KUMA: R403_Access to malicious resources from a host with disabled protection or an out-of-date anti-virus database.

  • Rate limit—maximum number of times a correlation rule can be triggered per second. The default value is 100.

    If correlation rules employing complex logic for pattern detection are not triggered, this may be due to the specific method used to count rule triggers in KUMA. In this case, try to increase the value of Rate limit to 1000000, for example.

  • Window, sec (required)—bucket lifetime, in seconds. Default value: 86,400 seconds (24 hours). This timer starts when the Bucket is created (when it receives the first event). The lifetime is not updated, and when it runs out, the On timeout trigger from the Actions group of settings is activated and the bucket is deleted. The On every threshold and On subsequent thresholds triggers can be activated more than once during the lifetime of the bucket.
  • Base events keep policy—this drop-down list is used to specify which base events must be stored in the correlation event:
    • first (default value)—this option is used to store the first base event of the event collection that triggered creation of the correlation event.
    • last—this option is used to store the last base event of the event collection that triggered creation of the correlation event.
    • all—this option is used to store all base events of the event collection that triggered creation of the correlation event.
  • Priority—base coefficient used to determine the importance of a correlation rule. The default value is Low.
  • Order by—in this drop-down list, you can select the event field that will be used by the correlation rule selectors to track situational changes. This could be useful if you want to configure a correlation rule to be triggered when several types of events occur sequentially, for example.
  • Description—the description of a resource. Up to 4,000 Unicode characters.

Selectors tab

A rule of the standard kind can have multiple selectors. You can add selectors by clicking the Add selector button and can remove them by clicking the Delete selector button. Selectors can be moved by clicking the DragIcon button.

For each selector, the following two tabs are available: Settings and Local variables.

The Settings tab contains the following settings:

  • Alias (required)—unique name of the event group that meets the conditions of the selector. Must contain 1 to 128 Unicode characters.
  • Selector threshold (event count) (required)—the number of events that must be received by the selector to trigger. The default value is 1.
  • Filter (required)—used to set the criteria for determining events that should trigger the selector. You can select an existing filter from the drop-down list or create a new filter.

    Creating a filter in resources

    1. In the Filter drop-down list, select Create new.
    2. If you want to keep the filter as a separate resource, select the Save filter check box.

      In this case, you will be able to use the created filter in various services.

      This check box is cleared by default.

    3. If you selected the Save filter check box, enter a name for the created filter resource in the Name field. The name must contain 1 to 128 Unicode characters.
    4. In the Conditions settings block, specify the conditions that the events must meet:
      1. Click the Add condition button.
      2. In the Left operand and Right operand drop-down lists, specify the search parameters.

        Depending on the data source selected in the Right operand field, you may see fields of additional parameters that you need to use to define the value that will be passed to the filter. For example, when choosing active list you will need to specify the name of the active list, the entry key, and the entry key field.

      3. In the operator drop-down list, select the relevant operator.

        Filter operators

        • =—the left operand equals the right operand.
        • <—the left operand is less than the right operand.
        • <=—the left operand is less than or equal to the right operand.
        • >—the left operand is greater than the right operand.
        • >=—the left operand is greater than or equal to the right operand.
        • inSubnet—the left operand (IP address) is in the subnet of the right operand (subnet).
        • contains—the left operand contains values of the right operand.
        • startsWith—the left operand starts with one of the values of the right operand.
        • endsWith—the left operand ends with one of the values of the right operand.
        • match—the left operand matches the regular expression of the right operand. The RE2 regular expressions are used.
        • hasBit—checks whether the left operand (string or number) contains bits whose positions are listed in the right operand (in a constant or in a list).

          The value to be checked is converted to binary and processed right to left. Chars are checked whose index is specified as a constant or a list.

          If the value being checked is a string, then an attempt is made to convert it to integer and process it in the way described above. If the string cannot be converted to a number, the filter returns False.

        • hasVulnerability—checks whether the left operand contains an asset with the vulnerability and vulnerability severity specified in the right operand.

          If you do not specify the ID and severity of the vulnerability, the filter is triggered if the asset in the event being checked has any vulnerability.

        • inActiveList—this operator has only one operand. Its values are selected in the Key fields field and are compared with the entries in the active list selected from the Active List drop-down list.
        • inDictionary—checks whether the specified dictionary contains an entry defined by the key composed with the concatenated values of the selected event fields.
        • inCategory—the asset in the left operand is assigned at least one of the asset categories of the right operand.
        • inActiveDirectoryGroup—the Active Directory account in the left operand belongs to one of the Active Directory groups in the right operand.
        • TIDetect—this operator is used to find events using CyberTrace Threat Intelligence (TI) data. This operator can be used only on events that have completed enrichment with data from CyberTrace Threat Intelligence. In other words, it can only be used in collectors at the destination selection stage and in correlators.
        • inContextTable—presence of the entry in the specified context table.
        • intersect—presence in the left operand of the list items specified in the right operand.
      4. If necessary, select the do not match case check box. When this check box is selected, the operator ignores the case of the values.

        The selection of this check box does not apply to the InSubnet, InActiveList, InCategory or InActiveDirectoryGroup operators.

        This check box is cleared by default.

      5. If you want to add a negative condition, select If not from the If drop-down list.
      6. You can add multiple conditions or a group of conditions.
    5. If you have added multiple conditions or groups of conditions, choose a search condition (and, or, not) by clicking the AND button.
    6. If you want to add existing filters that are selected from the Select filter drop-down list, click the Add filter button.

      You can view the nested filter settings by clicking the edit-grey button.

    Filtering based on data from the Extra event field

    Conditions for filters based on data from the Extra event field:

    • Condition—If.
    • Left operand—event field.
    • In this event field, you can specify one of the following values:
      • Extra field.
      • Value from the Extra field in the following format:

        Extra.<field name>

        For example, Extra.app.

        A value of this type is specified manually.

      • Value from the array written to the Extra field in the following format:

        Extra.<field name>.<array element>

        For example, Extra.array.0.

        The values in the array are numbered starting from 0.

        A value of this type is specified manually.

        To work with a value from the Extra field at depth 3 and below, use backquotes ``. For example, `Extra.lev1.lev2.lev3`.

    • Operator – =.
    • Right operand—constant.
    • Value—the value by which you need to filter events.

    The order of conditions specified in the selector filter of the correlation rule is significant and affects system performance. We recommend putting the most unique condition in the first place in the selector filter.

    Consider two examples of selector filters that select successful authentication events in Microsoft Windows.

    Selector filter 1:

    Condition 1. DeviceProduct = Microsoft Windows

    Condition 2. DeviceEventClassID = 4624

    Selector filter 2:

    Condition 1. DeviceEventClassID = 4624

    Condition 2. DeviceProduct = Microsoft Windows

    The order of conditions in Selector filter 2 is preferable because it causes less load on the system.

  • Recovery—this check box must be selected when the Correlation rule must NOT trigger if a certain number of events are received from the selector. By default, this check box is cleared.

Select the Local variables tab and click Add variable to declare variables that you want to use within the limits of this correlation rule.

In the selector of the correlation rule, you can use regular expressions conforming to the RE2 standard.

Using regular expressions in correlation rules is computationally intensive compared to other operations. Therefore, when designing correlation rules, we recommend limiting the use of regular expressions to the necessary minimum and using other available operations.

To use a regular expression, you must use the match comparison operator. The regular expression must be placed in a constant. The use of capture groups in regular expressions is optional. For the correlation rule to trigger, the field text matched against the regexp must exactly match the regular expression.

For a primer on syntax and examples of correlation rules that use regular expressions in their selectors, see the following rules that are provided with KUMA:

  • R105_04_Suspicious PowerShell commands. Suspected obfuscation.
  • R333_Suspicious creation of files in the autorun folder.

Actions tab

A rule of the standard kind can have multiple triggers.

  • On first threshold—this trigger activates when the Bucket registers the first triggering of the selector during the lifetime of the Bucket.
  • On subsequent thresholds—this trigger activates when the Bucket registers the second and all subsequent triggering of the selector during the lifetime of the Bucket.
  • On every threshold—this trigger activates every time the Bucket registers the triggering of the selector.
  • On timeout—this trigger activates when the lifetime of the Bucket ends, and is linked to the selector with the Recovery check box selected. In other words, this trigger activates if the situation detected by the correlation rule is not resolved within the defined amount of time.

Every trigger is represented as a group of settings with the following parameters available:

  • Output—if this check box is selected, the correlation event is sent for post-processing: for external enrichment outside the correlation rule, for response, and to destinations.
  • Loop to correlator—if this check box is selected, the created correlation event is processed by the rule chain of the current correlator. This allows hierarchical correlation.

    If the Output and Loop to correlator check boxes are set, the correlation rule is sent to post-processing first, and then to the selectors of the current correlation rule.

  • Do not create alert—if this check box is selected, an alert is not created when this correlation rule is triggered. If you do not want to create an alert when a correlation rule is triggered, but you still want to send a correlation event to the storage, select the Output and No alert check boxes. If you select only the No alert check box, a correlation event is not saved in the storage.
  • Under Enrichment, you can modify the fields of correlation events by using enrichment rules. These enrichment rules are stored in the correlation rule where they were created. You can create multiple enrichment rules. Enrichment rules can be added or deleted by clicking the Add enrichment or Remove enrichment buttons, respectively.
    • Source kind—you can select the type of enrichment in this drop-down list. Depending on the selected type, you may see advanced settings that will also need to be completed.

      Available types of enrichment:

      • constant

        This type of enrichment is used when a constant needs to be added to an event field. Settings of this type of enrichment:

        • In the Constant field, specify the value that should be added to the event field. The value may not be longer than 255 Unicode characters. If you leave this field blank, the existing event field value will be cleared.
        • In the Target field drop-down list, select the KUMA event field to which you want to write the data.

        If you are using the event enrichment functions for extended schema fields of "String", "Number", or "Float" type with a constant, the constant is added to the field.

        If you are using the event enrichment functions for extended schema fields of "Array of strings", "Array of numbers", or "Array of floats" type with a constant, the constant is added to the elements of the array.

      • dictionary

        This type of enrichment is used if you need to add a value from the dictionary of the Dictionary type.

        When this type is selected in the Dictionary name drop-down list, you must select the dictionary that will provide the values. In the Key fields settings block, you have to click the Add field button and select the event fields whose values will be used for dictionary entry selection.

        If you are using event enrichment with the "Dictionary" type selected as the "Source kind" setting, and an array field is specified in the "Key enrichment fields" setting, when an array is passed as the dictionary key, the array is serialized into a string in accordance with the rules of serializing a single value in the TSV format.

        Example: The "Key enrichment fields" setting uses the SA.StringArrayOne extended schema field. The SA.StringArrayOne extended schema field contains 3 elements: "a", "b" and "c". The following value is passed to the dictionary as the key: ['a','b','c'].

        If the "Key enrichment fields" setting uses an extended schema array field and a regular event schema field, the field values are separated by the "|" character when the dictionary is queried.

        Example: The "Key enrichment fields" setting uses two fields: the SA.StringArrayOne extended schema field and the Code field. The SA.StringArrayOne extended schema field contains 3 elements: "a", "b", and "c"; the Code string field contains the character sequence "myCode". The following value is passed to the dictionary as the key: ['a','b','c']|myCode.

      • table

        This type of enrichment is used if you need to add a value from the dictionary of the Table type.

        When this enrichment type is selected in the Dictionary name drop-down list, select the dictionary for providing the values. In the Key fields group of settings, click the Add field button to select the event fields whose values are used for dictionary entry selection.

        In the Mapping table, configure the dictionary fields to provide data and the event fields to receive data:

        • In the Dictionary field column, select the dictionary field. The available fields depend on the selected dictionary resource.
        • In the KUMA field column, select the event field to which the value is written. For some of the selected fields (*custom* and *flex*), in the Label column, you can specify a name for the data written to them.

        New table rows can be added by clicking the Add new element button. Columns can be deleted by clicking the cross button.

      • event

        This type of enrichment is used when you need to write a value from another event field to the current event field. Settings of this type of enrichment:

        • In the Target field drop-down list, select the KUMA event field to which you want to write the data.
        • In the Source field drop-down list, select the event field whose value will be written to the target field.
        • Clicking the wrench-new button opens the Conversion window in which you can, by clicking the Add conversion button, create rules for modifying the original data before writing them to the KUMA event fields.

          Available conversions

          Conversions are changes that can be applied to a value before it gets written to the event field. The conversion type is selected from a drop-down list.

          Available conversions:

          • lower—is used to make all characters of the value lowercase
          • upper—is used to make all characters of the value uppercase
          • regexp – used to convert a value using the regular expression RE2. When this conversion type is selected, the field appears where regular expression should be added.
          • substring—is used to extract characters in the position range specified in the Start and End fields. These fields appear when this conversion type is selected.
          • replace—is used to replace specified character sequence with the other character sequence. When this type of conversion is selected, new fields appear:
            • Replace chars—in this field you can specify the character sequence that should be replaced.
            • With chars—in this field you can specify the characters sequence should be used instead of replaced characters.
          • trim—used to simultaneously remove the characters specified in the Chars field from the leading and end positions of the value. The field appears when this type of conversion is selected. For example, a trim conversion with the Micromon value applied to Microsoft-Windows-Sysmon results in soft-Windows-Sys.
          • append is used to add the characters specified in the Constant field to the end of the event field value. The field appears when this type of conversion is selected.
          • prepend—used to prepend the characters specified in the Constant field to the start of the event field value. The field appears when this type of conversion is selected.
          • replace with regexp—is used to replace RE2 regular expression results with the character sequence.
            • Expression—in this field you can specify the regular expression which results that should be replaced.
            • With chars—in this field you can specify the characters sequence should be used instead of replaced characters.
          • Converting encoded strings to text:
            • decodeHexString—used to convert a HEX string to text.
            • decodeBase64String—used to convert a Base64 string to text.
            • decodeBase64URLString—used to convert a Base64url string to text.

            When converting a corrupted string or if conversion error occur, corrupted data may be written to the event field.

            During event enrichment, if the length of the encoded string exceeds the size of the field of the normalized event, the string is truncated and is not decoded.

            If the length of the decoded string exceeds the size of the event field into which the decoded value is to be written, such a string is truncated to fit the size of the event field.

          Conversions when using the extended event schema

          Whether or not a conversion can be used depends on the type of extended event schema field being used:

          • For an additional field of the "String" type, all types of conversions are available.
          • For fields of the "Number" and "Float" types, the following types of conversions are available: regexp, substring, replace, trim, append, prepend, replaceWithRegexp, decodeHexString, decodeBase64String, decodeBase64URLString.
          • For fields of "Array of strings", "Array of numbers", and "Array of floats" types, the following types of conversions are available: append, prepend.

        When using enrichment of events that have the "Event" selected as the "Source kind" setting and the fields of the extended event schema are used as arguments, the following special considerations apply:

        • If the source field is an "Array of strings" field and the target field is a "String" field, the values are written to the target field in the TSV format.

          Example: The SA.StringArray extended event schema field contains values: "string1", "string2", "string3". An event enrichment operation is performed. The result of the operation is written to the DeviceCustomString1 event schema field. As a result of the operation, the DeviceCustomString1 field contains ["string1", "string2", "string3"].

        • If the source field is an "Array of strings" field and the target field is an "Array of strings" field, the values of the source field are appended to the values of the target field and are placed in the target field, with commas (",") used as the separator character.

          Example: The SA.StringArrayOne extended event schema field contains values: "string1", "string2", "string3". An event enrichment operation is performed. The result of the operation is written to the SA.StringArrayTwo event schema field. As a result of the operation, the SA.StringArrayTwo field contains "string1", "string2", "string3".

      • template

        This type of enrichment is used when you need to write a value obtained by processing Go templates into the event field. Settings of this type of enrichment:

        • Put the Go template into the Template field.

          Event field names are passed in the {{.EventField}} format, where EventField is the name of the event field from which the value must be passed to the script.

          Example: Attack on {{.DestinationAddress}} from {{.SourceAddress}}.

        • In the Target field drop-down list, select the KUMA event field to which you want to write the data.

        To convert the data in an array field in a template into the TSV format, you must use the toString function.

        If you are using enrichment of events that have the "Template" type selected as the "Source kind" setting, in which the target field has the "String" type, and the source field is an extended event schema field containing an array of strings, you can use one of the following examples for the template.

        Example:

        {{.SA.StringArrayOne}}

        Example:

        {{- range $index, $element := . SA.StringArrayOne -}}

        {{- if $index}}, {{end}}"{{$element}}"{{- end -}}

    • Debug—you can use this toggle switch to enable logging of service operations.
    • Description—the description of a resource. Up to 4,000 Unicode characters.
  • Categorization settings group—used to change the categories of assets indicated in events. There can be several categorization rules. You can add or delete them by clicking the Add categorization or Remove categorization buttons. Only reactive categories can be added to assets or removed from assets.
    • Operation—this drop-down list is used to select the operation to perform on the category:
      • Add—assign the category to the asset.
      • Delete—unbind the asset from the category.
    • Event field—event field that indicates the asset requiring the operation.
    • Category ID—the drop-down list displays a tree of categories, in which you can select a category to perform the operation on. Clicking the row expands the list.
  • Active lists update group of settings—used to assign the trigger for one or more operations with active lists. You can click the Add active list action and Delete active list action buttons to add or delete operations with active lists, respectively.

    Available settings:

    • Name (required)—this drop-down list is used to select the Active list resources.
    • Operation (required)—this drop-down list is used to select the operation that must be performed:
      • Sum—add a constant, the value of a correlation event field, or the value of a local variable to the value of the active list.
      • Get—get the Active list entry and write the values of the selected fields into the correlation event.
      • Set—write the values of the selected fields of the correlation event into the Active list by creating a new or updating an existing Active list entry. When the Active list entry is updated, the data is merged and only the specified fields are overwritten.
      • Delete—delete the Active list entry.
    • Key fields (required)—this is the list of event fields used to create the Active list entry. It is also used as the Active list entry key.

      The active list entry key depends on the available fields and does not depend on the order in which they are displayed in the KUMA Console.

    • Mapping (required for Get and Set operations)—used to map Active list fields with events fields. More than one mapping rule can be set.
      • The left field is used to specify the Active list field.

        The field must not contain special characters or numbers only.

      • The middle drop-down list is used to select event fields.
      • The right field can be used to assign a constant to the Active list field is the Set operation was selected.
      • Under Context table update, you can assign the trigger for one or more operations with context tables. You can click "Add context table action" or "Delete context table action" to add or delete operations with context tables.
      • Available settings:
      • Name (required)—this drop-down list is used to select context table resources.
      • Operation (required)—this drop-down list is used to select the operation that must be performed.
      • Sum—add a constant, the value of a correlation event field, or the value of a local variable to the value of the context table. This operation is used only for fields of number and float types.
      • Set—write the values of the selected fields of the correlation event into the context table by creating a new or updating an existing context table entry. When the context table entry is updated, the data is merged and only the specified fields are overwritten.
      • Get—get the fields of the context table and write the values of the specified fields into the correlation event. Table fields of the boolean type and lists of boolean values are excluded from mapping because the event does not contain boolean fields.
      • Merge—append the value of a correlation event field, local variable, or constant to the current value of a field of the context table.
      • Delete—delete the context table entry.
      • Key fields (required)—this is the list of event fields used to create the context table entry. It is also used as the key of the context table entry. As a key field, you can specify an event field or a local variable declared on the "Selectors" tab.
      • The composite key of the context table entry depends only on the values of fields and does not depend on the order in which they are displayed in the KUMA Console.
      • Mapping (required for all operations except "Delete")—used to map context table fields to event fields or variables. More than one mapping rule can be set. You can specify the same context table field multiple times.
      • The left field is used to specify the context table field.
      • The field must not contain a field name that is already used in the mapping, tab characters, special characters, or only numerals. The maximum number of characters is 128. The name cannot begin with an underscore.
      • The middle drop-down list is used to select event fields or a local variable.
      • The right field can be used to assign a constant to the context table field is the "Set" operation was selected. "Merge" or "Sum". The maximum number of characters is 1,024.

Correlators tab

  • Add—Used when editing the created correlation rule. You can click Add to open the Correlators window and select a correlator from the list. After you click OK, the rule is linked to the selected correlator. You can select multiple correlators at the same time. The rule is added to the end of the execution queue. If you want to move the rule up in the execution queue, go to Resources - Correlator - <selected correlator> - Edit correlator - Correlation, select the check box next to the relevant rule and click the Move up or Move down buttons to reorder the rules as necessary.
  • Delete—Used to unlink the correlation rule from the correlator.

Page top
[Topic 265140]