repsheet_visualizer 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +25 -1
- data/bin/repsheet_visualizer +10 -8
- data/config.ru +8 -0
- data/lib/repsheet_visualizer/application/app.rb +120 -107
- data/lib/repsheet_visualizer/application/views/404.erb +66 -0
- data/lib/repsheet_visualizer/application/views/500.erb +66 -0
- data/lib/repsheet_visualizer/version.rb +1 -1
- metadata +4 -245
- data/redesign/actor.html +0 -237
- data/redesign/blacklist.html +0 -274
- data/redesign/css/App.css +0 -3436
- data/redesign/css/Login.css +0 -88
- data/redesign/css/bootstrap.min.css +0 -9
- data/redesign/css/custom.css +0 -0
- data/redesign/css/font-awesome.min.css +0 -395
- data/redesign/fonts/FontAwesome.otf +0 -0
- data/redesign/fonts/fontawesome-webfont.eot +0 -0
- data/redesign/fonts/fontawesome-webfont.svg +0 -414
- data/redesign/fonts/fontawesome-webfont.ttf +0 -0
- data/redesign/fonts/fontawesome-webfont.woff +0 -0
- data/redesign/fonts/glyphicons-halflings-regular.eot +0 -0
- data/redesign/fonts/glyphicons-halflings-regular.svg +0 -228
- data/redesign/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/redesign/fonts/glyphicons-halflings-regular.woff +0 -0
- data/redesign/img/jquery/handle-vertical.png +0 -0
- data/redesign/img/jquery/handle.png +0 -0
- data/redesign/img/layout/sidebar-bg.png +0 -0
- data/redesign/img/loaders/ajax-loader.gif +0 -0
- data/redesign/img/photos/map.png +0 -0
- data/redesign/index.html +0 -333
- data/redesign/js/App.js +0 -372
- data/redesign/js/Login.js +0 -17
- data/redesign/js/demos/buttons.js +0 -7
- data/redesign/js/demos/calendar.js +0 -142
- data/redesign/js/demos/charts/flot/area.js +0 -73
- data/redesign/js/demos/charts/flot/chart1.js +0 -77
- data/redesign/js/demos/charts/flot/chart2.js +0 -70
- data/redesign/js/demos/charts/flot/chart3.js +0 -71
- data/redesign/js/demos/charts/flot/chart4.js +0 -69
- data/redesign/js/demos/charts/flot/donut.js +0 -49
- data/redesign/js/demos/charts/flot/horizontal.js +0 -56
- data/redesign/js/demos/charts/flot/line.js +0 -76
- data/redesign/js/demos/charts/flot/pie.js +0 -50
- data/redesign/js/demos/charts/flot/scatter.js +0 -62
- data/redesign/js/demos/charts/flot/stacked-area.js +0 -86
- data/redesign/js/demos/charts/flot/stacked-horizontal.js +0 -60
- data/redesign/js/demos/charts/flot/stacked-vertical.js +0 -75
- data/redesign/js/demos/charts/flot/vertical.js +0 -70
- data/redesign/js/demos/charts/morris/area.js +0 -28
- data/redesign/js/demos/charts/morris/bar.js +0 -29
- data/redesign/js/demos/charts/morris/donut.js +0 -26
- data/redesign/js/demos/charts/morris/line.js +0 -30
- data/redesign/js/demos/dashboard.js +0 -26
- data/redesign/js/demos/form-extended.js +0 -61
- data/redesign/js/demos/popups.js +0 -16
- data/redesign/js/demos/pricing.js +0 -10
- data/redesign/js/demos/sliders.js +0 -77
- data/redesign/js/libs/bootstrap.js +0 -1999
- data/redesign/js/libs/bootstrap.min.js +0 -6
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/redesign/js/libs/css/ui-lightness/jquery-ui-1.9.2.custom.css +0 -294
- data/redesign/js/libs/css/ui-lightness/jquery-ui-1.9.2.custom.min.css +0 -7
- data/redesign/js/libs/jquery-1.9.1.min.js +0 -5
- data/redesign/js/libs/jquery-ui-1.9.2.custom.min.js +0 -6
- data/redesign/js/libs/jquery.min.map +0 -1
- data/redesign/js/libs/raphael-2.1.2.min.js +0 -11
- data/redesign/js/plugins/autosize/jquery.autosize.min.js +0 -7
- data/redesign/js/plugins/datatables/DT_bootstrap.js +0 -148
- data/redesign/js/plugins/datatables/img/Sorting icons.psd +0 -0
- data/redesign/js/plugins/datatables/img/back_disabled.png +0 -0
- data/redesign/js/plugins/datatables/img/back_enabled.png +0 -0
- data/redesign/js/plugins/datatables/img/back_enabled_hover.png +0 -0
- data/redesign/js/plugins/datatables/img/datatable-row-openclose.png +0 -0
- data/redesign/js/plugins/datatables/img/favicon.ico +0 -0
- data/redesign/js/plugins/datatables/img/forward_disabled.png +0 -0
- data/redesign/js/plugins/datatables/img/forward_enabled.png +0 -0
- data/redesign/js/plugins/datatables/img/forward_enabled_hover.png +0 -0
- data/redesign/js/plugins/datatables/img/sort_asc.png +0 -0
- data/redesign/js/plugins/datatables/img/sort_asc_disabled.png +0 -0
- data/redesign/js/plugins/datatables/img/sort_both.png +0 -0
- data/redesign/js/plugins/datatables/img/sort_desc.png +0 -0
- data/redesign/js/plugins/datatables/img/sort_desc_disabled.png +0 -0
- data/redesign/js/plugins/datatables/jquery.dataTables.min.js +0 -155
- data/redesign/js/plugins/datepicker/bootstrap-datepicker.js +0 -1258
- data/redesign/js/plugins/datepicker/datepicker.css +0 -481
- data/redesign/js/plugins/datepicker/less/datepicker.less +0 -122
- data/redesign/js/plugins/fileupload/bootstrap-fileupload.css +0 -132
- data/redesign/js/plugins/fileupload/bootstrap-fileupload.js +0 -169
- data/redesign/js/plugins/fileupload/bootstrap-fileupload.min.css +0 -31
- data/redesign/js/plugins/fileupload/bootstrap-fileupload.min.js +0 -7
- data/redesign/js/plugins/flot/jquery.flot.js +0 -2599
- data/redesign/js/plugins/flot/jquery.flot.orderBars.js +0 -186
- data/redesign/js/plugins/flot/jquery.flot.pie.js +0 -750
- data/redesign/js/plugins/flot/jquery.flot.resize.js +0 -57
- data/redesign/js/plugins/flot/jquery.flot.stack.js +0 -184
- data/redesign/js/plugins/flot/jquery.flot.tooltip.min.js +0 -14
- data/redesign/js/plugins/fullcalendar/fullcalendar.css +0 -589
- data/redesign/js/plugins/fullcalendar/fullcalendar.js +0 -6110
- data/redesign/js/plugins/fullcalendar/fullcalendar.min.js +0 -7
- data/redesign/js/plugins/fullcalendar/fullcalendar.print.css +0 -32
- data/redesign/js/plugins/fullcalendar/gcal.js +0 -107
- data/redesign/js/plugins/howl/howl.js +0 -70
- data/redesign/js/plugins/howl/howl.min.js +0 -2
- data/redesign/js/plugins/icheck/jquery.icheck.js +0 -462
- data/redesign/js/plugins/icheck/jquery.icheck.min.js +0 -11
- data/redesign/js/plugins/icheck/skins/all.css +0 -61
- data/redesign/js/plugins/icheck/skins/flat/_all.css +0 -540
- data/redesign/js/plugins/icheck/skins/flat/aero.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/aero.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/aero@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/blue.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/blue.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/blue@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/flat.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/flat.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/flat@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/green.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/green.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/green@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/grey.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/grey.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/grey@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/orange.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/orange.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/orange@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/pink.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/pink.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/pink@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/purple.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/purple.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/purple@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/red.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/red.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/red@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/yellow.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/yellow.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/yellow@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/futurico/futurico.css +0 -54
- data/redesign/js/plugins/icheck/skins/futurico/futurico.png +0 -0
- data/redesign/js/plugins/icheck/skins/futurico/futurico@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/line/_all.css +0 -740
- data/redesign/js/plugins/icheck/skins/line/aero.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/blue.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/green.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/grey.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/line.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/line.png +0 -0
- data/redesign/js/plugins/icheck/skins/line/line@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/line/orange.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/pink.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/purple.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/red.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/yellow.css +0 -74
- data/redesign/js/plugins/icheck/skins/minimal/_all.css +0 -600
- data/redesign/js/plugins/icheck/skins/minimal/aero.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/aero.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/aero@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/blue.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/blue.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/blue@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/green.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/green.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/green@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/grey.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/grey.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/grey@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/minimal.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/minimal.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/minimal@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/orange.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/orange.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/orange@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/pink.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/pink.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/pink@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/purple.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/purple.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/purple@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/red.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/red.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/red@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/yellow.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/yellow.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/yellow@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/polaris/polaris.css +0 -60
- data/redesign/js/plugins/icheck/skins/polaris/polaris.png +0 -0
- data/redesign/js/plugins/icheck/skins/polaris/polaris@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/_all.css +0 -600
- data/redesign/js/plugins/icheck/skins/square/aero.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/aero.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/aero@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/blue.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/blue.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/blue@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/green.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/green.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/green@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/grey.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/grey.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/grey@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/orange.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/orange.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/orange@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/pink.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/pink.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/pink@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/purple.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/purple.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/purple@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/red.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/red.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/red@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/square.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/square.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/square@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/yellow.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/yellow.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/yellow@2x.png +0 -0
- data/redesign/js/plugins/magnific/jquery.magnific-popup.js +0 -2026
- data/redesign/js/plugins/magnific/jquery.magnific-popup.min.js +0 -4
- data/redesign/js/plugins/magnific/magnific-popup.css +0 -396
- data/redesign/js/plugins/morris/morris.css +0 -1
- data/redesign/js/plugins/morris/morris.min.js +0 -1
- data/redesign/js/plugins/parsley/parsley.js +0 -1363
- data/redesign/js/plugins/select2/select2-spinner.gif +0 -0
- data/redesign/js/plugins/select2/select2.css +0 -615
- data/redesign/js/plugins/select2/select2.js +0 -3217
- data/redesign/js/plugins/select2/select2.min.js +0 -22
- data/redesign/js/plugins/select2/select2.png +0 -0
- data/redesign/js/plugins/select2/select2x2.png +0 -0
- data/redesign/js/plugins/simplecolorpicker/jquery.simplecolorpicker.css +0 -98
- data/redesign/js/plugins/simplecolorpicker/jquery.simplecolorpicker.js +0 -211
- data/redesign/js/plugins/sparkline/jquery.sparkline.min.js +0 -5
- data/redesign/js/plugins/tableCheckable/jquery.tableCheckable.js +0 -122
- data/redesign/js/plugins/textarea-counter/jquery.textarea-counter.js +0 -163
- data/redesign/js/plugins/timepicker/bootstrap-timepicker.css +0 -121
- data/redesign/js/plugins/timepicker/bootstrap-timepicker.js +0 -893
- data/redesign/suspects.html +0 -273
- data/redesign/whitelist.html +0 -273
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd4eeda4bad79b51779af5f7f28411cbdc33be35
|
4
|
+
data.tar.gz: 5a1dac9229792475e0365c850d8df150e0812222
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d246b1c4c8e86cb7d442a41302ed309f08efefddce7df8fdb0dcfa0fa5bb17973b7827929ee259486f6ace2d43d55686af5c4a2b5d2e03306951c483ff0ce7f
|
7
|
+
data.tar.gz: 0ef3a230ca6bdbea03a65b4b4b98edd261e8f5fafb7022ce7d8e9349dd080808b5c598c7e4c05514469f22c0aac8e21cc80e5a46d2fca286b446e7f8035f3ad6
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#Repsheet Visualizer [![Build Status](https://secure.travis-ci.org/repsheet/visualizer.png)](http://travis-ci.org/repsheet/visualizer?branch=master)
|
2
2
|
|
3
|
-
This is the visualization component for Repsheet. It displays information on offending actors and allows for manual blacklisting. It provides a world map that displays the location of offending actors which allows for identification of global attack patterns.
|
3
|
+
This is the visualization component for Repsheet. It displays information on offending actors and allows for manual blacklisting. It provides a world map that displays the location of offending actors which allows for identification of global attack patterns.
|
4
4
|
|
5
5
|
## Setup
|
6
6
|
|
@@ -12,3 +12,27 @@ bin/repsheet_visualizer <redis_host> <redis_port> <path_to_geolite_database>
|
|
12
12
|
```
|
13
13
|
|
14
14
|
Visit [http://localhost:4567](http://localhost:4567) to view the application
|
15
|
+
|
16
|
+
## Running as a Rack application
|
17
|
+
|
18
|
+
This is the most common running configuration for the Visualizer. This just runs the application as if it was any other Rack application. You just have to create a config.ru file and start the application under your favorite application server.
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
require 'repsheet_visualizer'
|
22
|
+
|
23
|
+
RepsheetVisualizer::App.set :redis_host, "localhost"
|
24
|
+
RepsheetVisualizer::App.set :redis_port, 6379
|
25
|
+
RepsheetVisualizer::App.set :geoip_database, "/Users/abedra/src/opensource/repsheet/vendor/geoip/GeoLiteCity.dat"
|
26
|
+
|
27
|
+
run RepsheetVisualizer::App
|
28
|
+
```
|
29
|
+
|
30
|
+
## Running as an embedded Rack application
|
31
|
+
|
32
|
+
Since the Visualizer is a rack based application, you can embed it in any other rack app. Along with the above settings, you can specify a mount point:
|
33
|
+
|
34
|
+
```
|
35
|
+
RepsheetVisualizer::App.set :mount "/repsheet"
|
36
|
+
```
|
37
|
+
|
38
|
+
This will re-root the application so that everything continues to function properly under the mount point you desire.
|
data/bin/repsheet_visualizer
CHANGED
@@ -3,20 +3,22 @@
|
|
3
3
|
begin
|
4
4
|
require 'repsheet_visualizer/application/app.rb'
|
5
5
|
if ARGV.count == 3
|
6
|
-
RepsheetVisualizer.set :redis_host, ARGV[0]
|
7
|
-
RepsheetVisualizer.set :redis_port, ARGV[1]
|
8
|
-
RepsheetVisualizer.set :geoip_database, ARGV[2]
|
6
|
+
RepsheetVisualizer::App.set :redis_host, ARGV[0]
|
7
|
+
RepsheetVisualizer::App.set :redis_port, ARGV[1]
|
8
|
+
RepsheetVisualizer::App.set :geoip_database, ARGV[2]
|
9
9
|
end
|
10
|
-
RepsheetVisualizer.run!
|
10
|
+
RepsheetVisualizer::App.run!
|
11
11
|
rescue LoadError => e
|
12
12
|
require 'rubygems'
|
13
13
|
path = File.expand_path '../../lib', __FILE__
|
14
14
|
$:.unshift(path) if File.directory?(path) && !$:.include?(path)
|
15
15
|
require 'repsheet_visualizer/application/app.rb'
|
16
|
+
|
16
17
|
if ARGV.count == 3
|
17
|
-
RepsheetVisualizer.set :redis_host, ARGV[0]
|
18
|
-
RepsheetVisualizer.set :redis_port, ARGV[1]
|
19
|
-
RepsheetVisualizer.set :geoip_database, ARGV[2]
|
18
|
+
RepsheetVisualizer::App.set :redis_host, ARGV[0]
|
19
|
+
RepsheetVisualizer::App.set :redis_port, ARGV[1]
|
20
|
+
RepsheetVisualizer::App.set :geoip_database, ARGV[2]
|
20
21
|
end
|
21
|
-
|
22
|
+
|
23
|
+
RepsheetVisualizer::App.run!
|
22
24
|
end
|
data/config.ru
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
require 'repsheet_visualizer'
|
2
|
+
|
3
|
+
RepsheetVisualizer::App.set :redis_host, "localhost"
|
4
|
+
RepsheetVisualizer::App.set :redis_port, 6379
|
5
|
+
RepsheetVisualizer::App.set :geoip_database, "/Users/abedra/src/opensource/repsheet/vendor/geoip/GeoLiteCity.dat"
|
6
|
+
|
7
|
+
run RepsheetVisualizer::App
|
8
|
+
|
@@ -5,133 +5,146 @@ require 'json'
|
|
5
5
|
require 'ipaddress'
|
6
6
|
require_relative 'backend'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
8
|
+
module RepsheetVisualizer
|
9
|
+
class App < Sinatra::Base
|
10
|
+
set :show_exceptions, false
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
"
|
12
|
+
before do
|
13
|
+
@mount = mount
|
14
|
+
end
|
15
|
+
|
16
|
+
helpers do
|
17
|
+
def action(ip, blacklist=nil)
|
18
|
+
blacklist = redis_connection.get("#{ip}:repsheet:blacklist") if blacklist.nil?
|
19
|
+
if blacklist.nil? || blacklist == "false"
|
20
|
+
"blacklist"
|
21
|
+
else
|
22
|
+
"whitelist"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def replace_invalid_chars(str)
|
27
|
+
str.encode('UTF-16le', :invalid => :replace, :replace => '?').encode('UTF-8')
|
28
|
+
end
|
29
|
+
|
30
|
+
def h(text)
|
31
|
+
begin
|
32
|
+
Rack::Utils.escape_html(text)
|
33
|
+
rescue ArgumentError
|
34
|
+
replace_invalid_chars(text)
|
35
|
+
end
|
20
36
|
end
|
21
37
|
end
|
22
38
|
|
23
|
-
def
|
24
|
-
|
39
|
+
def redis_connection
|
40
|
+
host = defined?(settings.redis_host) ? settings.redis_host : "localhost"
|
41
|
+
port = defined?(settings.redis_port) ? settings.redis_port : 6379
|
42
|
+
Redis.new(:host => host, :port => port)
|
25
43
|
end
|
26
44
|
|
27
|
-
def
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
45
|
+
def geoip_database
|
46
|
+
geoip_database = defined?(settings.geoip_database) ? settings.geoip_database : nil
|
47
|
+
raise "Missing GeoIP database settings" if geoip_database.nil?
|
48
|
+
raise "Could not locate GeoIP database" unless File.exist?(geoip_database)
|
49
|
+
GeoIP.new(settings.geoip_database)
|
33
50
|
end
|
34
|
-
end
|
35
51
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
Redis.new(:host => host, :port => port)
|
40
|
-
end
|
52
|
+
def mount
|
53
|
+
defined?(settings.mount) ? (settings.mount + "/") : "/"
|
54
|
+
end
|
41
55
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
raise "Could not locate GeoIP database" unless File.exist?(geoip_database)
|
46
|
-
GeoIP.new(settings.geoip_database)
|
47
|
-
end
|
56
|
+
def redis_expiry
|
57
|
+
defined?(settings.redis_expiry) ? (settings.redis_expiry * 60 * 60) : (24 * 60 * 60)
|
58
|
+
end
|
48
59
|
|
49
|
-
|
50
|
-
|
51
|
-
|
60
|
+
not_found do
|
61
|
+
erb :'404'
|
62
|
+
end
|
52
63
|
|
53
|
-
|
54
|
-
|
55
|
-
|
64
|
+
error do
|
65
|
+
@e = request.env['sinatra_error']
|
66
|
+
erb :'500'
|
67
|
+
end
|
56
68
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
69
|
+
get '/' do
|
70
|
+
@suspects, @blacklisted = Backend.summary(redis_connection)
|
71
|
+
@whitelist = Backend.whitelist(redis_connection)
|
72
|
+
@blacklist_total = Backend.blacklist_total(redis_connection)
|
73
|
+
erb :index
|
74
|
+
end
|
63
75
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
76
|
+
get '/whitelist' do
|
77
|
+
@whitelist = Backend.whitelist(redis_connection)
|
78
|
+
erb :whitelist
|
79
|
+
end
|
68
80
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
81
|
+
get '/blacklist' do
|
82
|
+
@blacklist = Backend.blacklist(redis_connection)
|
83
|
+
erb :blacklist
|
84
|
+
end
|
73
85
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
86
|
+
get '/suspects' do
|
87
|
+
@suspects, _ = Backend.suspects(redis_connection)
|
88
|
+
erb :suspects
|
89
|
+
end
|
78
90
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
91
|
+
get '/breakdown' do
|
92
|
+
@data = Backend.breakdown(redis_connection)
|
93
|
+
erb :breakdown
|
94
|
+
end
|
83
95
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
96
|
+
get '/worldview' do
|
97
|
+
@data = Backend.worldview(redis_connection, geoip_database)
|
98
|
+
erb :worldview
|
99
|
+
end
|
88
100
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
@action = action(@ip)
|
109
|
-
erb :actor
|
110
|
-
end
|
101
|
+
get '/actors/:ip' do
|
102
|
+
@ip = params[:ip]
|
103
|
+
@activity = Backend.activity(redis_connection, @ip)
|
104
|
+
triggered = Backend.triggered_rules(redis_connection, @ip)
|
105
|
+
offenses = Backend.score_actor(redis_connection, @ip, triggered, false)
|
106
|
+
@modsecurity = {:triggered => triggered.join(", "), :offenses => offenses}
|
107
|
+
@ofdp_score = Backend.ofdp_score(redis_connection, @ip) || 0
|
108
|
+
@whitelisted = Backend.whitelisted?(redis_connection, @ip)
|
109
|
+
@blacklisted = Backend.blacklisted?(redis_connection, @ip)
|
110
|
+
|
111
|
+
details = geoip_database.country(@ip)
|
112
|
+
unless details.nil?
|
113
|
+
@lat = details.latitude
|
114
|
+
@lng = details.longitude
|
115
|
+
@country = details.country_name
|
116
|
+
@region = details.region_name
|
117
|
+
@city = details.city_name
|
118
|
+
end
|
111
119
|
|
112
|
-
|
113
|
-
|
114
|
-
if IPAddress.valid?(@ip)
|
115
|
-
redirect "#{@mount}actors/#{@ip}"
|
116
|
-
else
|
117
|
-
redirect "#{@mount}"
|
120
|
+
@action = action(@ip)
|
121
|
+
erb :actor
|
118
122
|
end
|
119
|
-
end
|
120
123
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
connection
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
124
|
+
post '/search' do
|
125
|
+
@ip = params[:ip]
|
126
|
+
if IPAddress.valid?(@ip)
|
127
|
+
redirect "#{@mount}actors/#{@ip}"
|
128
|
+
else
|
129
|
+
redirect "#{@mount}"
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
post '/action' do
|
134
|
+
connection = redis_connection
|
135
|
+
if params["action"] == "whitelist"
|
136
|
+
connection.set("#{params[:ip]}:repsheet:whitelist", "true")
|
137
|
+
connection.del("#{params[:ip]}:repsheet:blacklist")
|
138
|
+
connection.del("#{params[:ip]}:repsheet")
|
139
|
+
connection.del("#{params[:ip]}:detected")
|
140
|
+
connection.srem("repsheet:blacklist:history", params[:ip])
|
141
|
+
elsif params["action"] == "blacklist"
|
142
|
+
ttl = connection.ttl("#{params[:ip]}:requests")
|
143
|
+
connection.setex("#{params[:ip]}:repsheet:blacklist", ttl, "true")
|
144
|
+
connection.sadd("repsheet:blacklist:history", params[:ip])
|
145
|
+
connection.del("#{params[:ip]}:repsheet:whitelist")
|
146
|
+
end
|
147
|
+
redirect back
|
148
|
+
end
|
136
149
|
end
|
137
150
|
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<div id="sidebar-wrapper" class="collapse sidebar-collapse">
|
2
|
+
<div id="search">
|
3
|
+
<form method="post" action="<%= @mount %>search">
|
4
|
+
<input name="ip" id="ip" class="form-control input-sm" type="text" name="search" placeholder="Search for an Actor" />
|
5
|
+
<button type="submit" id="search-btn" class="btn"><i class="fa fa-search"></i></button>
|
6
|
+
</form>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<nav id="sidebar">
|
10
|
+
<ul id="main-nav" class="open-active">
|
11
|
+
<li>
|
12
|
+
<a href="<%= @mount %>">
|
13
|
+
<i class="fa fa-dashboard"></i>
|
14
|
+
Dashboard
|
15
|
+
</a>
|
16
|
+
</li>
|
17
|
+
|
18
|
+
<li>
|
19
|
+
<a href="<%= @mount%>blacklist">
|
20
|
+
<i class="fa fa-ban"></i>
|
21
|
+
Blacklist
|
22
|
+
</a>
|
23
|
+
</li>
|
24
|
+
|
25
|
+
<li>
|
26
|
+
<a href="<%= @mount%>suspects">
|
27
|
+
<i class="fa fa-gavel"></i>
|
28
|
+
Suspects
|
29
|
+
</a>
|
30
|
+
</li>
|
31
|
+
|
32
|
+
<li>
|
33
|
+
<a href="<%= @mount%>whitelist">
|
34
|
+
<i class="fa fa-thumbs-o-up"></i>
|
35
|
+
Whitelist
|
36
|
+
</a>
|
37
|
+
</li>
|
38
|
+
|
39
|
+
<!-- <li>
|
40
|
+
<a href="javascript:;">
|
41
|
+
<i class="fa fa-bar-chart-o"></i>
|
42
|
+
ModSecurity Analysis
|
43
|
+
</a>
|
44
|
+
</li> -->
|
45
|
+
|
46
|
+
<li>
|
47
|
+
<a href="<%= @mount %>worldview">
|
48
|
+
<i class="fa fa-globe"></i>
|
49
|
+
World View
|
50
|
+
</a>
|
51
|
+
</li>
|
52
|
+
</ul>
|
53
|
+
</nav>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
<div id="content">
|
57
|
+
<div id="content-header">
|
58
|
+
<h1>Not Found</h1>
|
59
|
+
</div>
|
60
|
+
|
61
|
+
<div id="content-container">
|
62
|
+
<div class="alert alert-danger">
|
63
|
+
The page you are looking for can't be found.
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
</div>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<div id="sidebar-wrapper" class="collapse sidebar-collapse">
|
2
|
+
<div id="search">
|
3
|
+
<form method="post" action="<%= @mount %>search">
|
4
|
+
<input name="ip" id="ip" class="form-control input-sm" type="text" name="search" placeholder="Search for an Actor" />
|
5
|
+
<button type="submit" id="search-btn" class="btn"><i class="fa fa-search"></i></button>
|
6
|
+
</form>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<nav id="sidebar">
|
10
|
+
<ul id="main-nav" class="open-active">
|
11
|
+
<li>
|
12
|
+
<a href="<%= @mount %>">
|
13
|
+
<i class="fa fa-dashboard"></i>
|
14
|
+
Dashboard
|
15
|
+
</a>
|
16
|
+
</li>
|
17
|
+
|
18
|
+
<li>
|
19
|
+
<a href="<%= @mount%>blacklist">
|
20
|
+
<i class="fa fa-ban"></i>
|
21
|
+
Blacklist
|
22
|
+
</a>
|
23
|
+
</li>
|
24
|
+
|
25
|
+
<li>
|
26
|
+
<a href="<%= @mount%>suspects">
|
27
|
+
<i class="fa fa-gavel"></i>
|
28
|
+
Suspects
|
29
|
+
</a>
|
30
|
+
</li>
|
31
|
+
|
32
|
+
<li>
|
33
|
+
<a href="<%= @mount%>whitelist">
|
34
|
+
<i class="fa fa-thumbs-o-up"></i>
|
35
|
+
Whitelist
|
36
|
+
</a>
|
37
|
+
</li>
|
38
|
+
|
39
|
+
<!-- <li>
|
40
|
+
<a href="javascript:;">
|
41
|
+
<i class="fa fa-bar-chart-o"></i>
|
42
|
+
ModSecurity Analysis
|
43
|
+
</a>
|
44
|
+
</li> -->
|
45
|
+
|
46
|
+
<li>
|
47
|
+
<a href="<%= @mount %>worldview">
|
48
|
+
<i class="fa fa-globe"></i>
|
49
|
+
World View
|
50
|
+
</a>
|
51
|
+
</li>
|
52
|
+
</ul>
|
53
|
+
</nav>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
<div id="content">
|
57
|
+
<div id="content-header">
|
58
|
+
<h1>Error</h1>
|
59
|
+
</div>
|
60
|
+
|
61
|
+
<div id="content-container">
|
62
|
+
<div class="alert alert-danger">
|
63
|
+
There was an error
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
</div>
|