From 4b8c26dec8b5d72ef75f062a06ace2e5d9c50bd4 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Tue, 24 Jul 2018 14:46:35 +0200 Subject: [PATCH] fix: [hive auto export] fix #221 --- bin/MISP_The_Hive_feeder.py | 1 + .../modules/PasteSubmit/Flask_PasteSubmit.py | 21 ++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/bin/MISP_The_Hive_feeder.py b/bin/MISP_The_Hive_feeder.py index 1b85ea88..d9daa299 100755 --- a/bin/MISP_The_Hive_feeder.py +++ b/bin/MISP_The_Hive_feeder.py @@ -164,6 +164,7 @@ if __name__ == "__main__": except thehive4py.exceptions.AlertException: HiveApi = False flag_the_hive = False + r_serv_db.set('ail:thehive', False) print('Not connected to The HIVE') while True: diff --git a/var/www/modules/PasteSubmit/Flask_PasteSubmit.py b/var/www/modules/PasteSubmit/Flask_PasteSubmit.py index 34e8c458..cb404d2f 100644 --- a/var/www/modules/PasteSubmit/Flask_PasteSubmit.py +++ b/var/www/modules/PasteSubmit/Flask_PasteSubmit.py @@ -503,29 +503,26 @@ def edit_tag_export(): else: status_misp.append(False) - # empty whitelist - if whitelist_hive == 0: - for tag in list_export_tags: + for tag in list_export_tags: + if r_serv_db.sismember('whitelist_hive', tag): status_hive.append(True) - else: - for tag in list_export_tags: - if r_serv_db.sismember('whitelist_hive', tag): - status_hive.append(True) - else: - status_hive.append(False) - - if (misp_auto_events is not None) and (hive_auto_alerts is not None): + else: + status_hive.append(False) + if misp_auto_events is not None: if int(misp_auto_events) == 1: misp_active = True else: misp_active = False + else: + misp_active = False + + if hive_auto_alerts is not None: if int(hive_auto_alerts) == 1: hive_active = True else: hive_active = False else: - misp_active = False hive_active = False nb_tags = str(r_serv_db.scard('list_export_tags'))