Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding warning to exceptions that describes field conflicts and mapping issues #2957

Closed
nastasha-solomon opened this issue Jan 30, 2023 · 1 comment · Fixed by #3025
Closed
Assignees
Labels
Feature: Exceptions Team: Security Platform Includes Cyber Threat Intelligence (CTI) team v8.7.0

Comments

@nastasha-solomon
Copy link
Contributor

nastasha-solomon commented Jan 30, 2023

Description

Copy has been added to the Add rule exception flyout that warns users when they're selecting an unmapped field or a field that that has conflicting data type mappings.

An unmapped field is a field that isn't defined (not present) in an event or an alert's document. A field with conflicts is a field that's mapped to different data types across multiple indices.

When users select a field that falls under one or both of these categories, they will see the following:

  • A warning icon - The icon displays to the right of the field name in the Field drop-down.

    warning-icon
  • A warning message in the form of a tooltip - The tooltip displays when the user hover over the field with the icon.

    Screenshot 2023-02-23 at 3 38 13 PM
  • An expandable warning message - The message displays after the user selects the field. To view the warning message in full, the user needs to click on the message title ("This field is defined as several types across different indices"). This will expand the warning.

    expandable-message

Related:

Example 1: Unmapped fields

Here's an example of the warning message that displays when a user selects a field that is unmapped in some indices.

ex1

The warning message provides the following details:

  1. The _description field is defined as the text data type in the mapping definition for the field_caps_3, field_caps_4, and field_caps_5 indices. This is ok and doesn't break any field data type mapping rules.
  2. The _description field is not defined (i.e., not present) in the field_caps_1, and field_caps_2 indices. This can be problematic if the user expects the exception to apply to the matching _description field value in the field_caps_3, field_caps_4, and field_caps_5 indices as well as the field_caps_1, and field_caps_2 indices.

To find out whether the data type mapping for the _description field wasn't defined or the field wasn't present in the field_caps_1, and field_caps_2 indices, I ran the get mapping API from the console. The request returned the index's mapping definition, and I could see that the _description field was missing from the mapping definitions for both indices. This might've been a mistake or a typo, but the important point here is that, because the _description field is not mapped in the field_caps_1 or the field_caps_2 indices, the exception won't apply to either.

ex1 1

Example 2: Conflicting data types

In this example, the user selected a field that's been defined as different data types across multiple indices.

ex2

The warning message provides the following details:

  1. The doc_id field is defined as the text data type in the field_caps_1 and field_caps_2 indices.
  2. The doc_id field is defined as the long data type in the field_caps_3, field_caps_4, and field_caps_5 indices.

Technically, the mapping definitions for all five indices are acceptable. However, unless the user is aware of these data type mappings, they might accidentally configure exception conditions incorrectly.

For example, if the user wasn't aware that the doc_id field was mapped to the long data type in the field_caps_3, field_caps_4, and field_caps_5 indices, and wrote an exception that would only work on the field_caps_1 and field_caps_2 indices, they would still get alerts from the field_caps_3, field_caps_4, and field_caps_5 indices.

Example 3: Conflicting data types and unmapped fields

In this example, the user selected a field that's been defined as different data types across four indices and is unmapped in one index.

ex3

The warning message provides the following details:

  1. The published field is defined as the boolean data type in the field_caps_1 and field_caps_2 indices.
  2. The published field is defined as the text data type in the field_caps_3 and field_caps_4 indices.
  3. The published field is unmapped in the field_caps_5 index.

Again, technically the mappings in the field_caps_1, field_caps_2, field_caps_3, and field_caps_4 indices are acceptable. The user would just need to be careful when configuring exception conditions and make sure they're entering the correct values. They should also be aware the exception will not apply to field_caps_5 index because the published field isn't mapped in that index.

Notes

  • To reduce the amount of text in the warning message, data stream indices are grouped under a single name. An example warning message might look like:
This field is defined as several types... 
text (7): logs-tortilla.process-default (3 indices) logs-gcp.audit(4 indices), keyword (3): logs-tortilla.process-default, logs-gcp.audit(2 indices)“. 
  • When users encounter these warnings, they can choose to keep their data as is, update their index mappings, or handle the conflicts another way.
  • It might be helpful to include a note that, if users select a field with mapping issues, they might encounter unexpected exception behavior (e.g., false positive alerts, which are alerts that shouldn't be generated).
@nastasha-solomon nastasha-solomon added Team: Security Platform Includes Cyber Threat Intelligence (CTI) team Feature: Exceptions labels Jan 30, 2023
@nastasha-solomon nastasha-solomon self-assigned this Jan 30, 2023
@nastasha-solomon nastasha-solomon changed the title Adding warning to exceptions that describes mapping issues Adding warning to exceptions that describes field conflicts and mapping issues Feb 22, 2023
@e40pud
Copy link
Contributor

e40pud commented Feb 27, 2023

@nastasha-solomon the description above looks good to me and covers the new feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Exceptions Team: Security Platform Includes Cyber Threat Intelligence (CTI) team v8.7.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants