mirror of https://github.com/MISP/misp-dashboard
feature: Draft of sightings support
parent
ec3ec66fa7
commit
bacde8e71f
|
@ -28,8 +28,17 @@ class Trendings_helper:
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
self.addGenericTrending('TRENDINGS_TAGS', tag, timestamp)
|
self.addGenericTrending('TRENDINGS_TAGS', tag, timestamp)
|
||||||
|
|
||||||
def addSightings(self, event, categName, timestamp):
|
def addSightings(self, timestamp):
|
||||||
pass
|
timestampDate = datetime.datetime.fromtimestamp(float(timestamp))
|
||||||
|
timestampDate_str = util.getDateStrFormat(timestampDate)
|
||||||
|
keyname = "{}:{}".format("TRENDINGS_SIGHT_sightings", timestampDate_str)
|
||||||
|
self.serv_redis_db.incrby(keyname, 1)
|
||||||
|
|
||||||
|
def addFalsePositive(self, timestamp):
|
||||||
|
timestampDate = datetime.datetime.fromtimestamp(float(timestamp))
|
||||||
|
timestampDate_str = util.getDateStrFormat(timestampDate)
|
||||||
|
keyname = "{}:{}".format("TRENDINGS_SIGHT_false_positive", timestampDate_str)
|
||||||
|
self.serv_redis_db.incrby(keyname, 1)
|
||||||
|
|
||||||
''' GETTER '''
|
''' GETTER '''
|
||||||
|
|
||||||
|
|
|
@ -233,6 +233,9 @@ def handler_sighting(zmq_name, jsondata):
|
||||||
handleContribution(zmq_name, org, 'Sighting', categ, action, pntMultiplier=2)
|
handleContribution(zmq_name, org, 'Sighting', categ, action, pntMultiplier=2)
|
||||||
handler_attribute(zmq_name, jsonsight, hasAlreadyBeenContributed=True)
|
handler_attribute(zmq_name, jsonsight, hasAlreadyBeenContributed=True)
|
||||||
|
|
||||||
|
trendings_helper.addSightings()
|
||||||
|
trendings_helper.addFalsePositive()
|
||||||
|
|
||||||
def handler_event(zmq_name, jsonobj):
|
def handler_event(zmq_name, jsonobj):
|
||||||
#fields: threat_level_id, id, info
|
#fields: threat_level_id, id, info
|
||||||
jsonevent = jsonobj['Event']
|
jsonevent = jsonobj['Event']
|
||||||
|
|
Loading…
Reference in New Issue