Updating MISP watcher
This commit is contained in:
parent
436870960d
commit
940d5954a3
@ -125,12 +125,15 @@ def watch_misp():
|
|||||||
instances = [i for i in misp.get_instances()]
|
instances = [i for i in misp.get_instances()]
|
||||||
|
|
||||||
while instances:
|
while instances:
|
||||||
for i, inst in enumerate(instances):
|
for i, ist in enumerate(instances):
|
||||||
if inst["connected"]:
|
status = misp.test_instance(ist["url"],
|
||||||
for ioc in misp.get_iocs(inst["id"]):
|
ist["apikey"],
|
||||||
|
ist["verifycert"])
|
||||||
|
if status:
|
||||||
|
for ioc in misp.get_iocs(ist["id"]):
|
||||||
iocs.add(ioc["type"], ioc["tag"], ioc["tlp"],
|
iocs.add(ioc["type"], ioc["tag"], ioc["tlp"],
|
||||||
ioc["value"], "misp-{}".format(inst["id"]))
|
ioc["value"], "misp-{}".format(ist["id"]))
|
||||||
misp.update_sync(inst["id"])
|
misp.update_sync(ist["id"])
|
||||||
instances.pop(i)
|
instances.pop(i)
|
||||||
if instances: time.sleep(60)
|
if instances: time.sleep(60)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user