Commit bded237b authored by Luca Lamorte's avatar Luca Lamorte

Integrated Privacy Report

parent 2f611655
{"anomalies": 2, "is_final": true, "version": "0.0.1", "conversation": [{"anomalies": [{"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}, {"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}, {"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}, {"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}, {"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}, {"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}, {"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}, {"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}, {"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}, {"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}, {"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}, {"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}, {"protocol": "eth:ethertype:ip:udp:coap:data-text-lines", "direction": "source", "privacy_tag": "PERSON", "detected_token": "Luca", "pkt_id": "257", "timestamp": "Mar 6, 2017 18:18:44.051799000 CET", "device": "10.41.7.221"}], "id": "10.41.7.221", "size": 1378.0}, {"anomalies": [], "id": "10.187.64.43", "size": 910.0}], "packets": {"257": {"_type": "pcap_file", "_index": "packets-2017-05-12", "_source": {"layers": {"ip": {"ip.flags_raw": "00", "ip.len": "92", "ip.host": "10.41.7.221", "ip.host_raw": "0a2907dd", "ip.addr": "10.41.7.221", "ip.addr_raw": "0a2907dd", "ip.flags": {"ip.flags.mf_raw": "00", "ip.flags.rb_raw": "00", "ip.flags.rb": "0", "ip.flags.df": "0", "ip.flags.mf": "0", "ip.flags.df_raw": "00"}, "ip.src_raw": "0abb402b", "ip.dst_raw": "0a2907dd", "ip.len_raw": "005c", "ip.src": "10.187.64.43", "ip.src_host_raw": "0abb402b", "Destination GeoIP: Unknown": "", "ip.proto_raw": "11", "ip.checksum": "0x0000f9f0", "ip.version_raw": "4", "ip.version": "4", "ip.id_raw": "23b5", "ip.checksum.status": "2", "Source GeoIP: Unknown": "", "ip.dsfield_raw": "00", "ip.dst_host": "10.41.7.221", "ip.hdr_len": "20", "ip.dst_host_raw": "0a2907dd", "ip.id": "0x000023b5", "ip.dst": "10.41.7.221", "ip.ttl": "64", "ip.hdr_len_raw": "45", "ip.ttl_raw": "40", "ip.frag_offset_raw": "0000", "ip.dsfield": {"ip.dsfield.dscp_raw": "0", "ip.dsfield.dscp": "0", "ip.dsfield.ecn_raw": "0", "ip.dsfield.ecn": "0"}, "ip.checksum_raw": "f9f0", "ip.frag_offset": "0", "ip.proto": "17", "ip.src_host": "10.187.64.43"}, "ip_raw": "4500005c23b500004011f9f00abb402b0a2907dd", "eth_raw": "00000c9ff2d4f45c89adfd130800", "coap_raw": "4002f30fbc6c617267652d637265617465ff4c75636120697320776f726b696e672061742074686520556e6976657273697479206f66204c7578656d62757267", "frame_raw": "00000c9ff2d4f45c89adfd1308004500005c23b500004011f9f00abb402b0a2907ddc4ce1633004826244002f30fbc6c617267652d637265617465ff4c75636120697320776f726b696e672061742074686520556e6976657273697479206f66204c7578656d62757267", "eth": {"eth.type": "0x00000800", "eth.src": {"eth.lg_raw": "0", "eth.src_resolved_raw": "f45c89adfd13", "eth.addr": "f4:5c:89:ad:fd:13", "eth.src_resolved": "f4:5c:89:ad:fd:13", "eth.addr_resolved_raw": "f45c89adfd13", "eth.ig_raw": "0", "eth.lg": "0", "eth.addr_raw": "f45c89adfd13", "eth.ig": "0", "eth.addr_resolved": "f4:5c:89:ad:fd:13"}, "eth.type_raw": "0800", "eth.src_raw": "f45c89adfd13", "eth.dst": {"eth.lg_raw": "0", "eth.addr_resolved": "00:00:0c:9f:f2:d4", "eth.dst_resolved": "00:00:0c:9f:f2:d4", "eth.addr": "00:00:0c:9f:f2:d4", "eth.addr_resolved_raw": "00000c9ff2d4", "eth.ig_raw": "0", "eth.lg": "0", "eth.addr_raw": "00000c9ff2d4", "eth.ig": "0", "eth.dst_resolved_raw": "00000c9ff2d4"}, "eth.dst_raw": "00000c9ff2d4"}, "frame": {"frame.time_epoch": "1488820724.051799000", "frame.time_delta_displayed": "1.852966000", "frame.len": "106", "frame.time_relative": "12.082063000", "frame.marked": "0", "frame.offset_shift": "0.000000000", "frame.time": "Mar 6, 2017 18:18:44.051799000 CET", "frame.protocols": "eth:ethertype:ip:udp:coap:data-text-lines", "frame.ignored": "0", "frame.time_delta": "1.852966000", "frame.cap_len": "106", "frame.encap_type": "1", "frame.number": "257"}, "udp_raw": "c4ce163300482624", "coap": {"coap.opt.name_raw": "bc6c617267652d637265617465", "coap.opt.end_marker": "255", "coap.opt.name": {"coap.opt.desc": "Type 11, Critical, Unsafe", "coap.opt.length": "12", "coap.opt.delta_raw": "B", "coap.opt.desc_raw": "bc6c617267652d637265617465", "coap.opt.delta": "11", "coap.opt.uri_path": "large-create", "coap.opt.length_raw": "C", "coap.opt.uri_path_raw": "6c617267652d637265617465"}, "coap.payload_raw": "4c75636120697320776f726b696e672061742074686520556e6976657273697479206f66204c7578656d62757267", "coap.mid_raw": "f30f", "coap.code": "2", "coap.token_len_raw": "0", "coap.version": "1", "coap.opt.end_marker_raw": "ff", "coap.token_len": "0", "coap.payload": {"coap.opt.payload_desc_raw": "4c75636120697320776f726b696e672061742074686520556e6976657273697479206f66204c7578656d62757267", "data-text-lines_raw": "4c75636120697320776f726b696e672061742074686520556e6976657273697479206f66204c7578656d62757267", "data-text-lines": {"Luca is working at the University of Luxemburg": ""}, "coap.opt.payload_desc": "text/plain; charset=utf-8"}, "coap.code_raw": "02", "coap.version_raw": "1", "coap.type": "0", "coap.type_raw": "0", "coap.mid": "62223"}, "udp": {"udp.dstport": "5683", "udp.dstport_raw": "1633", "udp.srcport": "50382", "udp.checksum": "0x00002624", "udp.port_raw": "1633", "udp.srcport_raw": "c4ce", "udp.port": "5683", "udp.checksum.status": "2", "udp.length": "72", "udp.stream": "2", "udp.checksum_raw": "2624", "udp.length_raw": "0048"}}}, "_score": null}}, "byte_exchanged": 2288.0, "type": "Anomalies Report", "timestamp": 1494597639.051329, "testing_tool": "Privacy Testing Tool", "status": "positive", "protocols": ["coap"]}
import loggingimport errnoimport os VERSION = '0.0.1'COMPONENT_ID = "gui_tt" ALLOWED_EXTENSIONS = set(['json', 'pcap'])RABBIT_MQ_CONNECTED = False logger = logging.getLogger(__name__)logger.setLevel(logging.DEBUG)sh = logging.StreamHandler()sh.setFormatter(logging.Formatter('%(asctime)s - %(name)-1s:%(lineno)d\t - %(levelname)s - %(message)s'))sh.setLevel(logging.DEBUG)logger.addHandler(sh) project_dir = os.path.abspath(os.path.join(os.path.realpath(__file__), os.pardir)) # Set WS LOGs level ERROR werklog = logging.getLogger('werkzeug') werklog.setLevel(logging.ERROR) if '/testing_tool_gui' in project_dir: project_dir = os.path.abspath(os.path.join(project_dir, os.pardir)) TMPDIR = os.path.join(project_dir, 'tmp') DATADIR = os.path.join(project_dir, 'data') UPLOAD_FOLDER = TMPDIR # generate dirs for d in TMPDIR, DATADIR: try: os.makedirs(d) except OSError as e: if e.errno != errno.EEXIST: raise try: AMQP_EXCHANGE = str(os.environ['AMQP_EXCHANGE']) except KeyError as e: logger.debug('Couldnt import AMQP_EXCHANGE from environment') AMQP_EXCHANGE = "default" try: AMQP_URL = str(os.environ['AMQP_URL']) except KeyError as e: print('Couldnt import AMQP_URL from environment') # TODO: REMOVE PERSONAL CONFIGURATION ## AMQP_URL = "amqp://guest:guest@localhost/" ## AMQP_URL = str(os.getenv('AMQP_URL', 'amqp://luca:luca@finterop1/session1'))
\ No newline at end of file
import loggingimport errnoimport os VERSION = '0.0.1'COMPONENT_ID = "gui_tt" ALLOWED_EXTENSIONS = set(['json', 'pcap'])RABBIT_MQ_CONNECTED = False logger = logging.getLogger(__name__)logger.setLevel(logging.DEBUG)sh = logging.StreamHandler()sh.setFormatter(logging.Formatter('%(asctime)s - %(name)-15s:%(lineno)d - %(levelname)s - %(message)s'))sh.setLevel(logging.DEBUG)logger.addHandler(sh) project_dir = os.path.abspath(os.path.join(os.path.realpath(__file__), os.pardir)) # Set WS LOGs level ERROR werklog = logging.getLogger('werkzeug') werklog.setLevel(logging.ERROR) if '/testing_tool_gui' in project_dir: project_dir = os.path.abspath(os.path.join(project_dir, os.pardir)) TMPDIR = os.path.join(project_dir, 'tmp') DATADIR = os.path.join(project_dir, 'data') UPLOAD_FOLDER = TMPDIR # generate dirs for d in TMPDIR, DATADIR: try: os.makedirs(d) except OSError as e: if e.errno != errno.EEXIST: raise try: AMQP_EXCHANGE = str(os.environ['AMQP_EXCHANGE']) except KeyError as e: logger.debug('Couldnt import AMQP_EXCHANGE from environment') AMQP_EXCHANGE = "default" try: AMQP_URL = str(os.environ['AMQP_URL']) except KeyError as e: print('Couldnt import AMQP_URL from environment') # TODO: REMOVE PERSONAL CONFIGURATION ## AMQP_URL = "amqp://guest:guest@localhost/" ## AMQP_URL = str(os.getenv('AMQP_URL', 'amqp://luca:luca@finterop1/session1'))
\ No newline at end of file
......
import base64
from flask import Flask
from flask import render_template, flash
from flask import request, redirect, url_for
......@@ -12,11 +14,13 @@ from testing_tool_gui.utils.messages import *
from testing_tool_gui.gui.amqp_sniffer import AmqpSniffer
from testing_tool_gui.gui.utils import *
from testing_tool_gui.gui import UPLOAD_FOLDER, ALLOWED_EXTENSIONS
from testing_tool_gui.gui import logger
from testing_tool_gui.gui.render_html import create_device_table
from werkzeug.utils import secure_filename
from werkzeug.utils import secure_filename
logger = logging.getLogger(__name__)
my_channel = None
amqp_listener = None
......@@ -153,7 +157,7 @@ def configuration():
else:
global app_cfg
logger.info(" [GET] CONFIGUTATION : %s" %repr(app_cfg))
logger.info(" [GET] CONFIGURATION : %s" %repr(app_cfg))
response = app.response_class(
response=json.dumps(app_cfg.get()),
status=200,
......@@ -162,18 +166,30 @@ def configuration():
return response
# @app.route('/verdict')
# def verdicts():
# verdict = amqp_listener.get_verdict()
# if verdict:
# return create_device_table(verdict)
# else:
# return ""
@app.route('/verdict/<type>')
def verdicts(type):
global amqp_listener
if type == "html":
verdict = amqp_listener.get_verdict()
if verdict:
return create_device_table(verdict)
else:
return ""
else:
response = app.response_class(
response=amqp_listener.get_verdict(),
status=200,
mimetype='application/json'
)
return response
@app.route('/upload', methods=['POST'])
def upload():
global app_cfg
logger.info("Upload files...")
if request.method == 'POST':
if 'file' not in request.files:
......@@ -201,14 +217,15 @@ def upload():
)
logger.info("Message ready, PCAP bytes: \n" + repr(msg))
publish_message(app_cfg.get_channel(), msg)
logger.info("Sending Request through AMQP interface ...")
publish_message(my_channel, msg)
return redirect("/", code=302)
else:
logger.warn("You need to send a POST!!!")
return redirect("/", code=404)
return redirect("/", code=302)
if __name__ == '__main__':
logger.debug("Start App listening on port 8080")
socketio.run(app, port=8080)
......@@ -40,7 +40,7 @@ class AmqpSniffer(threading.Thread):
self.channel.basic_qos(prefetch_count=1)
self.channel.basic_consume(self.on_request, queue=services_queue_name)
self.verdict = None
self.name = 'AmqpSniffer'
def stop(self):
......@@ -50,10 +50,7 @@ class AmqpSniffer(threading.Thread):
logger.debug("Sniffer stopped!")
def on_request(self, ch, method, props, body):
# obj hook so json.loads respects the order of the fields sent -just for visualization purposeses-
# if str(body) == 'Hello World':
# print("Strange message received:"+body)
# return
req_body_dict = json.loads(body.decode('utf-8'), object_pairs_hook=OrderedDict)
ch.basic_ack(delivery_tag=method.delivery_tag)
logger.info("Message sniffed: %s, body: %s" % (json.dumps(req_body_dict), str(body)))
......@@ -99,8 +96,13 @@ class AmqpSniffer(threading.Thread):
amqp_msg["body"] = dict()
amqp_msg["body"].update(req_body_dict)
# TODO: this should be managed by the GUI in JS
if req_body_dict["_type"] == "privacy.analyze.reply":
self.verdict = req_body_dict["verdict"]
try:
self.socketio.emit("amqp_msg", json.dumps(amqp_msg), namespace="/ws")
except Exception as err:
logger.error(" print error: %s" %err)
......@@ -115,17 +117,9 @@ class AmqpSniffer(threading.Thread):
logger.debug("no < _type > field found")
logger.debug('* * * * * * * * * * * * * * * * * * * * * ')
def get_message(self):
return self.messages
def get_verdict(self):
return self.verdict
def clear_verdict(self):
self.verdict.clear()
def clear_messages(self):
self.messages.clear()
def run(self):
......
This diff is collapsed.
......@@ -25,6 +25,7 @@ $(document).ready(function() {
socket.on('amqp_msg', function (msg) {
amqpToHtml(msg).prependTo("#messages")
$("#total_msg").html(parseInt($("#total_msg").html())+1)
checkPrivacyMessage(msg)
});
socket.on('info', function (msg) {
......@@ -61,9 +62,70 @@ $(document).ready(function() {
read_configuration(data)
});
$.get( "/verdict/json", function( data ) {
if (data == "")
return
console.log(data)
var issues = parseInt(data["anomalies"])
$("#privacy_alert").removeClass( "hide" );
$("#num_issues").html(issues + " Privacy Issues")
});
});
/*******************************************************************
*
* PRIVACY SECTION - FUNCTION FOR PRIVACY
*
/*******************************************************************/
function checkPrivacyMessage(msg){
console.log("Privacy Check")
var data = JSON.parse(msg)
console.log("RK: "+ data["routing_key"])
if (data["routing_key"].includes("privacy"))
console.log(msg)
if (data["routing_key"] == "control.privacy.service.reply" ) {
$("#loading_analyze").addClass("hide")
var verdict_json = data["body"]["verdict"]
var verdict = JSON.parse(verdict_json)
var issues = parseInt(verdict["anomalies"])
console.log(verdict_json)
console.log("ISSUE:"+issues)
$("#show_short_report").removeClass("fade")
if (issues == 0) {
$("#p_issue").html("Privacy Issue Free")
$("#show_short_report").removeClass("btn-warning")
$("#show_short_report").addClass("btn-success")
}
else {
$("#p_issue").html(issues + " Privacy Issues")
$("#privacy_alert").removeClass( "hide" );
$("#num_issues").html(issues + " Privacy Issues")
}
}
}
function show_verdict(){
$.get( "verdict/html", function( data ) {
$( "#info").html( data );
});
}
function showDetails(value){
......
......@@ -20,7 +20,9 @@ $(document).on('change', "#pcap_file", function(e){
else
$("#send_file_amqp").addClass("fade");
$("#file_path_display").html($("#pcap_file").val())
var filename = $('#pcap_file').prop("files")[0]['name']
$("#file_path_display").html(filename)
});
......@@ -32,46 +34,29 @@ $(document).on('click', "#send_file_amqp", function(e) {
send_alert("File not valid", "File with ."+ext+ " are not supported", 'danger')
return
}
$.ajax({
type: 'POST',
url: '/upload',
data: new FormData($('form')[0]),
processData: false, // important
contentType: false, // important
success: function(response) {
send_alert("Success","AMQP Message Sent! Analysis will start soon...")
send_alert("success","AMQP Message Sent! Analysis will start soon...")
$("#send_file_amqp").addClass("fade")
$("#loading_analyze").removeClass("fade")
},
error: function(error) {
send_alert("Fail",error , 'danger')
error: function(request, status, error) {
send_alert("Fail", request.responseText , 'danger')
},
});
return false;
});
// function submit_pcap(e) {
// e.preventDefault();
// $.ajax({
// type: 'POST',
// url: '/upload_file',
// //data: new FormData($('form')[0]),
// processData: false, // important
// contentType: false, // important
// dataType : 'json',
// data: myFormData,
//
// success: function(response) {
// console.log(response);
// },
// error: function(error) {
// console.log(error);
// },
//
// });
// return false;
// }
function addTestCase(testcase){
// var index = parseInt(testcase)
......@@ -133,74 +118,4 @@ function addTestCase(testcase){
});
}
$(':file').on('change', function() {
var file = this.files[0];
if (file.size > 1024) {
alert('max upload size is 1k')
}
// Also see .name, .type
});
// function select_pcap(){
//
// var filename = $("#pcap_file").val()
// $("#upload-file-info").html(filename);
// if (filename!=""){
//
// var analyze = $("<button>").attr("type", "button").addClass("btn btn-danger")
// analyze.attr("id", "analyze-pcap")
// analyze.html("Analyze...")
// analyze.click(function(){
// $.ajax({
// type: 'POST',
// url: '/upload',
// data: new FormData($('form')[0]),
// enctype: 'multipart/form-data',
// contentType: false,
// cache: false,
// processData: false,
// async: false,
//
// // // Custom XMLHttpRequest
// // xhr: function() {
// // var myXhr = $.ajaxSettings.xhr();
// // if (myXhr.upload) {
// // // For handling the progress of the upload
// // myXhr.upload.addEventListener('progress', function(e) {
// // if (e.lengthComputable) {
// // $('progress').attr({
// // value: e.loaded,
// // max: e.total,
// // });
// // }
// // } , false);
// // }
// // return myXhr;
// // },
//
// });
//
//
// })
// var cancel = $("<button>").attr("type", "button").addClass("btn btn-default")
// cancel.html("Reset")
// cancel.click(function(){
// $("#cmq_area").html("");
// $("#upload-file-info").html("");
// });
//
// $("#cmq_area").append(analyze).append(" ")
// $("#cmq_area").append(cancel)
//
//
// }
// else{
// $("#cmq_area").html("")
// }
//
// }
......@@ -96,4 +96,10 @@ footer {
font-size: 100%;
height: 100%;
}
}
.yellow
{
color:#f0ad4e !important;
}
\ No newline at end of file
......@@ -15,75 +15,6 @@
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='favicon.ico')}}">
<script type=text/javascript>
// function cleanMsg(){
// $.get('/clear_console', function(){
// $('#messages').html("")
// });
//
// }
//
// function cleanAll(){
// cleanMsg();
// cleanReport();
// }
//
// function cleanReport(){
// $.get('/clear_report', function(){
// $('#verdict').html("")
// })
// }
//
// function sendMessage(messageType){
// $.get('/send_msg/'+messageType, function(data){
// if (data == "KO")
// alert("Unable to send the message!")
//
// });
//
// }
// (function verdict() {
// $.get('verdict', function(data) {
// if (data != "[]")
// $('#verdict').html(data);
// setTimeout(verdict, 1000);
// })
// })();
//
// // Use a named immediately-invoked function expression.
// (function worker() {
// $.get('/messages', function(data) {
// // Now that we've completed the request schedule the next
//
//// var token = "'";
//// var newToken = '"';
//// data = data.split(token).join(newToken)
//// var token = "_type";
//// var newToken = 'type';
//// data = data.split(token).join(newToken)
////
//// var token = "True";
//// var newToken = '"True"';
//// data = data.split(token).join(newToken)
////
//// var token = "False";
//// var newToken = '"False"';
//// data = data.split(token).join(newToken)
////
//// console.log(data)
//// var msg = JSON.parse(data);
//// var output = ""
//// for(var i=0; i < msg.length; i++) {
//// output += "<a href='#' class='list-group-item'> RK: "+ msg[i].routing_key + " type: "+msg[i].type + " ==> "+JSON.stringify(msg[i]) +"</a>"
////
//// }
// $('#messages').html(data);
// setTimeout(worker, 1000);
// });
// })();
</script>
</head>
......@@ -132,6 +63,12 @@
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="hide" id="privacy_alert">
<a href="#" class="yellow" onclick="show_verdict()">
<span class="glyphicon glyphicon-warning-sign"></span>
<span id="num_issues"> </span>
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-cog"></span>
......@@ -166,7 +103,7 @@
<li><a href="#"> Orchestrator<input type="text" class="form-control" aria-label="..." id="orcherstrator_url"></a></li>
</ul>
</li>§
</li>
</ul>
</ul>
</div>
......@@ -177,101 +114,18 @@
<div class="container" id="info">
<h1>Demo GUI!</h1>
<p>This is a a simple GUI to play with <a href-="http://www.finterop.eu">F-Interop</a> APIs and
<p>This is a a simple GUI to play with <a href-="http://www.finterop.eu">F-Interop</a> APIs and
Testing Tools (TT) . It includes a Event Bus (RabbitMQ) console and the AMQP Messages Utils.
Use it as a starting point to test your component.
</p>
<!--<div class="row">-->
<!--<div class="col-md-1 ">-->
<!--<span class="label label-primary">TEST CASE 1</span>-->
<!--</div>-->
<!--<div class="col-md-11">-->
<!--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut-->
<!--labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris-->
<!--nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit-->
<!--esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt-->
<!--in culpa qui officia deserunt mollit anim id est laborum.</p>-->
<!--<div class="row">-->
<!--<div class="col-md-3">-->
<!--<span> Analyze IUT Conversation (CoAP) </span>-->
<!--<span class="glyphicon glyphicon-phone" aria-hidden="true"></span>-->
<!--<div style="position:relative;">-->
<!--<a class='btn btn-primary' href='javascript:;'>-->
<!--Choose File...-->
<!--<input type="file" id="select_pcap" name="file_source" size="40" onchange='select_pcap()'>-->
<!--</a>-->
<!--&nbsp;-->
<!--<span class='label label-info' id="upload-file-info"></span>-->
</p>
<!--</div>-->
<!--</div>-->
<!--<div class="col-md-9 " id="cmq_area">-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div> &lt;!&ndash; END INFO DIV &ndash;&gt;-->
</div>
</div>
</div>
<!--<div class="container">-->
<!--<h3>Privacy Testing Tool - ver 1.0.0</h3><br>-->
<!--<div class="row">-->
<!--<div class="col-sm-3 text-left">-->
<!--<h3>TEST CASE 1</h3>-->
<!--<form action = "uploadajax" method = "POST"-->
<!--enctype = "multipart/form-data">-->
<!--<div class="form-group">-->
<!--<label for="exampleInputFile">Select a PCAP file</label>-->
<!--<input type="file" id="exampleInputFile" name="file" accept="*.pcap">-->
<!--<p class="help-block">The file will analyzed to check any privacy issue.</p>-->
<!--</div>-->
<!--<button type="submit" id="upload-file-btn" class="btn btn-primary">Analyze PCAP file ...</button>-->
<!--</form>-->
<!--</div>-->
<!--<div class="col-sm-3">-->
<!--<h3>TEST CASE 2</h3>-->
<!--<div class="btn-group-vertical" role="group" >-->
<!--<button type="button" class="btn btn-success" onclick="sendMessage('start')">Start Test Suite</button>-->
<!--<button type="button" class="btn btn-danger" onclick="sendMessage('stop')">Stop Test Suite </button>-->
<!--<button type="button" class="btn btn-default" onclick="sendMessage('report')">Get Privacy Report </button>-->
<!--<button type="button" class="btn btn-default" onclick="sendMessage('config')">Get Configuration </button>-->
<!--<button type="button" class="btn btn-default" onclick="testLOG()">TEST </button>-->
<!--</div>-->
<!--</div>-->
<!--<div class="col-sm-6 text-left" id="verdict">-->
<!--&lt;!&ndash;<div class="panel panel-default">&ndash;&gt;-->
<!--&lt;!&ndash;<div class="panel-heading" style="background-color: cadetblue; color:white">Anomalies detected in Device bbbb::1</div>&ndash;&gt;-->
<!--&lt;!&ndash;<table class="table">&ndash;&gt;-->
<!--&lt;!&ndash;<thead>&ndash;&gt;-->
<!--&lt;!&ndash;<tr> <th>#</th> <th>PacketID</th> <th>Token</th> <th>Tag</th> </tr>&ndash;&gt;-->
<!--&lt;!&ndash;</thead>&ndash;&gt;-->
<!--&lt;!&ndash;<tbody>&ndash;&gt;-->
<!--&lt;!&ndash;<tr> <th scope="row">1</th> <td>frame:2:coap</td> <td>Otto</td> <td>Name</td> </tr>&ndash;&gt;-->
<!--&lt;!&ndash;<tr> <th scope="row">2</th> <td>frame:13:coap</td> <td>luca@uni.lu</td> <td>Email</td> </tr>&ndash;&gt;-->
<!--&lt;!&ndash;<tr> <th scope="row">3</th> <td>frame:25</td> <td>Luxembourg</td> <td>Place</td> </tr>&ndash;&gt;-->
<!--&lt;!&ndash;</tbody>&ndash;&gt;-->
<!--&lt;!&ndash;</table>&ndash;&gt;-->
<!--&lt;!&ndash;</div>&ndash;&gt;-->
<!--</div>-->
<!--</div>-->
<div class="row" >
......@@ -313,29 +167,10 @@
</div>
</nav>
<div id="messages" class="console"> </div> <br>
<!--&lt;!&ndash;- CONFIGURATION AREA &ndash;&gt;-->
<!--<div class="row">-->
<!--<div class="col-lg-6">-->
<!--<div class="input-group">-->
<!--<span class="input-group-addon">AMQP_URL</span>-->
<!--<input type="text" class="form-control" aria-label="..." id="amqp_url">-->
<!--</div>&lt;!&ndash; /input-group &ndash;&gt;-->
<!--</div>&lt;!&ndash; /.col-lg-6 &ndash;&gt;-->
<!--<div class="col-lg-4">-->
<!--<div class="input-group">-->
<!--<span class="input-group-addon">EXCHANGE</span>-->
<!--<input type="text" class="form-control" aria-label="..." id="amqp_exchange">-->
<!--</div>&lt;!&ndash; /input-group &ndash;&gt;-->
<!--</div>&lt;!&ndash; /.col-lg-6 &ndash;&gt;-->
<!--&lt;!&ndash;<button type="button" class="btn btn-default" onclick="change_cfg()"> Change Configuration </button>&ndash;&gt;-->
<!--<div class="btn-group col-lg-2" role="group" aria-label="...">-->
<!--<button type="button" class="btn btn-default" onclick="send_alert('TBD!','Not Implemented yet', 'warning')">Change Configuration</button>-->
<!--</div>-->
<!--</div>&lt;!&ndash; /.row &ndash;&gt;-->
<div id="messages" class="console"> </div> <br>
</div> <!-- END CONTAINER-->
</div> <!-- END ROW-->
......
......@@ -11,29 +11,65 @@
<ul>
<li>User MUST provide the PCAP file of IUTs Conversation to check if there is any privacy issue.</li>
<li>Only Wireshark files (<strong>PCAP</strong>) are allowed in this demo (by default there is no file type restriction).</li>
</ul>
</div>
</div>
<!-- FORM -->
<!-- The file upload form used as target for the file upload widget -->
<form method="POST" enctype="multipart/form-data" method="post" action="/upload">
<div class="row">
<div class="col-lg-5">
<form method="POST" enctype="multipart/form-data" method="post" action="/upload">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>Add file...</span>
<input type="file" name="file" id="pcap_file">
</span>
<button class="btn btn-danger start fade" id="send_file_amqp">
<i class="glyphicon glyphicon-upload"></i>
<span>Analyze <span id="file_path_display"></span></span>
</button>
</form>
</div>
<div class="col-lg-7">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>Add file...</span>
<input type="file" name="file" id="pcap_file">
</span>
<button class="btn btn-primary start fade" id="send_file_amqp">
<i class="glyphicon glyphicon-upload"></i>
<span>Check Privacy Issues...</span>
<button class="btn btn-primary start pull-right fade" id="loading_analyze">
<span>Detect privacy issues </span>
<i class="fa fa-spinner fa-spin"></i>
</button>
<button class="btn btn-warning start pull-right fade" id="show_short_report" onclick="show_verdict()">
<i class="glyphicon glyphicon-warning-sign"></i>
<span id="p_issue"> 22 Privacy issues </span>
</button>
</div>
<span id="file_path_display"></span>
</div>
</form>
<!--<div class="row" >-->
<!--<h3>Privacy Report - ver. {0}</h3>-->
<!--<p>Protocols: {0} - Status. {1} - Conversation size: {2} bytes</p>-->
<!--{% for iut in conversation %}<br>-->
<!--<div class ='panel panel-default'>-->
<!--<div class='panel-heading' style='background-color: cadetblue; color:white'>-->
<!--<div class='text-right'><span class='label label-danger'>3 Anomalies</span> </div>-->
<!--</div>-->
<!--<table class='table'>-->
<!--<thead><tr> <th> # </th> <th>PacketID</th> <th>Token</th> <th>Tag</th> </tr></thead>-->
<!--<tbody><tr> <th scope='row'>{0}</th><td>Frame:{1}:coap</td><td>{2}</td><td>{3}</td></tr><tr class=""></tr></tbody>-->