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:
|
||||
self.addGenericTrending('TRENDINGS_TAGS', tag, timestamp)
|
||||
|
||||
def addSightings(self, event, categName, timestamp):
|
||||
pass
|
||||
def addSightings(self, timestamp):
|
||||
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 '''
|
||||
|
||||
|
|
|
@ -232,6 +232,9 @@ def handler_sighting(zmq_name, jsondata):
|
|||
action = None
|
||||
handleContribution(zmq_name, org, 'Sighting', categ, action, pntMultiplier=2)
|
||||
handler_attribute(zmq_name, jsonsight, hasAlreadyBeenContributed=True)
|
||||
|
||||
trendings_helper.addSightings()
|
||||
trendings_helper.addFalsePositive()
|
||||
|
||||
def handler_event(zmq_name, jsonobj):
|
||||
#fields: threat_level_id, id, info
|
||||
|
|
Loading…
Reference in New Issue