You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spot.apache.org by le...@apache.org on 2017/06/23 22:40:52 UTC

[2/5] incubator-spot git commit: Removed all Edge Investigation notebook templates that are no longer used for the scoring process

Removed all Edge Investigation notebook templates that are no longer used for the scoring process


Project: http://git-wip-us.apache.org/repos/asf/incubator-spot/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spot/commit/a63c632d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spot/tree/a63c632d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spot/diff/a63c632d

Branch: refs/heads/apache/SPOT-35_graphql_api
Commit: a63c632d334e3c994912415e1c9f288f021b9f19
Parents: 74a6188
Author: LedaLima <le...@apache.org>
Authored: Thu Jun 22 13:04:35 2017 -0500
Committer: LedaLima <ga...@intel.com>
Committed: Fri Jun 23 17:39:07 2017 -0500

----------------------------------------------------------------------
 .../Edge_Investigation_master.ipynb             | 289 ----------------
 .../Edge_Investigation_master.ipynb             | 345 -------------------
 .../Edge_Investigation_master.ipynb             | 260 --------------
 3 files changed, 894 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/a63c632d/spot-oa/oa/dns/ipynb_templates/Edge_Investigation_master.ipynb
----------------------------------------------------------------------
diff --git a/spot-oa/oa/dns/ipynb_templates/Edge_Investigation_master.ipynb b/spot-oa/oa/dns/ipynb_templates/Edge_Investigation_master.ipynb
deleted file mode 100644
index ef3e10c..0000000
--- a/spot-oa/oa/dns/ipynb_templates/Edge_Investigation_master.ipynb
+++ /dev/null
@@ -1,289 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## Get Suspicious DNS"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "import urllib2\n",
-    "import json\n",
-    "import os \n",
-    "import datetime\n",
-    "\n",
-    "# getting date from the parent path. \n",
-    "path = os.getcwd().split(\"/\") \n",
-    "date = path[len(path)-1]   \n",
-    "dsource = path[len(path)-2]"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "def apply_css_to_select(select):\n",
-    "    select._css = (\n",
-    "        (None, 'height', '90%'),\n",
-    "        (None, 'width', '90%'),\n",
-    "        ('select', 'overflow-x', 'auto'),\n",
-    "        ('select', 'width', '100%'),\n",
-    "        ('select', 'margin', 0)\n",
-    "    )\n",
-    "\n",
-    "try:\n",
-    "    import ipywidgets as widgets # For jupyter/ipython >= 1.4\n",
-    "except ImportError:\n",
-    "    from IPython.html import widgets\n",
-    "from IPython.display import display, HTML, clear_output, Javascript \n",
-    "\n",
-    "def fill_list(list_control,source):\n",
-    "    options_list = ['- Select -'] \n",
-    "    options_list.extend([s for s in source])\n",
-    "    list_control.options = options_list\n",
-    "\n",
-    "# client panel\n",
-    "client_header = widgets.HTML(value=\"Client IP\")\n",
-    "client_select = widgets.Select(height='90%')\n",
-    "apply_css_to_select(client_select)\n",
-    "\n",
-    "client_box = widgets.Box(width='20%', height='100%')\n",
-    "client_box.children = [client_header, client_select]\n",
-    "\n",
-    "# query panel\n",
-    "query_header = widgets.HTML(value=\"Query\")\n",
-    "query_select = widgets.Select(height='90%')\n",
-    "apply_css_to_select(query_select)\n",
-    "\n",
-    "query_box = widgets.Box(width='60%', height='100%')\n",
-    "query_box.children = [query_header, query_select]\n",
-    "\n",
-    "# Actions Panel\n",
-    "actions_header = widgets.HTML(value=\"&nbsp;\")\n",
-    "quick_text = widgets.Text(value='', width='100%', placeholder='Quick scoring')\n",
-    "quick_text._css = (\n",
-    "    (None, 'width', '100%'),\n",
-    ")\n",
-    "rating_btn = widgets.RadioButtons(description='Rating:', options=['1', '2', '3'], width='100%')\n",
-    "assign_btn = widgets.Button(description='Score', width='45%')\n",
-    "assign_btn.button_style = 'primary'\n",
-    "save_btn = widgets.Button(description='Save', width='45%')\n",
-    "save_btn.button_style = 'primary'\n",
-    "save_btn._css = (\n",
-    "    (None, 'margin-left', '10%'),\n",
-    ")\n",
-    "actions_box = widgets.Box(width='20%', height='100%')\n",
-    "actions_box.children = [actions_header,quick_text,rating_btn, assign_btn,save_btn]\n",
-    "\n",
-    "scoring_form = widgets.HBox(width='90%', height=250)\n",
-    "scoring_form.children = [client_box,query_box,actions_box]\n",
-    "\n",
-    "rest_msg_box = widgets.HTML()\n",
-    "\n",
-    "global score_values \n",
-    "\n",
-    "score_values = []\n",
-    "\n",
-    "def data_loader(): \n",
-    "    us_ips = []\n",
-    "    us_dns = []\n",
-    "    scored = []\n",
-    "    \n",
-    "    global score_values\n",
-    "    query=\"\"\"query($date:SpotDateType!) {\n",
-    "            dns{\n",
-    "                suspicious(date:$date){\n",
-    "                dnsQuery\n",
-    "                clientIp\n",
-    "            }\n",
-    "        }\n",
-    "    }\"\"\"\n",
-    "    variables={\n",
-    "        'date': datetime.datetime.strptime(date, '%Y%m%d').strftime('%Y-%m-%d')\n",
-    "    }\n",
-    "    \n",
-    "    for item in score_values:\n",
-    "        scored.append(item[0])\n",
-    "        scored.append(item[1])\n",
-    "    \n",
-    "    response = GraphQLClient.request(query, variables)\n",
-    "  \n",
-    "    if not 'errors' in response:\n",
-    "        for row in response['data']['dns']['suspicious']:           \n",
-    "            if row['clientIp'] not in us_ips and row['clientIp'] not in scored: \n",
-    "                us_ips.append(row['clientIp'])\n",
-    "            if row['dnsQuery'] not in us_dns and row['dnsQuery'] not in scored:\n",
-    "                us_dns.append(row['dnsQuery'])  \n",
-    "\n",
-    "    fill_list(client_select,us_ips)\n",
-    "    fill_list(query_select,us_dns)\n",
-    "    client_select.value = \"- Select -\"\n",
-    "    query_select.value = \"- Select -\"    \n",
-    "\n",
-    "\n",
-    "display(Javascript(\"$('.widget-area > .widget-subarea > *').remove();\"))\n",
-    "data_loader()\n",
-    "display(scoring_form)"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "# Update Suspicious DNS"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "import csv\n",
-    "import datetime\n",
-    "import subprocess \n",
-    "\n",
-    "\n",
-    "def assign_score(b):\n",
-    "    clear_output()\n",
-    "    sev = int(rating_btn.selected_label) \n",
-    "\n",
-    "    if quick_text.value: \n",
-    "        ip = \"\"\n",
-    "        dns = quick_text.value\n",
-    "        dns_sev = int(rating_btn.selected_label)  \n",
-    "        for query in query_select.options:\n",
-    "            if query.endswith(dns): \n",
-    "                score_values.append((ip,query,sev))\n",
-    "    else: \n",
-    "        ip = client_select.value if not \"- Select -\" in client_select.value else \"\"\n",
-    "        dns = query_select.value if not \"- Select -\" in query_select.value else \"\"\n",
-    "        score_values.append((ip,dns,sev))\n",
-    "        clear_output()\n",
-    "        \n",
-    "    if client_select.value != \"- Select -\":   \n",
-    "        display(Javascript(\"$(\\\"option:nth-of-type(0)[data-value='\" + client_select.value +\"']\\\").remove();\"))\n",
-    "    if quick_text.value:\n",
-    "        display(Javascript(\"$(\\\"option:nth-of-type(1)[data-value$='\" + dns +\"']\\\").remove();\"))\n",
-    "    elif query_select.value != \"- Select -\":\n",
-    "        display(Javascript(\"$(\\\"option:nth-of-type(1)[data-value='\" + query_select.value +\"']\\\").remove();\"))\n",
-    "\n",
-    "    client_select.value = \"- Select -\"\n",
-    "    query_select.value = \"- Select -\"\n",
-    "    quick_text.value = \"\"    \n",
-    "    \n",
-    "    rest_msg_box.visible = False\n",
-    "    data_loader() \n",
-    "    \n",
-    "    print \"Click the 'Save' button when you're finished scoring\" \n",
-    "\n",
-    "        \n",
-    "def reset_scoring():\n",
-    "    response = GraphQLClient.request(\n",
-    "        query=\"\"\"mutation($date:SpotDateType!) {\n",
-    "                dns{\n",
-    "                    resetScoredConnections(date:$date){\n",
-    "                   success\n",
-    "                }\n",
-    "            }\n",
-    "        }\"\"\",\n",
-    "        variables={\n",
-    "            'date': datetime.datetime.strptime(date, '%Y%m%d').strftime('%Y-%m-%d')\n",
-    "        }\n",
-    "    ) \n",
-    "     \n",
-    "    if not 'errors' in response:\n",
-    "        rest_msg_box.value=\"Suspicious connects successfully reset\"\n",
-    "        data_loader()\n",
-    "        rest_msg_box.visible = True\n",
-    "        display(rest_msg_box)\n",
-    "    else:\n",
-    "        print \"An error ocurred: \" + response['errors'][0]['message']\n",
-    "                \n",
-    "        \n",
-    "def save(b):    \n",
-    "    variables=[]\n",
-    "    global score_values\n",
-    "    mutation=\"\"\"mutation($input:[DnsScoreType!]!)\n",
-    "                {\n",
-    "                  dns{\n",
-    "                    score(input:$input)\n",
-    "                        {success}\n",
-    "                  }\n",
-    "                }\"\"\" \n",
-    "    \n",
-    "    for row in score_values:\n",
-    "        variables.append({\n",
-    "            'date': datetime.datetime.strptime(date, '%Y%m%d').strftime('%Y-%m-%d'),\n",
-    "            'clientIp': row[0] if row[0] != \"\" else None,\n",
-    "            'dnsQuery': row[1] if row[1] != \"\" else None,\n",
-    "            'score': row[2] if row[2] != \"\" else None \n",
-    "            })\n",
-    "\n",
-    "    var = {'input':variables}\n",
-    "    response = GraphQLClient.request(mutation,var)\n",
-    "    \n",
-    "    score_values = []\n",
-    "    if not 'errors' in response:\n",
-    "        clear_output()    \n",
-    "        display(Javascript(\"$('.widget-area > .widget-subarea > *').remove();\"))\n",
-    "        data_loader() \n",
-    "        display(scoring_form)\n",
-    "        display(Javascript('reloadParentData();')) \n",
-    "        print \"Suspicious connects successfully updated\"\n",
-    "    else:\n",
-    "        print \"An error ocurred: \" + response['errors'][0]['message']\n",
-    "        \n",
-    "        \n",
-    "assign_btn.on_click(assign_score)\n",
-    "save_btn.on_click(save) "
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": [
-    "# reset_scoring()"
-   ]
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Python 2",
-   "language": "python",
-   "name": "python2"
-  },
-  "language_info": {
-   "codemirror_mode": {
-    "name": "ipython",
-    "version": 2
-   },
-   "file_extension": ".py",
-   "mimetype": "text/x-python",
-   "name": "python",
-   "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython2",
-   "version": "2.7.10"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 0
-}

