diff --git a/bin/lib/Tag.py b/bin/lib/Tag.py index 71172d8f..a3dfe9ea 100755 --- a/bin/lib/Tag.py +++ b/bin/lib/Tag.py @@ -28,6 +28,8 @@ r_tags = config_loader.get_db_conn("Kvrocks_Tags") r_cache = config_loader.get_redis_conn("Redis_Cache") config_loader = None +TAGS_TO_EXCLUDE_FROM_DASHBOARD = {'infoleak:submission="crawler"', 'infoleak:submission="manual"'} + #### CORE FUNCTIONS #### # # # # UNSAFE TAGS # # # # @@ -712,8 +714,9 @@ def add_object_tag(tag, obj_type, obj_id, subtype=''): # STATS r_tags.hincrby(f'daily_tags:{datetime.date.today().strftime("%Y%m%d")}', tag, 1) mess = f'{int(time.time())}:{obj_type}:{subtype}:{obj_id}' - r_tags.lpush('dashboard:tags', mess) - r_tags.ltrim('dashboard:tags', 0, 19) + if tag not in TAGS_TO_EXCLUDE_FROM_DASHBOARD: + r_tags.lpush('dashboard:tags', mess) + r_tags.ltrim('dashboard:tags', 0, 19) def get_tags_dashboard(): return r_tags.lrange('dashboard:tags', 0, -1) diff --git a/bin/modules/Tags.py b/bin/modules/Tags.py index 0f613eae..513d0fb7 100755 --- a/bin/modules/Tags.py +++ b/bin/modules/Tags.py @@ -5,7 +5,7 @@ The Tags Module ================================ -This module add tags to an item. +This module add tags to an object. """ @@ -36,11 +36,11 @@ class Tags(AbstractModule): self.logger.info(f'Module {self.module_name} initialized') def compute(self, message): - item = self.obj + obj = self.obj tag = message # Create a new tag - item.add_tag(tag) + obj.add_tag(tag) print(f'{self.obj.get_global_id()}: Tagged {tag}') # Forward message to channel