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] Visual Event Analyzer not available for sysmon events ingested with Elastic Agent #148043

Closed
kowalczyk-p opened this issue Dec 23, 2022 · 14 comments
Assignees
Labels
bug Fixes for quality problems that affect the customer experience enhancement New value added to drive a business result fixed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Investigations Security Solution Investigations Team Team:Threat Hunting Security Solution Threat Hunting Team

Comments

@kowalczyk-p
Copy link

Describe the bug:
Visual event analyzer does not work from events ingested from sysmon with Elastic Agent

Kibana/Elasticsearch Stack version:
8.4.3

Server OS version:
Docker

Elastic Agent version:
8.4.3

Functional Area (e.g. Endpoint management, timelines, resolver, etc.):
Visual Events Analyzer

Docs available at https://www.elastic.co/guide/en/security/current/visual-event-analyzer.html states that:

You can only visualize events triggered by hosts configured with the Elastic Defend integration or any sysmon data from winlogbeat.

In KQL, this translates to any event with the agent.type set to either:

endpoint
winlogbeat with event.module set to sysmon

Problem is systmon events ingested with Elastic Agent windows integration have following values:

  • event.module : windows
  • agent.type : filebeat.

Visual events analyzer works for sysmon events ingested with winlogbeat but does not work for same events ingested with Elastic Agent.

@kowalczyk-p kowalczyk-p added bug Fixes for quality problems that affect the customer experience Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. triage_needed labels Dec 23, 2022
@elasticmachine
Copy link
Contributor

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

@kqualters-elastic
Copy link
Contributor

@kowalczyk-p are you sure these events are coming from winlogbeat + sysmon? The sample fields are from a filebeat event, which won't have the requisite process and parent process information needed to build the visual event analyzer, it's just file info. Do you have a full sample event?

@kowalczyk-p
Copy link
Author

@kqualters-elastic events are from sysmon but I am currently in process of migrating from Windows Event Forwarding + winlogbeat to Elastic Agent. Currently every event generated by sysmon is ingested in my Elasticsearch twice:

  • once by winlogbeat from event collector - those event have event.module = sysmon and agent.type = winlogbeat
  • second by Elastic Agent directly from workstation - whose have event.module = windows and agent.type = filebeat.
    From what I read this is way Elastic Agent works - https://discuss.elastic.co/t/does-the-elastic-agent-contain-winlogbeat/282043.
    I can paste full sample event next week.

@MadameSheema MadameSheema added Team:Threat Hunting Security Solution Threat Hunting Team Team:Threat Hunting:Investigations Security Solution Investigations Team labels Jan 9, 2023
@elasticmachine
Copy link
Contributor

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

@michaelolo24 michaelolo24 added enhancement New value added to drive a business result impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. and removed triage_needed labels Jan 9, 2023
@michaelolo24
Copy link
Contributor

Thanks for opening this issue @kowalczyk-p ! Currently, we explicitly check for a given agent.type & event.module to enable the analyzer. The code for that is here: https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_resolver.tsx . With that being said, the use case you've mentioned here is a feasible use case, but we'd need to investigate further to make sure it doesn't enable analyzer in situations where it may not work as expected.

@kowalczyk-p
Copy link
Author

Thanks, I hope you will find it easy to solve as the event source (Sysmon) is same and only way of indexing it into Elasticsearch is changed (winlogbeat vs elastic agent).

@kqualters-elastic
Copy link
Contributor

kqualters-elastic commented Mar 1, 2023

@kowalczyk-p that linked pr should fix this issue, sorry that happened, and even more sorry for the delay in getting it fixed, your issue + the mentions on discuss were the first time we became aware of it, was a breaking change on agent side. The reason that we have to be so restrictive in trying to render the analyzer in the first place, and not just any time an event has a process.entity_id, is because some places in agent use entity_id to be a unique id for the process that is shipping the data, and not as a unique id for the underlying observed processes creating data. I wish this was not the case, but the Ecs docs even mention that the exact meaning of the field is dependent on the data source: https://www.elastic.co/guide/en/ecs/current/ecs-process.html#field-process-entity-id This can result in a basically useless set of information, with all events having the same id, and we want to be sure that we are dealing with a dataset that is using entity_id as expected. Thanks for filing the issue!

