From d26b55973ca1acf3b60b5a0f9de7b1907fe10389 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Tue, 25 Jun 2019 14:55:03 +0200 Subject: [PATCH] fix: [MISP export] fix event creation --- var/www/modules/PasteSubmit/Flask_PasteSubmit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/www/modules/PasteSubmit/Flask_PasteSubmit.py b/var/www/modules/PasteSubmit/Flask_PasteSubmit.py index 3b8ea8bd..f8f55f83 100644 --- a/var/www/modules/PasteSubmit/Flask_PasteSubmit.py +++ b/var/www/modules/PasteSubmit/Flask_PasteSubmit.py @@ -211,7 +211,7 @@ def misp_create_event(distribution, threat_level_id, analysis, info, l_tags, pub leak_obj.add_attribute('duplicate_number', value=p_duplicate_number, type='counter') try: - templateID = [x['ObjectTemplate']['id'] for x in pymisp.get_object_templates_list() if x['ObjectTemplate']['name'] == obj_name][0] + templateID = [x['ObjectTemplate']['id'] for x in pymisp.get_object_templates_list()['response'] if x['ObjectTemplate']['name'] == obj_name][0] except IndexError: valid_types = ", ".join([x['ObjectTemplate']['name'] for x in pymisp.get_object_templates_list()]) print ("Template for type {} not found! Valid types are: {%s}".format(obj_name, valid_types))