http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/a63c632d/spot-oa/oa/flow/ipynb_templates/Edge_Investigation_master.ipynb
----------------------------------------------------------------------
diff --git a/spot-oa/oa/flow/ipynb_templates/Edge_Investigation_master.ipynb b/spot-oa/oa/flow/ipynb_templates/Edge_Investigation_master.ipynb
deleted file mode 100644
index 278ebb7..0000000
--- a/spot-oa/oa/flow/ipynb_templates/Edge_Investigation_master.ipynb
+++ /dev/null
@@ -1,345 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "Initialize workflow."
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "import datetime\n",
-    "import struct, socket\n",
-    "import shutil\n",
-    "import numpy as np\n",
-    "import pandas as pd\n",
-    "import linecache, bisect\n",
-    "import csv, json\n",
-    "import operator\n",
-    "import os, time, subprocess \n",
-    "from collections import OrderedDict\n",
-    "\n",
-    "try:\n",
-    "    import ipywidgets as widgets # For jupyter/ipython >= 1.4\n",
-    "except ImportError:\n",
-    "    from IPython.html import widgets\n",
-    "\n",
-    "from IPython.display import display, Javascript, clear_output\n",
-    "\n",
-    "path = os.getcwd().split(\"/\") \n",
-    "date = path[len(path)-1]   \n",
-    "dsource = path[len(path)-2]  \n",
-    "cpath = '/'.join(['context' if var == 'ipynb' else var for var in path][:len(path)-2]) + '/'\n",
-    "\n",
-    "coff = 250;\n",
-    "nwloc = cpath + 'networkcontext.csv' \n",
-    "srcdict,srclist = {},[]\n",
-    "dstdict,dstlist = {},[]\n",
-    "sportdict,sportlist = {},[]\n",
-    "dportdict,dportlist = {},[]\n",
-    "global svals\n",
-    "svals = [] "
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "def apply_css_to_select(select):\n",
-    "    select._css = (\n",
-    "        (None, 'height', '90%'),\n",
-    "        (None, 'width', '90%'),\n",
-    "        ('select', 'overflow-x', 'auto'),\n",
-    "        ('select', 'width', '100%'),\n",
-    "        ('select', 'margin', 0)\n",
-    "    )\n",
-    "\n",
-    "# Source IP box\n",
-    "scrIpLalbel = widgets.HTML(value=\"Source IP:\", height='10%', width='100%')\n",
-    "# srcselect = widgets.Select(options=srclist, height='90%')\n",
-    "srcselect = widgets.Select(height='100%')\n",
-    "apply_css_to_select(srcselect)\n",
-    "srcIpBox = widgets.Box(width='25%', height='100%')\n",
-    "srcIpBox.children = (scrIpLalbel, srcselect)\n",
-    "\n",
-    "# Destination IP box\n",
-    "dstIpLalbel = widgets.HTML(value=\"Dest IP:\", height='10%', width='100%')\n",
-    "dstselect = widgets.Select(height='100%')\n",
-    "# dstselect = widgets.Select(options=dstlist, height='90%')\n",
-    "apply_css_to_select(dstselect)\n",
-    "dstIpBox = widgets.Box(width='25%', height='100%')\n",
-    "dstIpBox.children = (dstIpLalbel, dstselect)\n",
-    "\n",
-    "# Source Port box\n",
-    "scrPortLalbel = widgets.HTML(value=\"Src Port:\", height='10%', width='100%')\n",
-    "sportselect = widgets.Select(height='100%')\n",
-    "# sportselect = widgets.Select(options=sportlist, height='90%')\n",
-    "apply_css_to_select(sportselect)\n",
-    "srcPortBox = widgets.Box(width='20%', height='100%')\n",
-    "srcPortBox.children = (scrPortLalbel, sportselect)\n",
-    "\n",
-    "# Destionation Port box\n",
-    "dstPortLalbel = widgets.HTML(value=\"Dst Port:\", height='10%', width='100%')\n",
-    "dportselect = widgets.Select(height='100%')\n",
-    "# dportselect = widgets.Select(options=dportlist,height='90%')\n",
-    "apply_css_to_select(dportselect)\n",
-    "dstPortBox = widgets.Box(width='20%', height='100%')\n",
-    "dstPortBox.children = (dstPortLalbel, dportselect)\n",
-    "\n",
-    "# Quick Search and Actions Box\n",
-    "emptyLalbel = widgets.HTML(value=\"&nbsp;\")\n",
-    "srctext = widgets.Text(value='', width='100%', placeholder='Quick IP scoring')\n",
-    "srctext._css = (\n",
-    "    (None, 'width', '100%'),\n",
-    ")\n",
-    "ratingbut = widgets.RadioButtons(description='Rating:',options=['1', '2', '3'], width='100%')\n",
-    "assignbut = widgets.Button(description='Score', width='45%')\n",
-    "assignbut.button_style = 'primary'\n",
-    "updatebut = widgets.Button(description='Save', width='45%')\n",
-    "updatebut.button_style = 'primary'\n",
-    "updatebut._css = (\n",
-    "    (None, 'margin-left', '10%'),\n",
-    ")\n",
-    "actionsBox = widgets.Box(width='20%', height='100%')\n",
-    "actionsBox.children = (emptyLalbel, srctext,ratingbut,assignbut,updatebut)\n",
-    "\n",
-    "# Container Box\n",
-    "bigBox = widgets.HBox(width='90%', height=250)\n",
-    "bigBox.children = (srcIpBox, dstIpBox, srcPortBox, dstPortBox, actionsBox)\n",
-    "\n",
-    "rest_msg_box = widgets.HTML()\n",
-    "\n",
-    "def fill_list(list_control,source):\n",
-    "    options_list = ['- Select -'] \n",
-    "    options_list.extend([s for s in source])\n",
-    "    list_control.options = options_list\n",
-    "\n",
-    "\n",
-    "def data_loader():\n",
-    "    # build dict of IP addresses\n",
-    "    #sev,score, tstart,srcIP,dstIP,sport,dport,proto,ipkt,ibyt\n",
-    "    srcdict,srclist = {},[]\n",
-    "    dstdict,dstlist = {},[]\n",
-    "    sportdict,sportlist = {},[]\n",
-    "    dportdict,dportlist = {},[] \n",
-    "    global svals \n",
-    "    srcips,srcports = [],[]\n",
-    "    dstips,dstports = [],[]\n",
-    "    response = GraphQLClient.request(\n",
-    "        query=\"\"\"query($date:SpotDateType!) {\n",
-    "                flow{\n",
-    "                    suspicious(date:$date){\n",
-    "                    srcIP: srcIp\n",
-    "                    sport: srcPort\n",
-    "                    dstIP: dstIp\n",
-    "                    dport: dstPort\n",
-    "                }\n",
-    "            }\n",
-    "        }\"\"\",\n",
-    "        variables={\n",
-    "            'date': datetime.datetime.strptime(date, '%Y%m%d').strftime('%Y-%m-%d')\n",
-    "        }\n",
-    "    )\n",
-    "    \n",
-    "    \n",
-    "    for item in svals:\n",
-    "        srcips.append(item[0])\n",
-    "        srcports.append(item[2]) \n",
-    "        dstips.append(item[1]) \n",
-    "        dstports.append(item[3])\n",
-    "        \n",
-    "    rowct = 1\n",
-    "     \n",
-    "    \n",
-    "    if not 'errors' in response:\n",
-    "        for row in response['data']['flow']['suspicious']:\n",
-    "            if row['srcIP'] not in srcdict and row['srcIP'] not in srcips:\n",
-    "                srclist.append(row['srcIP'])\n",
-    "                srcdict[row['srcIP']] = struct.unpack(\"!L\", socket.inet_aton(row['srcIP']))[0]\n",
-    "            if row['dstIP'] not in dstdict and row['dstIP'] not in dstips:\n",
-    "                dstlist.append(row['dstIP'])\n",
-    "                dstdict[row['dstIP']] = struct.unpack(\"!L\", socket.inet_aton(row['dstIP']))[0]\n",
-    "            if row['sport'] not in sportdict and str(row['sport']) not in srcports:\n",
-    "                sportlist.append(str(row['sport']))\n",
-    "                sportdict[row['sport']] = row['sport']\n",
-    "            if row['dport'] not in dportdict and str(row['dport']) not in dstports:\n",
-    "                dportlist.append(str(row['dport']))\n",
-    "                dportdict[row['dport']] = row['dport']                \n",
-    "            if rowct == coff:\n",
-    "                break;\n",
-    "            rowct += 1\n",
-    "            \n",
-    "    fill_list(srcselect,srclist)\n",
-    "    fill_list(dstselect,dstlist)\n",
-    "    fill_list(sportselect,sportlist)\n",
-    "    fill_list(dportselect,dportlist)\n",
-    "            \n",
-    "    srcselect.value = \"- Select -\"\n",
-    "    dstselect.value = \"- Select -\"    \n",
-    "    sportselect.value = \"- Select -\"    \n",
-    "    dportselect.value = \"- Select -\""
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "display(Javascript(\"$('.widget-area > .widget-subarea > *').remove();\"))\n",
-    "data_loader() \n",
-    "display(bigBox)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": [
-    "def assign_score(b):\n",
-    "    clear_output()\n",
-    "    #Gets input values\n",
-    "    global svals\n",
-    "    if srctext.value != '':\n",
-    "        svals.append([srctext.value,dstselect.value,sportselect.value,dportselect.value, ratingbut.value])\n",
-    "        svals.append([srcselect.value,srctext.value,sportselect.value,dportselect.value, ratingbut.value])\n",
-    "        display(Javascript(\"$(\\\"option[data-value='\" + srctext.value +\"']\\\").remove();\"))\n",
-    "        dstselect.value = \"- Select -\"        \n",
-    "        srcselect.value = \"- Select -\"        \n",
-    "    else:\n",
-    "        svals.append([srcselect.value,dstselect.value,sportselect.value,dportselect.value, ratingbut.value])\n",
-    "    \n",
-    "    if srcselect.value != \"- Select -\":  \n",
-    "        display(Javascript(\"$(\\\"select.widget-listbox:eq(0) option[data-value='\" + srcselect.value +\"']\\\").remove();\"))  \n",
-    "        srcselect.value = \"- Select -\"\n",
-    "    if dstselect.value != \"- Select -\":\n",
-    "        display(Javascript(\"$(\\\"select.widget-listbox:eq(1) option[data-value='\" + dstselect.value +\"']\\\").remove();\"))  \n",
-    "        dstselect.value = \"- Select -\"\n",
-    "    if sportselect.value != \"- Select -\": \n",
-    "        display(Javascript(\"$(\\\"select.widget-listbox:eq(2) option[data-value='\" + sportselect.value +\"']\\\").remove();\"))  \n",
-    "        sportselect.value = \"- Select -\"\n",
-    "    if dportselect.value != \"- Select -\": \n",
-    "        display(Javascript(\"$(\\\"select.widget-listbox:eq(3) option[data-value='\" + dportselect.value +\"']\\\").remove();\"))  \n",
-    "        dportselect.value = \"- Select -\"\n",
-    "    srctext.value = \"\"\n",
-    "    \n",
-    "    rest_msg_box.visible = False\n",
-    "    data_loader()\n",
-    "    \n",
-    "    print \"Click the 'Save' button when you're finished scoring\" \n",
-    "\n",
-    "    \n",
-    "def reset_scoring():\n",
-    "    response = GraphQLClient.request(\n",
-    "        query=\"\"\"mutation($date:SpotDateType!) {\n",
-    "                flow{\n",
-    "                    resetScoredConnections(date:$date){\n",
-    "                   success\n",
-    "                }\n",
-    "            }\n",
-    "        }\"\"\",\n",
-    "        variables={\n",
-    "            'date': datetime.datetime.strptime(date, '%Y%m%d').strftime('%Y-%m-%d')\n",
-    "        }\n",
-    "    ) \n",
-    "     \n",
-    "    if not 'errors' in response :\n",
-    "        rest_msg_box.value=\"Suspicious connects successfully reset\"\n",
-    "        data_loader()\n",
-    "        rest_msg_box.visible = True\n",
-    "        display(rest_msg_box)\n",
-    "    else:\n",
-    "        print \"An error ocurred: \" + response['errors'][0]['message']\n",
-    "        \n",
-    "          \n",
-    "    \n",
-    "def savesort(b):\n",
-    "    global svals\n",
-    "    clear_output()    \n",
-    "\n",
-    "    variables = []\n",
-    "    mutation=\"\"\"mutation($input:[NetflowScoreInputType!]!)\n",
-    "            {\n",
-    "              flow{\n",
-    "                score(input:$input)\n",
-    "                    {success}\n",
-    "              }\n",
-    "            }\"\"\"\n",
-    "\n",
-    "    for row in svals:\n",
-    "        variables.append({\n",
-    "            'date': datetime.datetime.strptime(date, '%Y%m%d').strftime('%Y-%m-%d'),\n",
-    "            'score': row[4],\n",
-    "            'srcIp': row[0] if row[0] != '- Select -' else None,\n",
-    "            'dstIp': row[1] if row[1] != '- Select -' else None,\n",
-    "            'srcPort': row[2] if row[2] != '- Select -' else None,\n",
-    "            'dstPort': row[3]  if row[3] != '- Select -' else None\n",
-    "            })\n",
-    "\n",
-    "    var = {'input':variables}\n",
-    "    response = GraphQLClient.request(mutation,var)\n",
-    "\n",
-    "    svals = []\n",
-    "    if not 'errors' in response :\n",
-    "        display(Javascript(\"$('.widget-area > .widget-subarea > *').remove();\"))\n",
-    "        data_loader() \n",
-    "        display(bigBox)\n",
-    "        display(Javascript('reloadParentData();'))         \n",
-    "        print \"Suspicious connects successfully updated\"        \n",
-    "    else:\n",
-    "        print \"An error ocurred: \" + response['errors'][0]['message']\n",
-    "\n",
-    "assignbut.on_click(assign_score)\n",
-    "updatebut.on_click(savesort)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "# reset_scoring()"
-   ]
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Python 2",
-   "language": "python",
-   "name": "python2"
-  },
-  "language_info": {
-   "codemirror_mode": {
-    "name": "ipython",
-    "version": 2
-   },
-   "file_extension": ".py",
-   "mimetype": "text/x-python",
-   "name": "python",
-   "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython2",
-   "version": "2.7.10"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 0
-}

