Merge pull request #8 from RichieB2B/ncsc-nl/fix-zmq
Bring ZeroMQ in line with the use of ZMQ topics in MISP 2.4.75pull/14/head
commit
3e36ffd1d4
|
@ -45,13 +45,20 @@ cli.set_auth(username = config["taxii"]["auth"]["username"],
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
# Wait for something to come in on the ZMQ socket
|
# 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!")
|
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...")
|
log.debug("Processing...")
|
||||||
|
payload = message[len(topic)+1:]
|
||||||
|
|
||||||
# Load the message JSON
|
# Load the message JSON
|
||||||
msg = json.loads(message)
|
msg = json.loads(payload)
|
||||||
|
|
||||||
log.debug(msg)
|
log.debug(msg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue