mirror of https://github.com/MISP/misp-dashboard
Moved more to config
parent
ef01072944
commit
d80aa1e7a3
|
@ -45,7 +45,6 @@ function updateChart() {
|
||||||
updateChart()
|
updateChart()
|
||||||
|
|
||||||
function updateChartDirect() {
|
function updateChartDirect() {
|
||||||
console.log(sources.toArrayDirect());
|
|
||||||
plotLineChart.setData(sources.toArrayDirect());
|
plotLineChart.setData(sources.toArrayDirect());
|
||||||
plotLineChart.getOptions().yaxes[0].max = sources.getGlobalMax();
|
plotLineChart.getOptions().yaxes[0].max = sources.getGlobalMax();
|
||||||
plotLineChart.setupGrid();
|
plotLineChart.setupGrid();
|
||||||
|
|
|
@ -49,21 +49,6 @@ table {
|
||||||
margin-right:auto;
|
margin-right:auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
.panel-body {
|
|
||||||
padding: 0px;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
.panel-default {
|
|
||||||
border-color: #ddd;
|
|
||||||
border-top-color: rgb(221, 221, 221);
|
|
||||||
border-right-color: rgb(221, 221, 221);
|
|
||||||
border-bottom-color: #fff0;
|
|
||||||
border-left-color: rgb(221, 221, 221);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
small {
|
small {
|
||||||
font-size: 100%;
|
font-size: 100%;
|
||||||
|
|
|
@ -67,24 +67,21 @@ def default_keepalive(jsonevent):
|
||||||
|
|
||||||
def default_event(jsonevent):
|
def default_event(jsonevent):
|
||||||
print('sending', 'event')
|
print('sending', 'event')
|
||||||
|
#fields: threat_level_id, id, info
|
||||||
jsonevent = jsonevent['Event']
|
jsonevent = jsonevent['Event']
|
||||||
to_push = [
|
to_push = []
|
||||||
jsonevent['threat_level_id'],
|
for field in json.loads(cfg.get('Log', 'fieldname_order'))[1:]:
|
||||||
jsonevent['id'],
|
to_push.append(jsonevent[field])
|
||||||
jsonevent['info'],
|
|
||||||
]
|
|
||||||
to_send = { 'name': 'Event', 'log': json.dumps(to_push) }
|
to_send = { 'name': 'Event', 'log': json.dumps(to_push) }
|
||||||
redis_server.publish(channel, json.dumps(to_send))
|
redis_server.publish(channel, json.dumps(to_send))
|
||||||
|
|
||||||
def default_attribute(jsonattr):
|
def default_attribute(jsonattr):
|
||||||
print('sending', 'attribute')
|
print('sending', 'attribute')
|
||||||
jsonattr = jsonattr['Attribute']
|
jsonattr = jsonattr['Attribute']
|
||||||
to_push = [
|
to_push = []
|
||||||
jsonattr['id'],
|
for field in json.loads(cfg.get('Log', 'fieldname_order'))[1:]:
|
||||||
jsonattr['category'],
|
to_push.append(jsonattr[field])
|
||||||
jsonattr['type'],
|
|
||||||
jsonattr['value'],
|
|
||||||
]
|
|
||||||
|
|
||||||
#try to get coord
|
#try to get coord
|
||||||
if jsonattr['category'] == "Network activity":
|
if jsonattr['category'] == "Network activity":
|
||||||
|
@ -129,25 +126,6 @@ def main():
|
||||||
content.replace(b'\n', b'') # remove \n...
|
content.replace(b'\n', b'') # remove \n...
|
||||||
process_log(content)
|
process_log(content)
|
||||||
|
|
||||||
def log_feed():
|
|
||||||
with open('misp-zmq.2', 'ba') as f:
|
|
||||||
|
|
||||||
while True:
|
|
||||||
time.sleep(1.0)
|
|
||||||
content = socket.recv()
|
|
||||||
content.replace(b'\n', b'') # remove \n...
|
|
||||||
f.write(content)
|
|
||||||
f.write(b'\n')
|
|
||||||
print(content)
|
|
||||||
#redis_server.publish(channel, content)
|
|
||||||
|
|
||||||
#if random.randint(1,10)<5:
|
|
||||||
# time.sleep(0.5)
|
|
||||||
# redis_server.publish(channel, content)
|
|
||||||
|
|
||||||
#if random.randint(1,10)<5:
|
|
||||||
# time.sleep(0.5)
|
|
||||||
# redis_server.publish(channel, content)
|
|
||||||
|
|
||||||
dico_action = {
|
dico_action = {
|
||||||
"misp_json": default_event,
|
"misp_json": default_event,
|
||||||
|
|
Loading…
Reference in New Issue