http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/a63c632d/spot-oa/oa/proxy/ipynb_templates/Edge_Investigation_master.ipynb
----------------------------------------------------------------------
diff --git a/spot-oa/oa/proxy/ipynb_templates/Edge_Investigation_master.ipynb b/spot-oa/oa/proxy/ipynb_templates/Edge_Investigation_master.ipynb
deleted file mode 100644
index 36b68ff..0000000
--- a/spot-oa/oa/proxy/ipynb_templates/Edge_Investigation_master.ipynb
+++ /dev/null
@@ -1,260 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## Get Suspicious Requests"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "import urllib\n",
-    "import os\n",
-    "import datetime\n",
-    "import csv \n",
-    "\n",
-    "# getting date from the parent path. \n",
-    "path = os.getcwd().split(\"/\") \n",
-    "date = path[len(path)-1]   \n",
-    "dsource = path[len(path)-2]  \n",
-    "score_values = []"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "try:\n",
-    "    import ipywidgets as widgets # For jupyter/ipython >= 1.4\n",
-    "except ImportError:\n",
-    "    from IPython.html import widgets\n",
-    "from IPython.display import display, HTML, clear_output, Javascript \n",
-    "\n",
-    "def fill_list(list_control,source):\n",
-    "    options_list = ['- Select -'] \n",
-    "    options_list.extend([s for s in source])\n",
-    "    list_control.options = options_list\n",
-    "\n",
-    "# URI panel\n",
-    "uri_header = widgets.HTML(value=\"URI\", height='10%', width='100%')\n",
-    "uri_select = widgets.Select(height='100%', width='99%')\n",
-    "\n",
-    "uri_select._css = (\n",
-    "    (None, 'height', '90%'),\n",
-    "    (None, 'width', '95%'),\n",
-    "    ('select', 'overflow-x', 'auto'),\n",
-    "    ('select', 'width', '100%'),\n",
-    "    ('select', 'margin', 0)\n",
-    ")\n",
-    "\n",
-    "uri_box = widgets.Box(width='70%', height='100%')\n",
-    "uri_box.children = [uri_header, uri_select]\n",
-    "\n",
-    "# Actions Panel\n",
-    "actions_header = widgets.HTML(value=\"&nbsp;\", width='100%', height='10%')\n",
-    "quick_text = widgets.Text(value='', width='100%', placeholder='Quick scoring')\n",
-    "quick_text._css = (\n",
-    "    (None, 'width', '100%'),\n",
-    ")\n",
-    "rating_btn = widgets.RadioButtons(description='Rating:', options=['1', '2', '3'], width='100%')\n",
-    "assign_btn = widgets.Button(description='Score', width='45%')\n",
-    "assign_btn.button_style = 'primary'\n",
-    "save_btn = widgets.Button(description='Save', width='45%')\n",
-    "save_btn.button_style = 'primary'\n",
-    "save_btn._css = (\n",
-    "    (None, 'margin-left', '10%'),\n",
-    ")\n",
-    "\n",
-    "actions_box = widgets.Box(width='30%', height='100%')\n",
-    "actions_box.children = [actions_header,quick_text,rating_btn, assign_btn,save_btn]\n",
-    "\n",
-    "scoring_form = widgets.HBox(width='90%', height=250)\n",
-    "scoring_form.children = [uri_box, actions_box]\n",
-    "\n",
-    "rest_msg_box = widgets.HTML()\n",
-    "\n",
-    "def data_loader(): \n",
-    "    us_uris = []\n",
-    "    global score_values\n",
-    "    \n",
-    "    response = GraphQLClient.request(\n",
-    "        query=\"\"\"query($date:SpotDateType!) {\n",
-    "                proxy{\n",
-    "                    suspicious(date:$date){\n",
-    "                    uri\n",
-    "                }\n",
-    "            }\n",
-    "        }\"\"\",\n",
-    "        variables={\n",
-    "            'date': datetime.datetime.strptime(date, '%Y%m%d').strftime('%Y-%m-%d')\n",
-    "        }\n",
-    "    )\n",
-    "    \n",
-    "    scored = []\n",
-    "    for item in score_values:\n",
-    "        scored.append(urllib.quote_plus(item[0]))\n",
-    "        \n",
-    "    if not 'errors' in response: \n",
-    "        for row in response['data']['proxy']['suspicious']:\n",
-    "            if not row['uri'] in scored:\n",
-    "                us_uris.append(row['uri'])\n",
-    "    else:\n",
-    "        print 'An error occured : '+ response['errors'][0]['message']\n",
-    "        \n",
-    "    fill_list(uri_select,us_uris)\n",
-    "    uri_select.value = \"- Select -\"   \n",
-    "\n",
-    "display(Javascript(\"$('.widget-area > .widget-subarea > *').remove();\"))\n",
-    "data_loader()\n",
-    "display(scoring_form)"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "# Update Suspicious Requests"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "import csv\n",
-    "import datetime\n",
-    "import subprocess \n",
-    "\n",
-    "def assign_score(b): \n",
-    "    clear_output()\n",
-    "    uri = quick_text.value or uri_select.value\n",
-    "    uri_sev = int(rating_btn.selected_label) \n",
-    "    \n",
-    "    global score_values\n",
-    "    \n",
-    "    score_values.append((uri, uri_sev))\n",
-    "        \n",
-    "    if uri_select.value != \"- Select -\":\n",
-    "        display(Javascript(\"$(\\\"option[data-value='\" + urllib.quote_plus(uri_select.value) +\"']\\\").remove();\"))\n",
-    "    else:\n",
-    "        display(Javascript(\"$(\\\"option[data-value$='\" + uri +\"']\\\").remove();\"))\n",
-    "      \n",
-    "    clear_output()    \n",
-    "    rest_msg_box.visible = False\n",
-    "    data_loader()\n",
-    "    uri_select.value = \"- Select -\"\n",
-    "    quick_text.value = \"\"\n",
-    "    \n",
-    "    print \"Click the 'Save' button when you're finished scoring\"  \n",
-    "\n",
-    "\n",
-    "    \n",
-    "def reset_scoring():\n",
-    "    response = GraphQLClient.request(\n",
-    "        query=\"\"\"mutation($date:SpotDateType!) {\n",
-    "                proxy{\n",
-    "                    resetScoredConnections(date:$date){\n",
-    "                   success\n",
-    "                }\n",
-    "            }\n",
-    "        }\"\"\",\n",
-    "        variables={\n",
-    "            'date': datetime.datetime.strptime(date, '%Y%m%d').strftime('%Y-%m-%d')\n",
-    "        }\n",
-    "    ) \n",
-    "     \n",
-    "    if not 'errors' in response:\n",
-    "        rest_msg_box.value=\"Suspicious connects successfully reset\"\n",
-    "        data_loader()\n",
-    "        rest_msg_box.visible = True\n",
-    "        display(rest_msg_box)\n",
-    "    else:\n",
-    "        print \"An error ocurred: \" + response['errors'][0]['message']\n",
-    "             \n",
-    "            \n",
-    "    \n",
-    "def save(b):   \n",
-    "    variables=[]\n",
-    "    global score_values\n",
-    "    mutation=\"\"\"mutation($input:[ProxyScoreInputType!]!)\n",
-    "                {\n",
-    "                  proxy{\n",
-    "                    score(input:$input)\n",
-    "                        {success}\n",
-    "                  }\n",
-    "                }\"\"\" \n",
-    "    \n",
-    "    for row in score_values:\n",
-    "        variables.append({\n",
-    "            'date': datetime.datetime.strptime(date, '%Y%m%d').strftime('%Y-%m-%d'),\n",
-    "            'uri': row[0] if row[0] != \"\" else None,\n",
-    "            'score': row[1] if row[1] != \"\" else None  \n",
-    "            })\n",
-    "\n",
-    "    var = {'input':variables}\n",
-    "    response = GraphQLClient.request(mutation,var)\n",
-    "    \n",
-    "    score_values = []\n",
-    "    if not 'errors' in response:\n",
-    "        clear_output()    \n",
-    "        display(Javascript(\"$('.widget-area > .widget-subarea > *').remove();\"))\n",
-    "        data_loader() \n",
-    "        display(scoring_form)\n",
-    "        display(Javascript('reloadParentData();')) \n",
-    "        print \"Suspicious connects successfully updated\"\n",
-    "    else:\n",
-    "        print \"An error ocurred: \" + response['errors'][0]['message']\n",
-    "\n",
-    "        \n",
-    "assign_btn.on_click(assign_score)\n",
-    "save_btn.on_click(save)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": [
-    "# reset_scoring()"
-   ]
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Python 2",
-   "language": "python",
-   "name": "python2"
-  },
-  "language_info": {
-   "codemirror_mode": {
-    "name": "ipython",
-    "version": 2
-   },
-   "file_extension": ".py",
-   "mimetype": "text/x-python",
-   "name": "python",
-   "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython2",
-   "version": "2.7.10"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 0
-}