From 3854d829e181beeeb8e3a98633ee315f01ed6a5f Mon Sep 17 00:00:00 2001 From: Hannah Ward Date: Thu, 19 Oct 2017 16:31:06 +0100 Subject: [PATCH] fix: Binary content blocks were messing everything --- 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 d8fcf54..7d3786c 100644 --- a/misp_taxii_hooks/hooks.py +++ b/misp_taxii_hooks/hooks.py @@ -9,6 +9,7 @@ import pymisp import tempfile import logging from pyaml import yaml +from io import StringIO log = logging.getLogger("__main__") @@ -54,7 +55,7 @@ def post_stix(manager, content_block, collection_ids, service_id): # Load the package log.info("Posting STIX...") - package = pymisp.tools.stix.load_stix(content_block.content) + package = pymisp.tools.stix.load_stix(StringIO(content_block.content.decode())) log.info("STIX loaded succesfully.") values = [x.value for x in package.attributes] log.info("Extracted %s", values)