kqualters-elastic added a commit that referenced this issue Mar 1, 2023
## Summary

Related issue: #148043

With the switch from beats to elastic agent, analyzer broke for sysmon
data ingested via elastic agent, as some fields the code expects to
exist became slightly different, this pr updates the frontend and server
side api of analyzer to work with both old winlogbeat style sysmom
ingestion and new elastic agent + filebeat shipping sysmon generated
data.



https://user-images.githubusercontent.com/56408403/222063497-64b2853e-5d09-4178-b336-1007886c396b.mov

Video with 8.6 agent/fleet + latest main kibana/es + windows 10 w/sysmon
vm

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Mar 1, 2023
## Summary

Related issue: elastic#148043

With the switch from beats to elastic agent, analyzer broke for sysmon
data ingested via elastic agent, as some fields the code expects to
exist became slightly different, this pr updates the frontend and server
side api of analyzer to work with both old winlogbeat style sysmom
ingestion and new elastic agent + filebeat shipping sysmon generated
data.

https://user-images.githubusercontent.com/56408403/222063497-64b2853e-5d09-4178-b336-1007886c396b.mov

Video with 8.6 agent/fleet + latest main kibana/es + windows 10 w/sysmon
vm

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit a9313ee)
kibanamachine referenced this issue Mar 1, 2023
…#152492)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[Security Solution] Analyzer with sysmon via filebeat
(#152418)](#152418)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Kevin
Qualters","email":"56408403+kqualters-elastic@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-03-01T18:07:05Z","message":"[Security
Solution] Analyzer with sysmon via filebeat (#152418)\n\n##
Summary\r\n\r\nRelated issue:
https://github.com/elastic/kibana/issues/148043\r\n\r\nWith the switch
from beats to elastic agent, analyzer broke for sysmon\r\ndata ingested
via elastic agent, as some fields the code expects to\r\nexist became
slightly different, this pr updates the frontend and server\r\nside api
of analyzer to work with both old winlogbeat style sysmom\r\ningestion
and new elastic agent + filebeat shipping sysmon
generated\r\ndata.\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/56408403/222063497-64b2853e-5d09-4178-b336-1007886c396b.mov\r\n\r\nVideo
with 8.6 agent/fleet + latest main kibana/es + windows 10
w/sysmon\r\nvm\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"a9313eefe0799d032e5176b1de8d3f1608e4e914","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Threat
Hunting:Investigations","v8.7.0","v8.8.0"],"number":152418,"url":"https://github.com/elastic/kibana/pull/152418","mergeCommit":{"message":"[Security
Solution] Analyzer with sysmon via filebeat (#152418)\n\n##
Summary\r\n\r\nRelated issue:
https://github.com/elastic/kibana/issues/148043\r\n\r\nWith the switch
from beats to elastic agent, analyzer broke for sysmon\r\ndata ingested
via elastic agent, as some fields the code expects to\r\nexist became
slightly different, this pr updates the frontend and server\r\nside api
of analyzer to work with both old winlogbeat style sysmom\r\ningestion
and new elastic agent + filebeat shipping sysmon
generated\r\ndata.\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/56408403/222063497-64b2853e-5d09-4178-b336-1007886c396b.mov\r\n\r\nVideo
with 8.6 agent/fleet + latest main kibana/es + windows 10
w/sysmon\r\nvm\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"a9313eefe0799d032e5176b1de8d3f1608e4e914"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/152418","number":152418,"mergeCommit":{"message":"[Security
Solution] Analyzer with sysmon via filebeat (#152418)\n\n##
Summary\r\n\r\nRelated issue:
https://github.com/elastic/kibana/issues/148043\r\n\r\nWith the switch
from beats to elastic agent, analyzer broke for sysmon\r\ndata ingested
via elastic agent, as some fields the code expects to\r\nexist became
slightly different, this pr updates the frontend and server\r\nside api
of analyzer to work with both old winlogbeat style sysmom\r\ningestion
and new elastic agent + filebeat shipping sysmon
generated\r\ndata.\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/56408403/222063497-64b2853e-5d09-4178-b336-1007886c396b.mov\r\n\r\nVideo
with 8.6 agent/fleet + latest main kibana/es + windows 10
w/sysmon\r\nvm\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"a9313eefe0799d032e5176b1de8d3f1608e4e914"}}]}]
BACKPORT-->

