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.
Files changed (254) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +25 -1
  4. data/bin/repsheet_visualizer +10 -8
  5. data/config.ru +8 -0
  6. data/lib/repsheet_visualizer/application/app.rb +120 -107
  7. data/lib/repsheet_visualizer/application/views/404.erb +66 -0
  8. data/lib/repsheet_visualizer/application/views/500.erb +66 -0
  9. data/lib/repsheet_visualizer/version.rb +1 -1
  10. metadata +4 -245
  11. data/redesign/actor.html +0 -237
  12. data/redesign/blacklist.html +0 -274
  13. data/redesign/css/App.css +0 -3436
  14. data/redesign/css/Login.css +0 -88
  15. data/redesign/css/bootstrap.min.css +0 -9
  16. data/redesign/css/custom.css +0 -0
  17. data/redesign/css/font-awesome.min.css +0 -395
  18. data/redesign/fonts/FontAwesome.otf +0 -0
  19. data/redesign/fonts/fontawesome-webfont.eot +0 -0
  20. data/redesign/fonts/fontawesome-webfont.svg +0 -414
  21. data/redesign/fonts/fontawesome-webfont.ttf +0 -0
  22. data/redesign/fonts/fontawesome-webfont.woff +0 -0
  23. data/redesign/fonts/glyphicons-halflings-regular.eot +0 -0
  24. data/redesign/fonts/glyphicons-halflings-regular.svg +0 -228
  25. data/redesign/fonts/glyphicons-halflings-regular.ttf +0 -0
  26. data/redesign/fonts/glyphicons-halflings-regular.woff +0 -0
  27. data/redesign/img/jquery/handle-vertical.png +0 -0
  28. data/redesign/img/jquery/handle.png +0 -0
  29. data/redesign/img/layout/sidebar-bg.png +0 -0
  30. data/redesign/img/loaders/ajax-loader.gif +0 -0
  31. data/redesign/img/photos/map.png +0 -0
  32. data/redesign/index.html +0 -333
  33. data/redesign/js/App.js +0 -372
  34. data/redesign/js/Login.js +0 -17
  35. data/redesign/js/demos/buttons.js +0 -7
  36. data/redesign/js/demos/calendar.js +0 -142
  37. data/redesign/js/demos/charts/flot/area.js +0 -73
  38. data/redesign/js/demos/charts/flot/chart1.js +0 -77
  39. data/redesign/js/demos/charts/flot/chart2.js +0 -70
  40. data/redesign/js/demos/charts/flot/chart3.js +0 -71
  41. data/redesign/js/demos/charts/flot/chart4.js +0 -69
  42. data/redesign/js/demos/charts/flot/donut.js +0 -49
  43. data/redesign/js/demos/charts/flot/horizontal.js +0 -56
  44. data/redesign/js/demos/charts/flot/line.js +0 -76
  45. data/redesign/js/demos/charts/flot/pie.js +0 -50
  46. data/redesign/js/demos/charts/flot/scatter.js +0 -62
  47. data/redesign/js/demos/charts/flot/stacked-area.js +0 -86
  48. data/redesign/js/demos/charts/flot/stacked-horizontal.js +0 -60
  49. data/redesign/js/demos/charts/flot/stacked-vertical.js +0 -75
  50. data/redesign/js/demos/charts/flot/vertical.js +0 -70
  51. data/redesign/js/demos/charts/morris/area.js +0 -28
  52. data/redesign/js/demos/charts/morris/bar.js +0 -29
  53. data/redesign/js/demos/charts/morris/donut.js +0 -26
  54. data/redesign/js/demos/charts/morris/line.js +0 -30
  55. data/redesign/js/demos/dashboard.js +0 -26
  56. data/redesign/js/demos/form-extended.js +0 -61
  57. data/redesign/js/demos/popups.js +0 -16
  58. data/redesign/js/demos/pricing.js +0 -10
  59. data/redesign/js/demos/sliders.js +0 -77
  60. data/redesign/js/libs/bootstrap.js +0 -1999
  61. data/redesign/js/libs/bootstrap.min.js +0 -6
  62. data/redesign/js/libs/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  63. data/redesign/js/libs/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  64. data/redesign/js/libs/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  65. data/redesign/js/libs/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  66. data/redesign/js/libs/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  67. data/redesign/js/libs/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  68. data/redesign/js/libs/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  69. data/redesign/js/libs/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  70. data/redesign/js/libs/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  71. data/redesign/js/libs/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  72. data/redesign/js/libs/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  73. data/redesign/js/libs/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  74. data/redesign/js/libs/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  75. data/redesign/js/libs/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  76. data/redesign/js/libs/css/ui-lightness/jquery-ui-1.9.2.custom.css +0 -294
  77. data/redesign/js/libs/css/ui-lightness/jquery-ui-1.9.2.custom.min.css +0 -7
  78. data/redesign/js/libs/jquery-1.9.1.min.js +0 -5
  79. data/redesign/js/libs/jquery-ui-1.9.2.custom.min.js +0 -6
  80. data/redesign/js/libs/jquery.min.map +0 -1
  81. data/redesign/js/libs/raphael-2.1.2.min.js +0 -11
  82. data/redesign/js/plugins/autosize/jquery.autosize.min.js +0 -7
  83. data/redesign/js/plugins/datatables/DT_bootstrap.js +0 -148
  84. data/redesign/js/plugins/datatables/img/Sorting icons.psd +0 -0
  85. data/redesign/js/plugins/datatables/img/back_disabled.png +0 -0
  86. data/redesign/js/plugins/datatables/img/back_enabled.png +0 -0
  87. data/redesign/js/plugins/datatables/img/back_enabled_hover.png +0 -0
  88. data/redesign/js/plugins/datatables/img/datatable-row-openclose.png +0 -0
  89. data/redesign/js/plugins/datatables/img/favicon.ico +0 -0
  90. data/redesign/js/plugins/datatables/img/forward_disabled.png +0 -0
  91. data/redesign/js/plugins/datatables/img/forward_enabled.png +0 -0
  92. data/redesign/js/plugins/datatables/img/forward_enabled_hover.png +0 -0
  93. data/redesign/js/plugins/datatables/img/sort_asc.png +0 -0
  94. data/redesign/js/plugins/datatables/img/sort_asc_disabled.png +0 -0
  95. data/redesign/js/plugins/datatables/img/sort_both.png +0 -0
  96. data/redesign/js/plugins/datatables/img/sort_desc.png +0 -0
  97. data/redesign/js/plugins/datatables/img/sort_desc_disabled.png +0 -0
  98. data/redesign/js/plugins/datatables/jquery.dataTables.min.js +0 -155
  99. data/redesign/js/plugins/datepicker/bootstrap-datepicker.js +0 -1258
  100. data/redesign/js/plugins/datepicker/datepicker.css +0 -481
  101. data/redesign/js/plugins/datepicker/less/datepicker.less +0 -122
  102. data/redesign/js/plugins/fileupload/bootstrap-fileupload.css +0 -132
  103. data/redesign/js/plugins/fileupload/bootstrap-fileupload.js +0 -169
  104. data/redesign/js/plugins/fileupload/bootstrap-fileupload.min.css +0 -31
  105. data/redesign/js/plugins/fileupload/bootstrap-fileupload.min.js +0 -7
  106. data/redesign/js/plugins/flot/jquery.flot.js +0 -2599
  107. data/redesign/js/plugins/flot/jquery.flot.orderBars.js +0 -186
  108. data/redesign/js/plugins/flot/jquery.flot.pie.js +0 -750
  109. data/redesign/js/plugins/flot/jquery.flot.resize.js +0 -57
  110. data/redesign/js/plugins/flot/jquery.flot.stack.js +0 -184
  111. data/redesign/js/plugins/flot/jquery.flot.tooltip.min.js +0 -14
  112. data/redesign/js/plugins/fullcalendar/fullcalendar.css +0 -589
  113. data/redesign/js/plugins/fullcalendar/fullcalendar.js +0 -6110
  114. data/redesign/js/plugins/fullcalendar/fullcalendar.min.js +0 -7
  115. data/redesign/js/plugins/fullcalendar/fullcalendar.print.css +0 -32
  116. data/redesign/js/plugins/fullcalendar/gcal.js +0 -107
  117. data/redesign/js/plugins/howl/howl.js +0 -70
  118. data/redesign/js/plugins/howl/howl.min.js +0 -2
  119. data/redesign/js/plugins/icheck/jquery.icheck.js +0 -462
  120. data/redesign/js/plugins/icheck/jquery.icheck.min.js +0 -11
  121. data/redesign/js/plugins/icheck/skins/all.css +0 -61
  122. data/redesign/js/plugins/icheck/skins/flat/_all.css +0 -540
  123. data/redesign/js/plugins/icheck/skins/flat/aero.css +0 -54
  124. data/redesign/js/plugins/icheck/skins/flat/aero.png +0 -0
  125. data/redesign/js/plugins/icheck/skins/flat/aero@2x.png +0 -0
  126. data/redesign/js/plugins/icheck/skins/flat/blue.css +0 -54
  127. data/redesign/js/plugins/icheck/skins/flat/blue.png +0 -0
  128. data/redesign/js/plugins/icheck/skins/flat/blue@2x.png +0 -0
  129. data/redesign/js/plugins/icheck/skins/flat/flat.css +0 -54
  130. data/redesign/js/plugins/icheck/skins/flat/flat.png +0 -0
  131. data/redesign/js/plugins/icheck/skins/flat/flat@2x.png +0 -0
  132. data/redesign/js/plugins/icheck/skins/flat/green.css +0 -54
  133. data/redesign/js/plugins/icheck/skins/flat/green.png +0 -0
  134. data/redesign/js/plugins/icheck/skins/flat/green@2x.png +0 -0
  135. data/redesign/js/plugins/icheck/skins/flat/grey.css +0 -54
  136. data/redesign/js/plugins/icheck/skins/flat/grey.png +0 -0
  137. data/redesign/js/plugins/icheck/skins/flat/grey@2x.png +0 -0
  138. data/redesign/js/plugins/icheck/skins/flat/orange.css +0 -54
  139. data/redesign/js/plugins/icheck/skins/flat/orange.png +0 -0
  140. data/redesign/js/plugins/icheck/skins/flat/orange@2x.png +0 -0
  141. data/redesign/js/plugins/icheck/skins/flat/pink.css +0 -54
  142. data/redesign/js/plugins/icheck/skins/flat/pink.png +0 -0
  143. data/redesign/js/plugins/icheck/skins/flat/pink@2x.png +0 -0
  144. data/redesign/js/plugins/icheck/skins/flat/purple.css +0 -54
  145. data/redesign/js/plugins/icheck/skins/flat/purple.png +0 -0
  146. data/redesign/js/plugins/icheck/skins/flat/purple@2x.png +0 -0
  147. data/redesign/js/plugins/icheck/skins/flat/red.css +0 -54
  148. data/redesign/js/plugins/icheck/skins/flat/red.png +0 -0
  149. data/redesign/js/plugins/icheck/skins/flat/red@2x.png +0 -0
  150. data/redesign/js/plugins/icheck/skins/flat/yellow.css +0 -54
  151. data/redesign/js/plugins/icheck/skins/flat/yellow.png +0 -0
  152. data/redesign/js/plugins/icheck/skins/flat/yellow@2x.png +0 -0
  153. data/redesign/js/plugins/icheck/skins/futurico/futurico.css +0 -54
  154. data/redesign/js/plugins/icheck/skins/futurico/futurico.png +0 -0
  155. data/redesign/js/plugins/icheck/skins/futurico/futurico@2x.png +0 -0
  156. data/redesign/js/plugins/icheck/skins/line/_all.css +0 -740
  157. data/redesign/js/plugins/icheck/skins/line/aero.css +0 -74
  158. data/redesign/js/plugins/icheck/skins/line/blue.css +0 -74
  159. data/redesign/js/plugins/icheck/skins/line/green.css +0 -74
  160. data/redesign/js/plugins/icheck/skins/line/grey.css +0 -74
  161. data/redesign/js/plugins/icheck/skins/line/line.css +0 -74
  162. data/redesign/js/plugins/icheck/skins/line/line.png +0 -0
  163. data/redesign/js/plugins/icheck/skins/line/line@2x.png +0 -0
  164. data/redesign/js/plugins/icheck/skins/line/orange.css +0 -74
  165. data/redesign/js/plugins/icheck/skins/line/pink.css +0 -74
  166. data/redesign/js/plugins/icheck/skins/line/purple.css +0 -74
  167. data/redesign/js/plugins/icheck/skins/line/red.css +0 -74
  168. data/redesign/js/plugins/icheck/skins/line/yellow.css +0 -74
  169. data/redesign/js/plugins/icheck/skins/minimal/_all.css +0 -600
  170. data/redesign/js/plugins/icheck/skins/minimal/aero.css +0 -60
  171. data/redesign/js/plugins/icheck/skins/minimal/aero.png +0 -0
  172. data/redesign/js/plugins/icheck/skins/minimal/aero@2x.png +0 -0
  173. data/redesign/js/plugins/icheck/skins/minimal/blue.css +0 -60
  174. data/redesign/js/plugins/icheck/skins/minimal/blue.png +0 -0
  175. data/redesign/js/plugins/icheck/skins/minimal/blue@2x.png +0 -0
  176. data/redesign/js/plugins/icheck/skins/minimal/green.css +0 -60
  177. data/redesign/js/plugins/icheck/skins/minimal/green.png +0 -0
  178. data/redesign/js/plugins/icheck/skins/minimal/green@2x.png +0 -0
  179. data/redesign/js/plugins/icheck/skins/minimal/grey.css +0 -60
  180. data/redesign/js/plugins/icheck/skins/minimal/grey.png +0 -0
  181. data/redesign/js/plugins/icheck/skins/minimal/grey@2x.png +0 -0
  182. data/redesign/js/plugins/icheck/skins/minimal/minimal.css +0 -60
  183. data/redesign/js/plugins/icheck/skins/minimal/minimal.png +0 -0
  184. data/redesign/js/plugins/icheck/skins/minimal/minimal@2x.png +0 -0
  185. data/redesign/js/plugins/icheck/skins/minimal/orange.css +0 -60
  186. data/redesign/js/plugins/icheck/skins/minimal/orange.png +0 -0
  187. data/redesign/js/plugins/icheck/skins/minimal/orange@2x.png +0 -0
  188. data/redesign/js/plugins/icheck/skins/minimal/pink.css +0 -60
  189. data/redesign/js/plugins/icheck/skins/minimal/pink.png +0 -0
  190. data/redesign/js/plugins/icheck/skins/minimal/pink@2x.png +0 -0
  191. data/redesign/js/plugins/icheck/skins/minimal/purple.css +0 -60
  192. data/redesign/js/plugins/icheck/skins/minimal/purple.png +0 -0
  193. data/redesign/js/plugins/icheck/skins/minimal/purple@2x.png +0 -0
  194. data/redesign/js/plugins/icheck/skins/minimal/red.css +0 -60
  195. data/redesign/js/plugins/icheck/skins/minimal/red.png +0 -0
  196. data/redesign/js/plugins/icheck/skins/minimal/red@2x.png +0 -0
  197. data/redesign/js/plugins/icheck/skins/minimal/yellow.css +0 -60
  198. data/redesign/js/plugins/icheck/skins/minimal/yellow.png +0 -0
  199. data/redesign/js/plugins/icheck/skins/minimal/yellow@2x.png +0 -0
  200. data/redesign/js/plugins/icheck/skins/polaris/polaris.css +0 -60
  201. data/redesign/js/plugins/icheck/skins/polaris/polaris.png +0 -0
  202. data/redesign/js/plugins/icheck/skins/polaris/polaris@2x.png +0 -0
  203. data/redesign/js/plugins/icheck/skins/square/_all.css +0 -600
  204. data/redesign/js/plugins/icheck/skins/square/aero.css +0 -60
  205. data/redesign/js/plugins/icheck/skins/square/aero.png +0 -0
  206. data/redesign/js/plugins/icheck/skins/square/aero@2x.png +0 -0
  207. data/redesign/js/plugins/icheck/skins/square/blue.css +0 -60
  208. data/redesign/js/plugins/icheck/skins/square/blue.png +0 -0
  209. data/redesign/js/plugins/icheck/skins/square/blue@2x.png +0 -0
  210. data/redesign/js/plugins/icheck/skins/square/green.css +0 -60
  211. data/redesign/js/plugins/icheck/skins/square/green.png +0 -0
  212. data/redesign/js/plugins/icheck/skins/square/green@2x.png +0 -0
  213. data/redesign/js/plugins/icheck/skins/square/grey.css +0 -60
  214. data/redesign/js/plugins/icheck/skins/square/grey.png +0 -0
  215. data/redesign/js/plugins/icheck/skins/square/grey@2x.png +0 -0
  216. data/redesign/js/plugins/icheck/skins/square/orange.css +0 -60
  217. data/redesign/js/plugins/icheck/skins/square/orange.png +0 -0
  218. data/redesign/js/plugins/icheck/skins/square/orange@2x.png +0 -0
  219. data/redesign/js/plugins/icheck/skins/square/pink.css +0 -60
  220. data/redesign/js/plugins/icheck/skins/square/pink.png +0 -0
  221. data/redesign/js/plugins/icheck/skins/square/pink@2x.png +0 -0
  222. data/redesign/js/plugins/icheck/skins/square/purple.css +0 -60
  223. data/redesign/js/plugins/icheck/skins/square/purple.png +0 -0
  224. data/redesign/js/plugins/icheck/skins/square/purple@2x.png +0 -0
  225. data/redesign/js/plugins/icheck/skins/square/red.css +0 -60
  226. data/redesign/js/plugins/icheck/skins/square/red.png +0 -0
  227. data/redesign/js/plugins/icheck/skins/square/red@2x.png +0 -0
  228. data/redesign/js/plugins/icheck/skins/square/square.css +0 -60
  229. data/redesign/js/plugins/icheck/skins/square/square.png +0 -0
  230. data/redesign/js/plugins/icheck/skins/square/square@2x.png +0 -0
  231. data/redesign/js/plugins/icheck/skins/square/yellow.css +0 -60
  232. data/redesign/js/plugins/icheck/skins/square/yellow.png +0 -0
  233. data/redesign/js/plugins/icheck/skins/square/yellow@2x.png +0 -0
  234. data/redesign/js/plugins/magnific/jquery.magnific-popup.js +0 -2026
  235. data/redesign/js/plugins/magnific/jquery.magnific-popup.min.js +0 -4
  236. data/redesign/js/plugins/magnific/magnific-popup.css +0 -396
  237. data/redesign/js/plugins/morris/morris.css +0 -1
  238. data/redesign/js/plugins/morris/morris.min.js +0 -1
  239. data/redesign/js/plugins/parsley/parsley.js +0 -1363
  240. data/redesign/js/plugins/select2/select2-spinner.gif +0 -0
  241. data/redesign/js/plugins/select2/select2.css +0 -615
  242. data/redesign/js/plugins/select2/select2.js +0 -3217
  243. data/redesign/js/plugins/select2/select2.min.js +0 -22
  244. data/redesign/js/plugins/select2/select2.png +0 -0
  245. data/redesign/js/plugins/select2/select2x2.png +0 -0
  246. data/redesign/js/plugins/simplecolorpicker/jquery.simplecolorpicker.css +0 -98
  247. data/redesign/js/plugins/simplecolorpicker/jquery.simplecolorpicker.js +0 -211
  248. data/redesign/js/plugins/sparkline/jquery.sparkline.min.js +0 -5
  249. data/redesign/js/plugins/tableCheckable/jquery.tableCheckable.js +0 -122
  250. data/redesign/js/plugins/textarea-counter/jquery.textarea-counter.js +0 -163
  251. data/redesign/js/plugins/timepicker/bootstrap-timepicker.css +0 -121
  252. data/redesign/js/plugins/timepicker/bootstrap-timepicker.js +0 -893
  253. data/redesign/suspects.html +0 -273
  254. data/redesign/whitelist.html +0 -273
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5de4349de8c35b7c4e5abc4055c1b7f7d66cba1
4
- data.tar.gz: d005f992eab2dadb2fb4c1b029887fc341cd211c
3
+ metadata.gz: cd4eeda4bad79b51779af5f7f28411cbdc33be35
4
+ data.tar.gz: 5a1dac9229792475e0365c850d8df150e0812222
5
5
  SHA512:
