Merge remote-tracking branch 'upstream/master'

Resyncing with upstream
pull/38/head
Sami Mokaddem 2018-02-22 10:13:04 +01:00
commit fdcc02c77a
4 changed files with 21 additions and 8 deletions

View File

@ -23,9 +23,9 @@ An experimental dashboard showing live data and statistics from the ZMQ of one o
- Be sure to have a running redis server - Be sure to have a running redis server
- e.g. ```redis-server -p 6250``` - e.g. ```redis-server -p 6250```
- Activate your virtualenv ```. ./DASHENV/bin/activate``` - Activate your virtualenv ```. ./DASHENV/bin/activate```
- Listen to the MISP feed by starting the zmq_subscriber ```./zmq_subscriber.py``` - Listen to the MISP feed by starting the zmq_subscriber ```./zmq_subscriber.py &```
- Start the dispatcher to process received messages ```./zmq_dispatcher.py``` - Start the dispatcher to process received messages ```./zmq_dispatcher.py &```
- Start the Flask server ```./server.py``` - Start the Flask server ```./server.py &```
- Access the interface at ```http://localhost:8001/``` - Access the interface at ```http://localhost:8001/```
# Debug # Debug

View File

@ -218,9 +218,11 @@ def trendings():
maxNum = int(maxNum) maxNum = int(maxNum)
except: except:
maxNum = 15 maxNum = 15
url_misp_event = cfg.get('RedisGlobal', 'misp_web_url')
return render_template('trendings.html', return render_template('trendings.html',
maxNum=maxNum maxNum=maxNum,
url_misp_event=url_misp_event
) )
''' INDEX ''' ''' INDEX '''

View File

@ -416,10 +416,11 @@ function updateDisc() {
}); });
} }
var items_timeline = [];
function updateTimeline() { function updateTimeline() {
var selected = $( "#timeline_selector" ).val(); var selected = $( "#timeline_selector" ).val();
$.getJSON( url_getGenericTrendingOvertime+"?dateS="+parseInt(dateStart.getTime()/1000)+"&dateE="+parseInt(dateEnd.getTime()/1000)+"&choice="+selected, function( data ) { $.getJSON( url_getGenericTrendingOvertime+"?dateS="+parseInt(dateStart.getTime()/1000)+"&dateE="+parseInt(dateEnd.getTime()/1000)+"&choice="+selected, function( data ) {
var items = []; items_timeline = [];
var groups = new vis.DataSet(); var groups = new vis.DataSet();
var dico_groups = {}; var dico_groups = {};
var i = 1; var i = 1;
@ -431,25 +432,34 @@ function updateTimeline() {
dico_groups[obj.name] = g; dico_groups[obj.name] = g;
g++; g++;
} }
items.push({ items_timeline.push({
id: i, id: i,
content: getOnlyName(obj.name), content: getOnlyName(obj.name),
title: obj.name,
start: obj.start*1000, start: obj.start*1000,
end: obj.end*1000, end: obj.end*1000,
group: dico_groups[obj.name] group: dico_groups[obj.name]
}); });
i++; i++;
} }
items = new vis.DataSet(items); items_timeline = new vis.DataSet(items_timeline);
if (timeline === undefined) { // create timeline if (timeline === undefined) { // create timeline
timeline = new vis.Timeline(document.getElementById('timeline')); timeline = new vis.Timeline(document.getElementById('timeline'));
// set listener for tooltip
timeline.on('doubleClick', function (properties) {
var type = $( "#timeline_selector" ).val();
var itemValue = items_timeline.get(properties.item).content;
if (type.localeCompare('events') == 0 || type.localeCompare('tags') == 0) { // Do not open a tab for categ
window.open(url_misp+'/'+type+'/index/searchall:'+itemValue, '_blank'); // as we do not have index for the moment, search it
}
});
} }
var dateEndExtended = new Date(dateEnd).setDate(dateEnd.getDate()+1); // dateEnd+1 var dateEndExtended = new Date(dateEnd).setDate(dateEnd.getDate()+1); // dateEnd+1
timeline_option.start = dateStart; timeline_option.start = dateStart;
timeline_option.end = dateEndExtended; timeline_option.end = dateEndExtended;
timeline.setOptions(timeline_option); timeline.setOptions(timeline_option);
timeline.setGroups(groups); timeline.setGroups(groups);
timeline.setItems(items); timeline.setItems(items_timeline);
}); });
} }

View File

@ -248,6 +248,7 @@ small {
var url_getGenericTrendingOvertime = "{{ url_for('getGenericTrendingOvertime') }}"; var url_getGenericTrendingOvertime = "{{ url_for('getGenericTrendingOvertime') }}";
var url_getTypeaheadData = "{{ url_for('getTypeaheadData') }}"; var url_getTypeaheadData = "{{ url_for('getTypeaheadData') }}";
var url_misp = "{{ url_misp_event }}";
/* DATA FROM CONF */ /* DATA FROM CONF */