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

[Security Solution][Timeline] Dragging a nested field to timeline does not generate the correct query #89784

Closed
rylnd opened this issue Jan 29, 2021 · 22 comments · Fixed by #92025 or #93721
Assignees
Labels
bug Fixes for quality problems that affect the customer experience documentation impact:critical This issue should be addressed immediately due to a critical level of impact on the product. QA:Validated Issue has been validated by QA Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team triage_needed v7.11.2 v7.12.0 v7.15.0

Comments

@rylnd
Copy link
Contributor

rylnd commented Jan 29, 2021

Describe the bug:
Dragging a nested field to the timeline does not filter events to those matching the field.

Kibana/Elasticsearch Stack version:
7.11

Functional Area (e.g. Endpoint management, timelines, resolver, etc.):
Timeline

Steps to reproduce:

  1. Generate a document with a nested field
  2. Drag a value from the nested field to the timeline
  3. Observe that the field has added to the timeline, but the events have not been refined

Current behavior:
All events are shown; no filtering occurs

Expected behavior:
Timeline events are filtered to those matching the nested field/value

Screenshots (if relevant):
Nested field in signals table:Detections_-_Kibana

nested field in timeline (no indication of nested type):Detections_-_Kibana

relevant portion of the inspected timeline query: kibana_🍔Untitled-1

relevant portion of the timeline network request: DevTools_-_localhost_5601_app_security_detections_sourcerer__default______timerange__global__linkTo_____timerange__from__272021-01-22T18_38_50_700Z_27_fromStr_now-7d_kind_relative_to__272021-01-29T18_38_50_700Z_27_toStr_now___timeline__link

@rylnd rylnd added bug Fixes for quality problems that affect the customer experience Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. labels Jan 29, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@stephmilovic
Copy link
Contributor

Partially resolved here. This is what still is broken:
Screen Shot 2021-02-26 at 12 25 31 PM
Screen Shot 2021-02-26 at 12 39 15 PM

@MadameSheema
Copy link
Member

Reopening since the issue has not been closed yet.

@MadameSheema MadameSheema reopened this Mar 3, 2021
@MadameSheema MadameSheema added the impact:critical This issue should be addressed immediately due to a critical level of impact on the product. label Mar 3, 2021
@MadameSheema
Copy link
Member

Tagged as critical after a conversation with @MikePaquette

@ghost
Copy link

ghost commented Mar 9, 2021

Thanks @MadameSheema for providing the api index hits details to have the sample nested data .

we have followed the steps and successfully got the nested data in indicator match rule on 7.12.0 BC3 , However issue is still occuring incorrect result is returning for nested data . we will retest this issue on 7.12.0 BC4.

image

Build Details:

Version: 7.12.0 BC3
Commit:08417cbd6c15e4c866651a7dcdfeded58845206d
Build:39134

Snap-Shoot:
image

thanks !!

@rylnd
Copy link
Contributor Author

rylnd commented Mar 9, 2021

Reopening until @karanbirsingh-qasource can confirm this fix on a BC.

@rylnd rylnd reopened this Mar 9, 2021
@MadameSheema
Copy link
Member

@karanbirsingh-qasource can you please prioritise the validation of this fix? Thanks

@ghost
Copy link

ghost commented Mar 11, 2021

Hi @MadameSheema and @rylnd

We have validated this issue on 7.12.0 BC4 and Observed that issue is Still occurring incorrect result is returning.

Build Details:

Version: 7.12.0-BC4
Platform: Production
Commit:99ac38d70e426f589bb61a034c96e602d759cfab
Build:39242
https://staging.elastic.co/7.12.0-336ff10d/summary-7.12.0.html

Screenshot:
indicator_domain

Timeline:

Timeline

Thanks!!

@MadameSheema
Copy link
Member

@deepikakeshav-qasource please validate the fix on the next BC. Thanks :)

@XavierM
Copy link
Contributor

XavierM commented Mar 18, 2021

yes, I am pretty sure it is working on the data provider but not on the filter in/out just under KQL

@ghost
Copy link