6
- metadata.gz: 86c153744dfd81b319a119e49d8b90257309e05b4752c5e10d44a2d9c28f4f789d106d9c177e687920646edbda09b8da5675f65d22906cc8ef274e3789f7dc4a
7
- data.tar.gz: 878709b76181ed260acd8fa727661723fde1b21406c4eccb1f40720a05ad6d0d5910fe31c017431685fb1ead263bc5342822f25aeb0a15954169e0bbd2e912e7
6
+ metadata.gz: 3d246b1c4c8e86cb7d442a41302ed309f08efefddce7df8fdb0dcfa0fa5bb17973b7827929ee259486f6ace2d43d55686af5c4a2b5d2e03306951c483ff0ce7f
7
+ data.tar.gz: 0ef3a230ca6bdbea03a65b4b4b98edd261e8f5fafb7022ce7d8e9349dd080808b5c598c7e4c05514469f22c0aac8e21cc80e5a46d2fca286b446e7f8035f3ad6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- repsheet_visualizer (1.0.0)
4
+ repsheet_visualizer (1.1.0)
5
5
  geoip
6
6
  ipaddress
7
7
  json
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. It is still under active development and will undergo some pretty major changes over the next several months.
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.
@@ -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
- RepsheetVisualizer.run!
22
+
23
+ RepsheetVisualizer::App.run!
22
24
  end
