Debug after testing, everything works great now
This commit is contained in:
parent
73946c27e2
commit
926daf3e34
@ -92,6 +92,7 @@ class MISP(object):
|
|||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
def update_sync(misp_id):
|
def update_sync(misp_id):
|
||||||
"""
|
"""
|
||||||
Update the last synchronization date by the actual date.
|
Update the last synchronization date by the actual date.
|
||||||
@ -117,7 +118,7 @@ class MISP(object):
|
|||||||
try:
|
try:
|
||||||
# Connect to MISP instance and get network activity attributes.
|
# Connect to MISP instance and get network activity attributes.
|
||||||
m = PyMISP(misp.url, misp.apikey, misp.verifycert)
|
m = PyMISP(misp.url, misp.apikey, misp.verifycert)
|
||||||
r = m.search("attributes", category="Network activity", date_from=misp.lastsync)
|
r = m.search("attributes", category="Network activity", date_from=int(misp.last_sync))
|
||||||
except:
|
except:
|
||||||
print("Unable to connect to the MISP instance ({}/{}).".format(misp.url, misp.apikey))
|
print("Unable to connect to the MISP instance ({}/{}).".format(misp.url, misp.apikey))
|
||||||
return []
|
return []
|
||||||
|
@ -130,6 +130,7 @@ def watch_misp():
|
|||||||
for ioc in misp.get_iocs(inst["id"]):
|
for ioc in misp.get_iocs(inst["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(inst["id"]))
|
||||||
|
misp.update_sync(inst["id"])
|
||||||
instances.pop(i)
|
instances.pop(i)
|
||||||
if instances: time.sleep(60)
|
if instances: time.sleep(60)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user