-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[CrowdstrikeFalcon] Fix Detection duplicates #41216
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
base: master
Are you sure you want to change the base?
Conversation
latest_incident_time = max(found_incidents_ids.values() or [current_time]) | ||
demisto.debug('lb: latest_incident_time is {}'.format(latest_incident_time)) | ||
|
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.
explain this change? current_time wont always be the biggest?
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.
Not if there's an empty run.
That is the case we are fixing; when an empty run causes all the old IDs to be deleted, including the ID of the incident that gave us the "fetch_from" time we are still using. This means that we pull the incident again, but we don't have the ID stored in the LastRun, so we create a duplicate.
With this fix, we will always have that ID in the LastRun.
for inc_id, addition_time in found_incidents_ids.items(): | ||
|
||
if current_time - addition_time <= deletion_threshold_in_seconds: | ||
if current_time - addition_time <= deletion_threshold_in_seconds or addition_time == latest_incident_time: |
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.
explain? add a comment explaining as well
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.
We need to keep all the latest ID as I explained in the last comment. I'll add a comment to the code as well.
Validate summary Verdict: PR can be force merged from validate perspective? ✅ |
This PR was automatically updated by a GitHub Action
To stop automatic version bumps, add the |
Status
Related Issues
fixes: link to the issue
Description
A few sentences describing the overall goals of the pull request's commits.
Must have