ghost commented Mar 22, 2021

Hi @MadameSheema,

We have validated this issue on 7.12.0 BC5 build and Observed that issue is Fixed. Correct result is returning under Timeline

Build Details:

Version:7.12.0 BC5
Platform: Production
Commit:b7f9a41f486a2910ef22a1274ec734219c35ca3e
Build:39309
Artifact Page: https://staging.elastic.co/7.12.0-583fca05/summary-7.12.0.html

Screenshot:
Dev_tools
Indicator_match
Timeline_tab

Hence, we are closing this issue and adding "QA Validate" Label to it.

Thanks!!

@ghost ghost added the QA:Validated Issue has been validated by QA label Mar 22, 2021
@ghost ghost closed this as completed Mar 22, 2021
@XavierM
Copy link
Contributor

XavierM commented Mar 22, 2021

What I mean here, if you are using the menu context on a nested field, the filter out/in won't work as right now. However @kqualters-elastic is working on a fix for 7.12.1 Please, Kevin add this bug to you PR. So QA can test it.

@ghost
Copy link

ghost commented Mar 23, 2021

Hi @MadameSheema,

We tested the latest 7.12.0 doc link and found that documentation for this ticket is not yet updated.

We will test again once the changes are updated in Doc.

Thanks!

@kqualters-elastic
Copy link
Contributor

After some debugging with @XavierM we've come to the conclusion that this is actually working as expected, for both draggable filtering as well as adding/removing filters via the context menu.
nested_filter

@XavierM XavierM closed this as completed Mar 24, 2021
@ghost
Copy link

ghost commented Aug 20, 2021

Hi @MadameSheema

we have checked that this issue start occuring again on 7.15.0 BC1 . The Timeline result did not filter correctly on adding nested field threat.enrichments.indicator.domain and mydata.domain

Please find below complete details:

Build Details:

Version:7.15.0
Commit:d791226d9385122f33f4a5ca38fa5369012fbec3
Build:43636

Screen-Cast:

nested-data.mp4

Dev Nested Data HIT:

PUT indicator

PUT /indicator/_mapping
{
        "properties": {
          "@timestamp": {
            "type": "date"
          },
          "threatintel": {
            "properties" : {
            "indicator": {
              "properties": {
                "domain": {
                  "ignore_above": 1024,
                  "type": "keyword"
                }
          }
        }
            }
}
}
}

POST /indicator/_doc
{
"@timestamp": "2021-02-22T21:00:49.337Z",
"threatintel" : {
            "indicator" : {
              "domain" : "117.242.211.13"
            }
}
}

PUT mydata

PUT /mydata/_mapping
{
        "properties": {
          "@timestamp": {
            "type": "date"
          },
          "mydata": {
              "properties": {
                "domain": {
                  "ignore_above": 1024,
                  "type": "keyword"
                }
          }
        }
}
}

POST /mydata/_doc
{
  "@timestamp": "2021-02-22T21:00:49.337Z",
  "mydata": {
    "domain": "117.242.211.13"
  }
}

@ghost ghost reopened this Aug 20, 2021
@MadameSheema
Copy link
Member

@kqualters-elastic @XavierM any update regarding this? thanks

@ecezalp
Copy link
Contributor

ecezalp commented Aug 24, 2021

did a little investigation around this bug, and here are my findings. To sum up, I believe the currently observed behavior isn't related to nested field types, but it is about non-ECS-compliant fields sneaking into the timeline view, which does not seem to be supported for investigation.

Setup (reproduction)

  1. add new indices to kibana.dev.yml
// kibana.dev.yml

xpack.securitySolution.signalsIndex: .siem-signals-89784
kibana.index: .kibana-89784

note: there is no significance to number 89784, it's just the number of this issue.
note: in kibana.dev.yml there are no other significant configurations (for instance, ruleRegistry is not enabled)

  1. start elasticsearch & kibana and visit the security app
  2. go to Kibana devtools and make the requests from Karanbir's earlier comment, pasted below for convenience
requests

PUT indicator

