From 213c3fd36fc0389e3b4c66c877b1f4c37ba8f087 Mon Sep 17 00:00:00 2001 From: nicolas pelletier Date: Wed, 26 Apr 2023 20:15:48 +0200 Subject: [PATCH 1/4] diagnostic: fix malformed print format string --- diagnostic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diagnostic.py b/diagnostic.py index 0368256..59c87f0 100755 --- a/diagnostic.py +++ b/diagnostic.py @@ -388,7 +388,7 @@ def check_server_listening(spinner): try: r = requests.get(url) except requests.exceptions.ConnectionError: - return (False, 'Can\'t connect to {}').format(url) + return (False, 'Can\'t connect to {}'.format(url)) if '/error_page' in r.url: o = urlparse(r.url) From b762733f95ebcfe8ce5ecee45fdbbf33c7daa707 Mon Sep 17 00:00:00 2001 From: nicolas pelletier Date: Wed, 26 Apr 2023 20:17:25 +0200 Subject: [PATCH 2/4] Fix bug due to Leaflet old version 1.2.0 (replace by 1.9.3) --- install_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_dependencies.sh b/install_dependencies.sh index 39f94f4..77b038b 100755 --- a/install_dependencies.sh +++ b/install_dependencies.sh @@ -127,7 +127,7 @@ mv temp/startbootstrap-sb-admin-2-${SBADMIN_VERSION}/bower_components/font-aweso mv temp/startbootstrap-sb-admin-2-${SBADMIN_VERSION}/bower_components/bootstrap/fonts/* ./static/fonts # leaflet -LEAFLET_VERSION="1.2.0" +LEAFLET_VERSION="1.9.3" wget http://cdn.leafletjs.com/leaflet/v${LEAFLET_VERSION}/leaflet.zip -O temp/leaflet.zip unzip -o temp/leaflet.zip -d temp/ From 480e339cedc5787e9269c8c6ded87f8b19442be4 Mon Sep 17 00:00:00 2001 From: nicolas pelletier Date: Wed, 26 Apr 2023 20:28:35 +0200 Subject: [PATCH 3/4] start_all.sh: Run zmq tool if it's not running + remove launch start_zmq.sh under 'zmqs' user --- start_all.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/start_all.sh b/start_all.sh index 5895794..014ab57 100755 --- a/start_all.sh +++ b/start_all.sh @@ -93,5 +93,12 @@ else echo -e $RED"\t* NOT starting flask server, made a very unrealiable check on port 8001, and something seems to be thereā€¦ please double check if this is good!"$DEFAULT fi +ps auxw |grep mispzmq.py |grep -v grep ; check_zmq_tool=$? + sleep 0.1 -sudo -u zmqs /bin/bash ${DIR}/start_zmq.sh & +if [ "${check_zmq_tool}" == "1" ]; then + echo -e "MISP zmq tool is not currently running" + sudo -b su -c "/var/www/MISP/venv/bin/python /var/www/MISP/app/files/scripts/mispzmq/mispzmq.py" +fi +sleep 0.1 +${DIR}/start_zmq.sh & From a636f14ca115fc1184917a953b5bd51d83f6a9a6 Mon Sep 17 00:00:00 2001 From: nicolas pelletier Date: Wed, 26 Apr 2023 20:33:02 +0200 Subject: [PATCH 4/4] Fix tag apparition in Chart log panel + Fix attribute category panel bug --- server.py | 4 ++++ static/js/index/index.js | 14 ++++++++------ static/js/index/index_lineChart.js | 12 +++++++----- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/server.py b/server.py index 6b45af2..5388221 100755 --- a/server.py +++ b/server.py @@ -328,9 +328,13 @@ class EventMessage(): if self.name == 'Attribute': self.feed = jsonMsg['log'] self.feed = LogItem(self.feed, filters).get_row() + if (self.feed[2]): + self.feed[2]['data'] = json.dumps(self.feed[2]['data']) elif self.name == 'ObjectAttribute': self.feed = jsonMsg['log'] self.feed = LogItem(self.feed, filters).get_row() + if (self.feed[2]): + self.feed[2]['data'] = json.dumps(self.feed[2]['data']) else: self.feed = jsonMsg['log'] diff --git a/static/js/index/index.js b/static/js/index/index.js index ca63f63..d318e61 100644 --- a/static/js/index/index.js +++ b/static/js/index/index.js @@ -174,7 +174,7 @@ $(document).ready(function () { livelog = new $.livelog($("#divLogTable"), { pollingFrequency: 5000, tableHeader: head, - tableMaxEntries: 50, + tableMaxEntries: 300, // animate: false, preDataURL: urlForLogs, endpoint: urlForLogs @@ -194,9 +194,9 @@ function updateLogTable(name, log, zmqName, ignoreLed) { ledmanager.updateKeepAlive(zmqName); } - // only add row for attribute - if (name == "Attribute" ) { - var categName = log[toPlotLocationLog]; + // add row for attribute and Object attribute + if (name == "Attribute" || name == "ObjectAttribute") { + var categName = log[3]; sources.addIfNotPresent(categName); sources.incCountOnSource(categName); sources.incCountOnSource('global'); @@ -209,6 +209,7 @@ function updateLogTable(name, log, zmqName, ignoreLed) { } + function slideAndMax(orig, newData) { var slided = []; var max = newData; @@ -335,7 +336,8 @@ function createHead(callback) { var $toRet; if (typeof data === 'object') { $toRet = $(''); - data.data.forEach(function(cur, i) { + let tagList = JSON.parse(data.data); + tagList.forEach(function(cur, i) { switch (data.name) { case 'Tag': var $tag = $(''); @@ -841,7 +843,7 @@ $(document).ready(function() { $panel.removeClass('liveLogFullScreen'); $this.data('isfullscreen', false); $panel.find('#divLogTable').css({'overflow': 'hidden'}); - livelog.changeOptions({tableMaxEntries: 50}); + livelog.changeOptions({tableMaxEntries: 300}); } }); diff --git a/static/js/index/index_lineChart.js b/static/js/index/index_lineChart.js index b505635..6406b50 100644 --- a/static/js/index/index_lineChart.js +++ b/static/js/index/index_lineChart.js @@ -1,5 +1,5 @@ var updateIntervalDirect = 1000*2; // 2s -var updateInterval = 1000*60*60*graph_log_refresh_rate; // 1h +var updateInterval = 1000*60*60*graph_log_refresh_rate; // 1 hour var maxNumPoint = hours_spanned+1; var optionsLineChart = { @@ -8,7 +8,7 @@ var optionsLineChart = { lines: { fill: true, fillColor: { - colors: [ { opacity: 1 }, { opacity: 0.1 } ] + colors: [ { opacity: 0.1 }, { opacity: 0.1 } ] } } }, @@ -17,14 +17,15 @@ var optionsLineChart = { xaxis: { min: 0, max: maxNumPoint }, ticks: maxNumPoint+1, points: { show: true }, - lines: { show: true, fill: true }, + lines: { show: true, fill: true, lineDashType: "dash"}, grid: { tickColor: "#dddddd", borderWidth: 0 }, legend: { show: true, - position: "nw" + position: "nw", + dockInsidePlotArea: true } }; @@ -51,7 +52,8 @@ function updateChartDirect() { plotLineChart.getOptions().yaxes[0].max = sources.getGlobalMax(); plotLineChart.setupGrid(); plotLineChart.draw(); - //setTimeout(updateChartDirect, updateIntervalDirect); + setTimeout(updateChartDirect, updateIntervalDirect); + } updateChartDirect()