@@ -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
- class RepsheetVisualizer < Sinatra::Base
9
- before do
10
- @mount = mount
11
- end
8
+ module RepsheetVisualizer
9
+ class App < Sinatra::Base
10
+ set :show_exceptions, false
12
11
 
13
- helpers do
14
- def action(ip, blacklist=nil)
15
- blacklist = redis_connection.get("#{ip}:repsheet:blacklist") if blacklist.nil?
16
- if blacklist.nil? || blacklist == "false"
17
- "blacklist"
18
- else
19
- "whitelist"
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 replace_invalid_chars(str)
24
- str.encode('UTF-16le', :invalid => :replace, :replace => '?').encode('UTF-8')
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 h(text)
28
- begin
29
- Rack::Utils.escape_html(text)
30
- rescue ArgumentError
31
- replace_invalid_chars(text)
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
- def redis_connection
37
- host = defined?(settings.redis_host) ? settings.redis_host : "localhost"
38
- port = defined?(settings.redis_port) ? settings.redis_port : 6379
39
- Redis.new(:host => host, :port => port)
40
- end
52
+ def mount
53
+ defined?(settings.mount) ? (settings.mount + "/") : "/"
54
+ end
41
55
 
42
- def geoip_database
43
- geoip_database = defined?(settings.geoip_database) ? settings.geoip_database : nil
44
- raise "Missing GeoIP database settings" if geoip_database.nil?
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
- def mount
50
- defined?(settings.mount) ? (settings.mount + "/") : "/"
51
- end
60
+ not_found do
61
+ erb :'404'
62
+ end
52
63
 
