diff --git a/Packs/CrowdStrikeFalcon/Integrations/CrowdStrikeFalcon/CrowdStrikeFalcon.py b/Packs/CrowdStrikeFalcon/Integrations/CrowdStrikeFalcon/CrowdStrikeFalcon.py index c3a1e22de94f..f846248e490e 100644 --- a/Packs/CrowdStrikeFalcon/Integrations/CrowdStrikeFalcon/CrowdStrikeFalcon.py +++ b/Packs/CrowdStrikeFalcon/Integrations/CrowdStrikeFalcon/CrowdStrikeFalcon.py @@ -1539,7 +1539,7 @@ def get_detections(last_behavior_time=None, behavior_id=None, filter_arg=None): text_to_encode += f"+{filter_arg}" endpoint_url += urllib.parse.quote_plus(text_to_encode) demisto.debug(f"In get_detections: {LEGACY_VERSION =} and {endpoint_url=}") - return http_request('GET', endpoint_url) + return http_request('GET', endpoint_url, {'sort': 'created_timestamp.asc'}) else: endpoint_url = '/detects/queries/detects/v1' demisto.debug(f"In get_detections: {LEGACY_VERSION =} and {endpoint_url=} and {params=}") @@ -1555,8 +1555,9 @@ def get_fetch_detections(last_created_timestamp=None, filter_arg=None, offset: i Returns: Response json of the get detection endpoint (IDs of the detections) """ + sort_key = 'first_behavior.asc' if LEGACY_VERSION else 'created_timestamp.asc' params = { - 'sort': 'first_behavior.asc', + 'sort': sort_key, 'offset': offset, } if has_limit: diff --git a/Packs/CrowdStrikeFalcon/Integrations/CrowdStrikeFalcon/CrowdStrikeFalcon_test.py b/Packs/CrowdStrikeFalcon/Integrations/CrowdStrikeFalcon/CrowdStrikeFalcon_test.py index 0357ae94a67b..a3f47297f978 100644 --- a/Packs/CrowdStrikeFalcon/Integrations/CrowdStrikeFalcon/CrowdStrikeFalcon_test.py +++ b/Packs/CrowdStrikeFalcon/Integrations/CrowdStrikeFalcon/CrowdStrikeFalcon_test.py @@ -7210,7 +7210,7 @@ def test_error_handler(): @pytest.mark.parametrize('Legacy_version, url_suffix, expected_len', [ (False, "alerts/queries/alerts/v2?filter=product%3A%27epp%27%2Btype%3A%27ldt%27%2Bcreated_timestamp%3A%3E%272024-06-19T15%3A25%3A00Z%27", - 2), + 3), (True, '/detects/queries/detects/v1', 3) ]) def test_get_detection___url_and_params(mocker, Legacy_version, url_suffix, expected_len): @@ -7269,7 +7269,7 @@ def test_resolve_detection(mocker, Legacy_version, tag, url_suffix, data): @pytest.mark.parametrize('Legacy_version, url_suffix, request_params', [ (False, "/alerts/queries/alerts/v2?filter=product%3A%27epp%27%2Btype%3A%27ldt%27%2Bupdated_timestamp%3A%3E%272024-06-19T15%3A25%3A00Z%27", - {'sort': 'first_behavior.asc', 'offset': 5, 'limit': 3}), + {'sort': 'created_timestamp.asc', 'offset': 5, 'limit': 3}), (True, '/detects/queries/detects/v1', {'sort': 'first_behavior.asc', 'offset': 5, 'limit': 3, 'filter': "date_updated:>'2024-06-19T15:25:00Z'"}) ]) diff --git a/Packs/CrowdStrikeFalcon/ReleaseNotes/2_0_22.md b/Packs/CrowdStrikeFalcon/ReleaseNotes/2_0_22.md new file mode 100644 index 000000000000..8263af666d03 --- /dev/null +++ b/Packs/CrowdStrikeFalcon/ReleaseNotes/2_0_22.md @@ -0,0 +1,6 @@ + +#### Integrations + +##### CrowdStrike Falcon + +Fixed an issue where detections were fetched unsorted in the post-Raptor release. diff --git a/Packs/CrowdStrikeFalcon/pack_metadata.json b/Packs/CrowdStrikeFalcon/pack_metadata.json index 6dc113f2310e..e242ece759dd 100644 --- a/Packs/CrowdStrikeFalcon/pack_metadata.json +++ b/Packs/CrowdStrikeFalcon/pack_metadata.json @@ -2,7 +2,7 @@ "name": "CrowdStrike Falcon", "description": "The CrowdStrike Falcon OAuth 2 API (formerly the Falcon Firehose API), enables fetching and resolving detections, searching devices, getting behaviors by ID, containing hosts, and lifting host containment.", "support": "xsoar", - "currentVersion": "2.0.21", + "currentVersion": "2.0.22", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "",