From 2fadbc8b87d26aa1d05c3b1eb3f3accf92439155 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Fri, 9 Sep 2022 11:25:51 +0200 Subject: [PATCH] chg: [trackers] add warnings logs --- bin/trackers/Tracker_Regex.py | 1 + bin/trackers/Tracker_Term.py | 4 ++-- bin/trackers/Tracker_Typo_Squatting.py | 1 + bin/trackers/Tracker_Yara.py | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/trackers/Tracker_Regex.py b/bin/trackers/Tracker_Regex.py index a5d4b4e9..acf29eb1 100755 --- a/bin/trackers/Tracker_Regex.py +++ b/bin/trackers/Tracker_Regex.py @@ -74,6 +74,7 @@ class Tracker_Regex(AbstractModule): item_date = item.get_date() item_source = item.get_source() print(f'new tracked regex found: {tracker} in {item_id}') + self.redis_logger.warning(f'new tracked regex found: {tracker} in {item_id}') for tracker_uuid in uuid_list: # Source Filtering diff --git a/bin/trackers/Tracker_Term.py b/bin/trackers/Tracker_Term.py index 7cfdc9b7..7fa60c3b 100755 --- a/bin/trackers/Tracker_Term.py +++ b/bin/trackers/Tracker_Term.py @@ -113,14 +113,14 @@ class Tracker_Term(AbstractModule): nb_uniq_word += 1 if nb_uniq_word >= nb_words_threshold: self.new_term_found(word_set, 'set', item) - + def new_term_found(self, term, term_type, item): uuid_list = Term.get_term_uuid_list(term, term_type) item_id = item.get_id() item_date = item.get_date() item_source = item.get_source() - self.redis_logger.info(f'new tracked term found: {term} in {item_id}') + self.redis_logger.warning(f'new tracked term found: {term} in {item_id}') print(f'new tracked term found: {term} in {item_id}') for term_uuid in uuid_list: tracker_sources = Tracker.get_tracker_uuid_sources(term_uuid) diff --git a/bin/trackers/Tracker_Typo_Squatting.py b/bin/trackers/Tracker_Typo_Squatting.py index 6f2d3a4d..34116beb 100755 --- a/bin/trackers/Tracker_Typo_Squatting.py +++ b/bin/trackers/Tracker_Typo_Squatting.py @@ -67,6 +67,7 @@ class Tracker_Typo_Squatting(AbstractModule): item_source = item.get_source() #self.redis_logger.info(f'new tracked typo found: {tracker} in {item_id}') print(f'new tracked typosquatting found: {tracker} in {item_id}') + self.redis_logger.warning(f'tracker typosquatting: {tracker} in {item_id}') print(Tracker.get_tracker_uuid_list(tracker, tracker_type)) for tracker_uuid in Tracker.get_tracker_uuid_list(tracker, tracker_type): diff --git a/bin/trackers/Tracker_Yara.py b/bin/trackers/Tracker_Yara.py index 3b23fbee..ab0a5310 100755 --- a/bin/trackers/Tracker_Yara.py +++ b/bin/trackers/Tracker_Yara.py @@ -60,7 +60,7 @@ class Tracker_Yara(AbstractModule): try: yara_match = self.rules.match(data=item_content, callback=self.yara_rules_match, which_callbacks=yara.CALLBACK_MATCHES, timeout=60) if yara_match: - self.redis_logger.info(f'{self.item.get_id()}: {yara_match}') + self.redis_logger.warning(f'tracker yara: new match {self.item.get_id()}: {yara_match}') print(f'{self.item.get_id()}: {yara_match}') except yara.TimeoutError as e: print(f'{self.item.get_id()}: yara scanning timed out')