53
- def redis_expiry
54
- defined?(settings.redis_expiry) ? (settings.redis_expiry * 60 * 60) : (24 * 60 * 60)
55
- end
64
+ error do
65
+ @e = request.env['sinatra_error']
66
+ erb :'500'
67
+ end
56
68
 
57
- get '/' do
58
- @suspects, @blacklisted = Backend.summary(redis_connection)
59
- @whitelist = Backend.whitelist(redis_connection)
60
- @blacklist_total = Backend.blacklist_total(redis_connection)
61
- erb :index
62
- end
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
- get '/whitelist' do
65
- @whitelist = Backend.whitelist(redis_connection)
66
- erb :whitelist
67
- end
76
+ get '/whitelist' do
77
+ @whitelist = Backend.whitelist(redis_connection)
78
+ erb :whitelist
79
+ end
68
80
 
69
- get '/blacklist' do
70
- @blacklist = Backend.blacklist(redis_connection)
71
- erb :blacklist
72
- end
81
+ get '/blacklist' do
82
+ @blacklist = Backend.blacklist(redis_connection)
83
+ erb :blacklist
84
+ end
73
85
 
74
- get '/suspects' do
75
- @suspects, _ = Backend.suspects(redis_connection)
76
- erb :suspects
77
- end
86
+ get '/suspects' do
87
+ @suspects, _ = Backend.suspects(redis_connection)
88
+ erb :suspects
89
+ end
78
90
 
79
- get '/breakdown' do
80
- @data = Backend.breakdown(redis_connection)
81
- erb :breakdown
82
- end
91
+ get '/breakdown' do
92
+ @data = Backend.breakdown(redis_connection)
93
+ erb :breakdown
94
+ end
83
95
 
84
- get '/worldview' do
85
- @data = Backend.worldview(redis_connection, geoip_database)
86
- erb :worldview
87
- end
96
+ get '/worldview' do
97
+ @data = Backend.worldview(redis_connection, geoip_database)
98
+ erb :worldview
99
+ end
88
100
 
89
- get '/actors/:ip' do
90
- @ip = params[:ip]
91
- @activity = Backend.activity(redis_connection, @ip)
92
- triggered = Backend.triggered_rules(redis_connection, @ip)
93
- offenses = Backend.score_actor(redis_connection, @ip, triggered, false)
94
- @modsecurity = {:triggered => triggered.join(", "), :offenses => offenses}
95
- @ofdp_score = Backend.ofdp_score(redis_connection, @ip) || 0
96
- @whitelisted = Backend.whitelisted?(redis_connection, @ip)
97
- @blacklisted = Backend.blacklisted?(redis_connection, @ip)
98
-
99
- details = geoip_database.country(@ip)
100
- unless details.nil?
101
- @lat = details.latitude
102
- @lng = details.longitude
103
- @country = details.country_name
104
- @region = details.region_name
105
- @city = details.city_name
106
- end
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
- post '/search' do
113
- @ip = params[:ip]
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
- post '/action' do
122
- connection = redis_connection
123
- if params["action"] == "whitelist"
124
- connection.set("#{params[:ip]}:repsheet:whitelist", "true")
125
- connection.del("#{params[:ip]}:repsheet:blacklist")
126
- connection.del("#{params[:ip]}:repsheet")
127
- connection.del("#{params[:ip]}:detected")
128
- connection.srem("repsheet:blacklist:history", params[:ip])
129
- elsif params["action"] == "blacklist"
130
- ttl = connection.ttl("#{params[:ip]}:requests")
131
- connection.setex("#{params[:ip]}:repsheet:blacklist", ttl, "true")
132
- connection.sadd("repsheet:blacklist:history", params[:ip])
133
- connection.del("#{params[:ip]}:repsheet:whitelist")
134
- end
135
- redirect back
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>