PUT /indicator/_mapping
{
  "properties": {
    "@timestamp": {
      "type": "date"
    },
    "threatintel": {
      "properties": {
        "indicator": {
          "properties": {
            "domain": {
              "ignore_above": 1024,
              "type": "keyword"
            }
          }
        }
      }
    }
  }
}

POST /indicator/_doc
{
  "@timestamp": "2021-08-23T21:00:49.337Z",
  "threatintel": {
    "indicator": {
      "domain": "117.242.211.13"
    }
  }
}

PUT mydata

PUT /mydata/_mapping
{
  "properties":{
    "@timestamp":{
      "type":"date"
    },
    "mydata":{
      "properties":{
        "domain":{
          "ignore_above":1024,
          "type":"keyword"
        }
      }
    }
  }
}

POST /mydata/_doc
{
  "@timestamp": "2021-08-22T21:00:49.337Z",
  "mydata": {
    "domain": "117.242.211.13"
  }
}

  1. create an indicator match rule with the following configuration

Screen Shot 2021-08-24 at 4 51 15 PM

  1. create a custom query rule with the following configuration

Screen Shot 2021-08-24 at 4 53 52 PM

  1. observe that one alert for each rule is generated

Screen Shot 2021-08-24 at 4 59 35 PM

  1. Open alert summary flyout from either one of the alerts, click on the Table tab, find mydata.domain field, and add the column to the Alerts table

Screen Shot 2021-08-24 at 5 12 02 PM

Screen Shot 2021-08-24 at 5 13 29 PM

  1. Click on the timeline icon next to mydata.domain field, and notice that no alerts show up

Screen Shot 2021-08-24 at 5 14 56 PM

Findings / Further Investigation

  1. Considering that the alert generated by the custom query rule also did not show up, I think that we can eliminate the possibility that the bug has to do with nested field types.

  2. it doesn't seem possible to manually add the mydata.domain field on the timeline once it's removed.

Screen Shot 2021-08-24 at 5 18 05 PM

  1. it is also not possible to manually add the mydata.domain field on the Alerts table once it the fields are reset

Screen Shot 2021-08-24 at 5 26 01 PM

  1. other fields such as signal.rule.name or threat.enrichments.matched.field work as expected on timeline, both with manual KQL entry and from the timeline button on the Alerts table once the field is added through the fields button.

Conclusion

It looks like we don't have timeline support for non-ECS-compliant fields. We do seem to get data on the Alerts table if the user adds a column from the Table tab of the Alert Summary Flyout, but it's not normally possible to add the column using the fields button on the table. I can envision two solutions that could help resolve this issue:

  1. remove "add to timeline" button from non-ECS-compliant fields if they make their way on the Alerts table
  2. remove "column toggling" functionality on the Alert Summary Flyout for non-ECS-compliant fields

I would appreciate a review of my findings and a product decision regarding the next steps if possible.

Thanks for reading 👍

@rylnd
Copy link
Contributor Author

rylnd commented Aug 24, 2021

@karanbirsingh-qasource @MadameSheema I agree with @ecezalp 's findings above; it looks like this is working as expected for mapped fields, nested or no.

One contributor to the behavior seen here is the fact that threat.indicator.domain is no longer an ECS CTI field, and has moved instead to threat.indicator.url.domain. We had been using this for many CTI examples; I would suggest updating scenarios to use the new, analogous field instead. In @karanbirsingh-qasource's video, it should be possible to e.g. send threat.enrichments.matched.atomic to the timeline, which verifies that this is not a bug with nested fields.

If there is a bug here, it's the fact that we add unmapped fields to the alerts table, and then send those columns to the timeline, but I believe a separate ticket should be opened to address that case.

@ghost
Copy link

ghost commented Aug 25, 2021

did a little investigation around this bug, and here are my findings. To sum up, I believe the currently observed behavior isn't related to nested field types, but it is about non-ECS-compliant fields sneaking into the timeline view, which does not seem to be supported for investigation.

Setup (reproduction)

1. add new indices to `kibana.dev.yml`
// kibana.dev.yml