Co-authored-by: Kevin Qualters <56408403+kqualters-elastic@users.noreply.github.com>
@kowalczyk-p
Copy link
Author

@kqualters-elastic Thank You! I,m looking forward for version 8.7.

sloanelybutsurely pushed a commit to sloanelybutsurely/kibana that referenced this issue Mar 8, 2023
## Summary

Related issue: elastic#148043

With the switch from beats to elastic agent, analyzer broke for sysmon
data ingested via elastic agent, as some fields the code expects to
exist became slightly different, this pr updates the frontend and server
side api of analyzer to work with both old winlogbeat style sysmom
ingestion and new elastic agent + filebeat shipping sysmon generated
data.



https://user-images.githubusercontent.com/56408403/222063497-64b2853e-5d09-4178-b336-1007886c396b.mov

Video with 8.6 agent/fleet + latest main kibana/es + windows 10 w/sysmon
vm

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this issue Mar 10, 2023
## Summary

Related issue: elastic#148043

With the switch from beats to elastic agent, analyzer broke for sysmon
data ingested via elastic agent, as some fields the code expects to
exist became slightly different, this pr updates the frontend and server
side api of analyzer to work with both old winlogbeat style sysmom
ingestion and new elastic agent + filebeat shipping sysmon generated
data.



https://user-images.githubusercontent.com/56408403/222063497-64b2853e-5d09-4178-b336-1007886c396b.mov

Video with 8.6 agent/fleet + latest main kibana/es + windows 10 w/sysmon
vm

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
nkhristinin pushed a commit that referenced this issue Mar 22, 2023
## Summary

Related issue: #148043

With the switch from beats to elastic agent, analyzer broke for sysmon
data ingested via elastic agent, as some fields the code expects to
exist became slightly different, this pr updates the frontend and server
side api of analyzer to work with both old winlogbeat style sysmom
ingestion and new elastic agent + filebeat shipping sysmon generated
data.



https://user-images.githubusercontent.com/56408403/222063497-64b2853e-5d09-4178-b336-1007886c396b.mov

Video with 8.6 agent/fleet + latest main kibana/es + windows 10 w/sysmon
vm

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
@michaelolo24
Copy link
Contributor

@kowalczyk-p - Just wanted to check in. If you've had a chance to upgrade to 8.7, can you confirm your issue was resolved? Thanks!

@kowalczyk-p
Copy link
Author

@michaelolo24 not yet, we have some delay in upgrading our cluster. Currently we are on 8.5 so it will take us some time to reach 8.7.

@PhilippeOberti
Copy link
Contributor

In an effort of triaging/cleaning up old tickets, I'm just checking here @kowalczyk-p if the upgrade was done and you were able to check if this was correctly fixed for you?

@kowalczyk-p
Copy link
Author

@PhilippeOberti we are half way there. I expect to be updated to 8.7 in two weeks.

@michaelolo24
Copy link
Contributor

Hey @kowalczyk-p - Just checking back in on this 😄, how did the upgrade go?

@kowalczyk-p
Copy link
Author

Upgrade completed today and analyzer is working :) Thank you very much!

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 enhancement New value added to drive a business result fixed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Investigations Security Solution Investigations Team Team:Threat Hunting Security Solution Threat Hunting Team
Projects
None yet
Development

No branches or pull requests

6 participants