From 61db1d22249718940e6a93f17c7f2d4dcacba378 Mon Sep 17 00:00:00 2001 From: Hannah Ward Date: Fri, 16 Jun 2017 12:28:10 +0100 Subject: [PATCH] fix: Make it work with array vals --- misp_taxii_hooks/hooks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misp_taxii_hooks/hooks.py b/misp_taxii_hooks/hooks.py index 4511932..ca98fd8 100644 --- a/misp_taxii_hooks/hooks.py +++ b/misp_taxii_hooks/hooks.py @@ -55,7 +55,7 @@ def post_stix(manager, content_block, collection_ids, service_id): values = [x.value for x in package.attributes] for attrib in values: print("CHECKING {}".format(attrib)) - search = MISP.search("attributes", values=attrib) + search = MISP.search("attributes", values=str(attrib)) if search["response"] != []: # This means we have it! package.attributes.pop([x.value for x in package.attributes].index(attrib)) @@ -64,6 +64,7 @@ def post_stix(manager, content_block, collection_ids, service_id): # TODO: There's probably a proper method to do this rather than json_full # But I don't wanna read docs if (len(package.attributes) > 0): + print(package.attributes[0].value) MISP.add_event(package._json_full()) # Make TAXII call our push function whenever it gets new data