Skip to content

Conversation

@PhilippeOberti
Copy link
Contributor

@PhilippeOberti PhilippeOberti commented Aug 1, 2025

Summary

This PR fixes a very small issue where the last sync value for the sentinel_one integration was not showing up, while alerts were clearly fetched and rendered in the alerts table.

Screenshot 2025-08-01 at 6 35 46 PM

Doing some investigation, we discovered that the documents ingested for the integrations like crowdstrike and others have the following key/value pair: event.kind: "alert".
For the sentinel_one integration though, the event.kind field has event as a value.

The original ESQL query I wrote to fetch the documents was:

FROM ${`logs-${integrationName}.alert-default`}
    | WHERE event.kind == "alert"
    | SORT event.ingested DESC
    | KEEP event.ingested
    | LIMIT 1

Updating it to

FROM ${`logs-${integrationName}.alert-default`}
    | WHERE event.kind == "alert" OR event.kind == "event"
    | SORT event.ingested DESC
    | KEEP event.ingested
    | LIMIT 1

ensures that we will look at all those documents to see if the index has had some recent activity.

At first we thought we could remove the | WHERE event.kind == "alert" section entirely from the query, but we have some documents with a event.kind: "pipline_error" which we do NOT want to take into account.

As you can see, for integrations like crowdstrike, the document retrieve does not change:
Old:
Screenshot 2025-08-01 at 6 31 04 PM
New:
Screenshot 2025-08-01 at 6 31 17 PM

But for sentinel_one, the new query fixes the issue:
Old:
Screenshot 2025-08-01 at 6 30 52 PM
New:
Screenshot 2025-08-01 at 6 30 42 PM

#230110

@PhilippeOberti PhilippeOberti requested a review from a team as a code owner August 1, 2025 16:42
@PhilippeOberti PhilippeOberti added release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team backport:version Backport to applied version labels v9.2.0 v9.1.1 v8.19.1 labels Aug 1, 2025
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@NicholasPeretti NicholasPeretti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sneaky little one! Great job! ☺️

@PhilippeOberti PhilippeOberti merged commit 1f21622 into elastic:main Aug 1, 2025
26 checks passed
@PhilippeOberti PhilippeOberti deleted the fix-sentinel_one-last-event-ingested branch August 1, 2025 18:43
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

https://github.com/elastic/kibana/actions/runs/16682683494

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Aug 1, 2025
…230277) (#230300)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[AI4DSOC] Fix last event ingested for sentinel_one integration
(#230277)](#230277)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Philippe
Oberti","email":"philippe.oberti@elastic.co"},"sourceCommit":{"committedDate":"2025-08-01T18:43:08Z","message":"[AI4DSOC]
Fix last event ingested for sentinel_one integration
(#230277)","sha":"1f21622d5455330459aa52c1db3250aec710ed13","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat
Hunting:Investigations","backport:version","v9.2.0","v9.1.1","v8.19.1"],"title":"[AI4DSOC]
Fix last event ingested for sentinel_one
integration","number":230277,"url":"https://github.com/elastic/kibana/pull/230277","mergeCommit":{"message":"[AI4DSOC]
Fix last event ingested for sentinel_one integration
(#230277)","sha":"1f21622d5455330459aa52c1db3250aec710ed13"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/230277","number":230277,"mergeCommit":{"message":"[AI4DSOC]
Fix last event ingested for sentinel_one integration
(#230277)","sha":"1f21622d5455330459aa52c1db3250aec710ed13"}},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Philippe Oberti <philippe.oberti@elastic.co>
kibanamachine added a commit that referenced this pull request Aug 4, 2025
…#230277) (#230299)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[AI4DSOC] Fix last event ingested for sentinel_one integration
(#230277)](#230277)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Philippe
Oberti","email":"philippe.oberti@elastic.co"},"sourceCommit":{"committedDate":"2025-08-01T18:43:08Z","message":"[AI4DSOC]
Fix last event ingested for sentinel_one integration
(#230277)","sha":"1f21622d5455330459aa52c1db3250aec710ed13","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat
Hunting:Investigations","backport:version","v9.2.0","v9.1.1","v8.19.1"],"title":"[AI4DSOC]
Fix last event ingested for sentinel_one
integration","number":230277,"url":"https://github.com/elastic/kibana/pull/230277","mergeCommit":{"message":"[AI4DSOC]
Fix last event ingested for sentinel_one integration
(#230277)","sha":"1f21622d5455330459aa52c1db3250aec710ed13"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/230277","number":230277,"mergeCommit":{"message":"[AI4DSOC]
Fix last event ingested for sentinel_one integration
(#230277)","sha":"1f21622d5455330459aa52c1db3250aec710ed13"}},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Philippe Oberti <philippe.oberti@elastic.co>
szaffarano pushed a commit to szaffarano/kibana that referenced this pull request Aug 5, 2025
@wildemat wildemat mentioned this pull request Aug 7, 2025
10 tasks
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team v8.19.1 v9.1.1 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants