From 8832e67c533a510f0b67582840631032b280ad16 Mon Sep 17 00:00:00 2001 From: Richard van den Berg Date: Thu, 1 Jun 2017 16:12:54 +0200 Subject: [PATCH] Bring ZeroMQ in line with the use of ZMQ topics in MISP 2.4.75 --- scripts/push_published_to_taxii.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/push_published_to_taxii.py b/scripts/push_published_to_taxii.py index bb3e9ad..62be789 100644 --- a/scripts/push_published_to_taxii.py +++ b/scripts/push_published_to_taxii.py @@ -45,13 +45,20 @@ cli.set_auth(username = config["taxii"]["auth"]["username"], while True: # Wait for something to come in on the ZMQ socket - message = socket.recv().decode("utf-8")[10:] - + message = socket.recv().decode("utf-8") log.info("Recieved a message!") + topic = message.split(' ', 1)[0] + + if topic != 'misp_json': + log.info("Ignoring " + topic + "...") + continue + + # Process the JSON payload log.debug("Processing...") + payload = message[len(topic)+1:] # Load the message JSON - msg = json.loads(message) + msg = json.loads(payload) log.debug(msg)