xpack.securitySolution.signalsIndex: .siem-signals-89784
kibana.index: .kibana-89784

note: there is no significance to number 89784, it's just the number of this issue.
note: in kibana.dev.yml there are no other significant configurations (for instance, ruleRegistry is not enabled)

1. start elasticsearch & kibana and visit the security app

2. go to Kibana devtools and make the requests from Karanbir's earlier [comment](https://github.com/elastic/kibana/issues/89784#issuecomment-902621705), pasted below for convenience

requests

1. create an indicator match rule with the following configuration
Screen Shot 2021-08-24 at 4 51 15 PM
1. create a custom query rule with the following configuration
Screen Shot 2021-08-24 at 4 53 52 PM
1. observe that one alert for each rule is generated
Screen Shot 2021-08-24 at 4 59 35 PM
1. Open alert summary flyout from either one of the alerts, click on the Table tab, find mydata.domain field, and add the column to the Alerts table
Screen Shot 2021-08-24 at 5 12 02 PM Screen Shot 2021-08-24 at 5 13 29 PM
1. Click on the timeline icon next to mydata.domain field, and notice that no alerts show up
Screen Shot 2021-08-24 at 5 14 56 PM # Findings / Further Investigation
1. Considering that the alert generated by the custom query rule also did not show up, I think that we can eliminate the possibility that the bug has to do with nested field types.

2. it doesn't seem possible to manually add the `mydata.domain` field on the timeline once it's removed.
Screen Shot 2021-08-24 at 5 18 05 PM
1. it is also not possible to manually add the `mydata.domain` field on the Alerts table once it the fields are reset
Screen Shot 2021-08-24 at 5 26 01 PM
1. other fields such as `signal.rule.name` or `threat.enrichments.matched.field` work as expected on timeline, both with manual KQL entry and from the timeline button on the Alerts table once the field is added through the fields button.

Conclusion

It looks like we don't have timeline support for non-ECS-compliant fields. We do seem to get data on the Alerts table if the user adds a column from the Table tab of the Alert Summary Flyout, but it's not normally possible to add the column using the fields button on the table. I can envision two solutions that could help resolve this issue:

1. remove "add to timeline" button from non-ECS-compliant fields if they make their way on the Alerts table

2. remove "column toggling" functionality on the Alert Summary Flyout for non-ECS-compliant fields

I would appreciate a review of my findings and a product decision regarding the next steps if possible.

Thanks for reading 👍

Thanks @ecezalp for looking into the issue and provide the detailed observation for the same .

As per the suggestion from Ryland i am opening up the seperate ticket for the above conclusion enhancement planned for the add unmapped fields to the alerts table, and then send those columns to the timeline .

Here is the ticket link for it #110002

@ghost
Copy link

ghost commented Aug 25, 2021

Thanks @rylnd for sharing the update of the change of the ECS CTI Field from the earlier one we were using.

The issue is Fixed ✔️ for the threat.enrichments.matched.atomic filed .

we have updated the old related test-case for it with the new filed that is threat.enrichments.matched.atomic .

Observations:

Please find below detailed observation for the threat.enrichments.matched.atomic filed

  • User is able to add threat.enrichments.matched.atomic filed from Field icon in utility bar
    image

  • User is able to add threat.enrichments.matched.atomic field under timeline as Add field
    image

  • Timeline result is getting filtered out correctly for this field
    image

Hence we are closing issue and opened new ticket for the separate issue of unmapped fields to the alerts table.

thanks !!

c.c @MadameSheema

@ghost ghost closed this as completed Aug 25, 2021
@MadameSheema
Copy link
Member

Thanks @ecezalp @rylnd

@rylnd taking into account this issue opened by @peluja1012 #90346, unmapped fields should be displayed in the alert details view, even we have test covering that area. It has been any change on the behaviour of unmapped fields I'm not aware of?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience documentation impact:critical This issue should be addressed immediately due to a critical level of impact on the product. QA:Validated Issue has been validated by QA Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team triage_needed v7.11.2 v7.12.0 v7.15.0
Projects
None yet
7 participants