From ac4cb1c00223d332018cfb0089d77ec4317c6e3f Mon Sep 17 00:00:00 2001 From: merit-maita Date: Wed, 20 Nov 2024 13:55:13 +0200 Subject: [PATCH 1/2] added logs --- Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.py b/Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.py index 2764b36c6a5b..7c41ebd66803 100644 --- a/Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.py +++ b/Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.py @@ -61,6 +61,7 @@ def filter_previously_fetched_indicators(indicators: list, last_run: dict) -> li last_run["latest_indicators"] = [{obj.get('rawJSON', {}).get("id"): obj.get('rawJSON', {}).get("modified")} if obj.get("value") != "$$DummyIndicator$$" else obj for obj in indicators] + demisto.debug("with first fetch, updated the latest_indicators") return indicators for indicator in indicators: indicator_id = indicator.get("rawJSON", {}).get('id', "") @@ -71,9 +72,13 @@ def filter_previously_fetched_indicators(indicators: list, last_run: dict) -> li # if the indicator is stored in latest_indicators -> check if it was modified if saved_indicator: modified_date = saved_indicator[0].get(indicator_id) + if not modified_date or not indicator.get("rawJSON", {}).get("modified" ""): + demisto.debug(f"we got saved indicator with id:{indicator_id}") + demisto.debug(f"the rawjson of it is: {indicator.get('rawJSON')}") + demisto.debug(f"saved indicator is: {saved_indicator}") # the indicator is stored in latest_indicators, but got modified -> add to new_indicators - if indicator.get("rawJSON", {}).get("modified", "") > modified_date: + if indicator.get("rawJSON", {}).get("modified" "") > modified_date: new_indicators.append(indicator) else: skipped_indicators.append(indicator_id) From 0124ebb4b8ac4847efbe30373adb8c02d820c3ef Mon Sep 17 00:00:00 2001 From: merit-maita Date: Mon, 25 Nov 2024 10:54:48 +0200 Subject: [PATCH 2/2] fix --- Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.py b/Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.py index 7c41ebd66803..f1e54ec9f2b9 100644 --- a/Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.py +++ b/Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.py @@ -78,7 +78,7 @@ def filter_previously_fetched_indicators(indicators: list, last_run: dict) -> li demisto.debug(f"saved indicator is: {saved_indicator}") # the indicator is stored in latest_indicators, but got modified -> add to new_indicators - if indicator.get("rawJSON", {}).get("modified" "") > modified_date: + if indicator.get("rawJSON", {}).get("modified", "") > modified_date: new_indicators.append(indicator) else: skipped_indicators.append(indicator_id)