MISP-Taxii-Server/misp_taxii_hooks/hooks.py

27 lines
627 B
Python
Raw Normal View History

2016-11-18 10:28:00 +01:00
#!/usr/bin/env python3
import pymisp
from opentaxii.signals import (
CONTENT_BLOCK_CREATED, INBOX_MESSAGE_CREATED
)
## CONFIG
def post_stix(manager, content_block, collection_ids, service_id):
CONFIG = {
"MISP_URL" : "localhost",
"MISP_API" : "DEADBEEF",
}
2016-11-18 10:28:00 +01:00
MISP = pymisp.PyMISP(
CONFIG["MISP_URL"],
CONFIG["MISP_API"],
)
2016-11-18 10:28:00 +01:00
with open("/tmp/test.txt", "w") as f:
f.write("connect!")
2016-11-18 10:28:00 +01:00
print("Content: {}".format(content_block.content))
CONTENT_BLOCK_CREATED.connect(post_stix)