mirror of https://github.com/MISP/misp-dashboard
parent
6c58cbcfec
commit
9d4cdd7e16
8
clean.py
8
clean.py
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from pprint import pprint
|
||||
import os
|
||||
import redis
|
||||
import configparser
|
||||
import argparse
|
||||
import configparser
|
||||
import os
|
||||
from pprint import pprint
|
||||
|
||||
import redis
|
||||
|
||||
RED="\033[91m"
|
||||
GREEN="\033[92m"
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
#!/usr/bin/env python3.5
|
||||
|
||||
import os, sys, json
|
||||
import datetime, time
|
||||
import redis
|
||||
import configparser
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import redis
|
||||
|
||||
import util
|
||||
from helpers import contributor_helper
|
||||
|
|
|
@ -63,11 +63,11 @@ class Users_helper:
|
|||
else:
|
||||
break # timestamps should be sorted, no need to process anymore
|
||||
return to_return
|
||||
|
||||
|
||||
|
||||
# return: All dates for all orgs, if date is not supplied, return for all dates
|
||||
def getUserLogins(self, date=None):
|
||||
# get all orgs and retreive their timestamps
|
||||
# get all orgs and retrieve their timestamps
|
||||
dates = []
|
||||
for org in self.getAllOrg():
|
||||
keyname = "{}:{}".format(self.keyOrgLog, org)
|
||||
|
@ -169,7 +169,7 @@ class Users_helper:
|
|||
data = [data[6]]+data[:6]
|
||||
return data
|
||||
|
||||
# return: a dico of the form {login: [[timestamp, count], ...], contrib: [[timestamp, 1/0], ...]}
|
||||
# return: a dico of the form {login: [[timestamp, count], ...], contrib: [[timestamp, 1/0], ...]}
|
||||
# either for all orgs or the supplied one
|
||||
def getUserLoginsAndContribOvertime(self, date, org=None, prev_days=6):
|
||||
dico_hours_contrib = {}
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
#!/usr/bin/env python3.5
|
||||
import redis
|
||||
import requests
|
||||
import shutil
|
||||
import json
|
||||
import math
|
||||
import sys, os
|
||||
import os
|
||||
import shlex
|
||||
import shutil
|
||||
import sys
|
||||
import time
|
||||
from subprocess import PIPE, Popen
|
||||
import shlex
|
||||
|
||||
import redis
|
||||
import requests
|
||||
|
||||
URL_OPEN_MAP = "http://tile.openstreetmap.org/{zoom}/{x}/{y}.png"
|
||||
MAP_DIR = "static/maps/"
|
24
server.py
24
server.py
|
@ -1,21 +1,21 @@
|
|||
#!/usr/bin/env python3
|
||||
from flask import Flask, render_template, request, Response, jsonify, stream_with_context
|
||||
import json
|
||||
import redis
|
||||
import random, math
|
||||
import configparser
|
||||
import datetime
|
||||
import json
|
||||
import logging
|
||||
import math
|
||||
import os
|
||||
import random
|
||||
from time import gmtime as now
|
||||
from time import sleep, strftime
|
||||
import datetime
|
||||
import os
|
||||
import logging
|
||||
|
||||
import redis
|
||||
|
||||
import util
|
||||
from helpers import geo_helper
|
||||
from helpers import contributor_helper
|
||||
from helpers import users_helper
|
||||
from helpers import trendings_helper
|
||||
from helpers import live_helper
|
||||
from flask import (Flask, Response, jsonify, render_template, request,
|
||||
stream_with_context)
|
||||
from helpers import (contributor_helper, geo_helper, live_helper,
|
||||
trendings_helper, users_helper)
|
||||
|
||||
configfile = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config/config.cfg')
|
||||
cfg = configparser.ConfigParser()
|
||||
|
|
|
@ -145,7 +145,7 @@ function getTextColour(rgb) {
|
|||
}
|
||||
}
|
||||
|
||||
// If json (from tag), only retreive the name> otherwise return the supplied arg.
|
||||
// If json (from tag), only retrieve the name> otherwise return the supplied arg.
|
||||
function getOnlyName(potentialJson) {
|
||||
try {
|
||||
jsonLabel = JSON.parse(potentialJson);
|
||||
|
|
3
util.py
3
util.py
|
@ -1,5 +1,6 @@
|
|||
import datetime
|
||||
import time
|
||||
from collections import defaultdict
|
||||
import datetime, time
|
||||
|
||||
ONE_DAY = 60*60*24
|
||||
|
||||
|
|
|
@ -1,23 +1,22 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import time, datetime
|
||||
import copy
|
||||
import logging
|
||||
import zmq
|
||||
import redis
|
||||
import random
|
||||
import configparser
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
import configparser
|
||||
import copy
|
||||
import datetime
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import random
|
||||
import sys
|
||||
import time
|
||||
|
||||
import redis
|
||||
import zmq
|
||||
|
||||
import util
|
||||
from helpers import geo_helper
|
||||
from helpers import contributor_helper
|
||||
from helpers import users_helper
|
||||
from helpers import trendings_helper
|
||||
from helpers import live_helper
|
||||
from helpers import (contributor_helper, geo_helper, live_helper,
|
||||
trendings_helper, users_helper)
|
||||
|
||||
configfile = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config/config.cfg')
|
||||
cfg = configparser.ConfigParser()
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import time, datetime
|
||||
import zmq
|
||||
import logging
|
||||
import redis
|
||||
import configparser
|
||||
import argparse
|
||||
import configparser
|
||||
import datetime
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import time
|
||||
|
||||
import redis
|
||||
import zmq
|
||||
|
||||
configfile = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config/config.cfg')
|
||||
cfg = configparser.ConfigParser()
|
||||
|
|
Loading…
Reference in New Issue