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

CS Falcon: fix fetch incidents issues #29898

Merged
merged 56 commits into from
Oct 23, 2023
Merged

Conversation

ilaner
Copy link
Contributor

@ilaner ilaner commented Sep 27, 2023

  • Add offset support to offset in the lookback
  • Use offset in crowdstrike

related: https://jira-dc.paloaltonetworks.com/browse/XSUP-29234?filter=-1

@ilaner ilaner changed the title CS Falcon: fetch sorting issue CS Falcon: fix fetch incidents issues Sep 27, 2023
Copy link
Contributor

@yuvalbenshalom yuvalbenshalom left a comment

Choose a reason for hiding this comment

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

see my comments.

@@ -1372,7 +1372,7 @@ def get_idp_detections_ids(filter_arg=None, offset: int = 0, limit=INCIDENTS_PER
:rtype ``dict``
"""
params = {
'sort': 'created_timestamp.asc',
'sort': 'start_time.asc',
Copy link
Contributor

Choose a reason for hiding this comment

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

so we are intentionally changing this or did you mean to preserve created_timestamp.asc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the IDP endpoint, which supports sorting by the start time and not only by first_behavior.

@@ -2505,6 +2505,21 @@ def migrate_last_run(last_run: dict[str, str] | list[dict]) -> list[dict]:
return [updated_last_run_detections, updated_last_run_incidents, {}]


def sort_incidents_summaries_by_ids_order(ids_order, full_incidents, id_field):
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe change to this because it should work on both?

Suggested change
def sort_incidents_summaries_by_ids_order(ids_order, full_incidents, id_field):
def sort_summaries_by_ids_order(ids_order, full_incidents, id_field):

@@ -2552,7 +2571,7 @@ def fetch_incidents():

detections = filter_incidents_by_duplicates_and_limit(incidents_res=detections,
last_run=current_fetch_info_detections,
fetch_limit=fetch_limit, id_field='name')
fetch_limit=INCIDENTS_PER_FETCH, id_field='name')
Copy link
Contributor

Choose a reason for hiding this comment

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

is this intended? why?
relevant to the other places it was changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yuvalbenshalom yuvalbenshalom merged commit 8832678 into master Oct 23, 2023
13 of 15 checks passed
@yuvalbenshalom yuvalbenshalom deleted the cs_falcon_sorting_issue branch October 23, 2023 13:02
@yuvalbenshalom yuvalbenshalom restored the cs_falcon_sorting_issue branch October 23, 2023 13:09
yuvalbenshalom added a commit that referenced this pull request Oct 23, 2023
yuvalbenshalom added a commit that referenced this pull request Oct 23, 2023
sapirshuker pushed a commit that referenced this pull request Dec 21, 2023
* fixed the parameter that send as a limit

* update rn

* update test playbook

* Update Packs/CrowdStrikeFalcon/ReleaseNotes/1_11_7.md

Co-authored-by: Shelly Tzohar <[email protected]>

* fixing test playbook

* adding sort incidents by the ids order; fix time field issue

* rename rn

* bump version

* added unitest

* fix rn

* save unitest fix

* save format

* save unitest fix

* update docker

* use created timestamp

* start_time

* RN

* Update Packs/CrowdStrikeFalcon/Integrations/CrowdStrikeFalcon/CrowdStrikeFalcon.py

Co-authored-by: yuvalbenshalom <[email protected]>

* CR

* typo

* fixes

* fixes

* fixes

* fixes

* sort by created

* fixes

* fixes

* simplify

* back to offset

* fix offset

* remove sort

* fixes

* fix

* fixes

* updates

* fix offset calc

* fix

* move calculate new offset

* fix tests

* fix

* update limit

* fixes

---------

Co-authored-by: daryakoval <[email protected]>
Co-authored-by: Darya Koval <[email protected]>
Co-authored-by: Shelly Tzohar <[email protected]>
Co-authored-by: yuvalbenshalom <[email protected]>
sapirshuker pushed a commit that referenced this pull request Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants