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)