-
Notifications
You must be signed in to change notification settings - Fork 621
Crowdstrike: use inclusive >= cursor boundary for host data stream #20524
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
Merged
chemamartinez
merged 3 commits into
elastic:main
from
chemamartinez:crowdstrike-host-fix-cursor-boundary
Aug 5, 2026
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Severity: 🟠 High
confidence: mediumpath: packages/crowdstrike/data_stream/host/agent/stream/cel.yml.hbs:70The inclusive >= boundary fixes timestamp skipping, but the GovCloud branch still permanently skips records at an error boundary because state.offset is never reset on the error paths; add "offset": 0 to both GovCloud error returns.
Details
This change makes the timestamp lower bound inclusive so same-timestamp records are not skipped across page/error boundaries. In the GovCloud branch that fix is incomplete, because pagination here is offset-based and
state.offsetsurvives the error paths.state.with()merges keys, and neither GovCloud error return setsoffset, so the previous value is preserved:{events, want_more: false, next: {}}-offsetkeeps whatever the previous execution left.offsettoint(state.offset) + body.resources.size()(line 87), sooffsetis left pointing past the records that were never published.offsetis only reset to 0 on the success path whenwant_moreis false. On the next executionwant_moreis false, so the filter is rebuilt fromstate.cursor.last_timestamp(or, if the object-shaped error caused the agent to drop the cursor, fromnow - initial_interval) - a fresh, much narrower result set - whileoffsetis still N. The API then skips the first N records of that new result set, and nothing ever comes back for them. A single transient 5xx on the entities POST during the first page therefore drops that entire page permanently.The commercial branch does not have this problem: its GET error return sets
next: {}, which clearsnext.page_tokenand restarts pagination cleanly. The GovCloud branch should reset its pagination state the same way.Recommendation:
Reset
offsetto 0 in both GovCloud error returns so a failed execution restarts pagination from the top of the freshly filtered result set:and likewise for the entities POST error return:
Regenerate
_dev/test/policy/test-default.expectedafter the change.🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a valid concern.