risu 1.7.5 → 1.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +16 -10
  3. data/Gemfile.lock +125 -102
  4. data/LICENSE +2 -1
  5. data/NEWS.markdown +23 -2
  6. data/README.markdown +35 -22
  7. data/Rakefile +4 -4
  8. data/bin/risu +1 -1
  9. data/lib/risu.rb +12 -7
  10. data/lib/risu/base.rb +1 -1
  11. data/lib/risu/base/post_process_base.rb +2 -3
  12. data/lib/risu/base/post_process_manager.rb +2 -2
  13. data/lib/risu/base/schema.rb +3 -3
  14. data/lib/risu/base/shares_template_helper.rb +37 -3
  15. data/lib/risu/base/template_base.rb +2 -2
  16. data/lib/risu/base/template_helper.rb +4 -4
  17. data/lib/risu/base/template_manager.rb +2 -2
  18. data/lib/risu/base/templater.rb +1 -1
  19. data/lib/risu/cli.rb +1 -1
  20. data/lib/risu/cli/application.rb +7 -6
  21. data/lib/risu/cli/banner.rb +1 -1
  22. data/lib/risu/exceptions.rb +1 -1
  23. data/lib/risu/exceptions/invaliddocument.rb +1 -1
  24. data/lib/risu/graphs.rb +32 -0
  25. data/lib/risu/graphs/top_vuln_graph.rb +59 -0
  26. data/lib/risu/graphs/windows_os_graph.rb +134 -0
  27. data/lib/risu/models.rb +1 -1
  28. data/lib/risu/models/attachment.rb +1 -1
  29. data/lib/risu/models/familyselection.rb +1 -1
  30. data/lib/risu/models/host.rb +100 -44
  31. data/lib/risu/models/hostproperty.rb +1 -1
  32. data/lib/risu/models/individualpluginselection.rb +1 -1
  33. data/lib/risu/models/item.rb +43 -15
  34. data/lib/risu/models/patch.rb +1 -1
  35. data/lib/risu/models/plugin.rb +2 -2
  36. data/lib/risu/models/pluginspreference.rb +1 -1
  37. data/lib/risu/models/policy.rb +1 -1
  38. data/lib/risu/models/reference.rb +4 -3
  39. data/lib/risu/models/report.rb +2 -2
  40. data/lib/risu/models/serverpreference.rb +1 -1
  41. data/lib/risu/models/servicedescription.rb +1 -1
  42. data/lib/risu/models/version.rb +1 -1
  43. data/lib/risu/parsers.rb +1 -1
  44. data/lib/risu/parsers/nessus/nessus_document.rb +7 -1
  45. data/lib/risu/parsers/nessus/nessus_sax_listener.rb +6 -4
  46. data/lib/risu/parsers/nessus/postprocess.rb +2 -2
  47. data/lib/risu/parsers/nessus/postprocess/adobe_acrobat.rb +1 -1
  48. data/lib/risu/parsers/nessus/postprocess/adobe_air.rb +1 -1
  49. data/lib/risu/parsers/nessus/postprocess/adobe_reader.rb +1 -1
  50. data/lib/risu/parsers/nessus/postprocess/apache.rb +1 -1
  51. data/lib/risu/parsers/nessus/postprocess/apache_tomcat.rb +53 -0
  52. data/lib/risu/parsers/nessus/postprocess/apple_quicktime.rb +1 -1
  53. data/lib/risu/parsers/nessus/postprocess/blackberry_enterprise_server.rb +1 -1
  54. data/lib/risu/parsers/nessus/postprocess/ca_brightstor_arcserve.rb +1 -1
  55. data/lib/risu/parsers/nessus/postprocess/core_ftp.rb +1 -1
  56. data/lib/risu/parsers/nessus/postprocess/db2.rb +1 -1
  57. data/lib/risu/parsers/nessus/postprocess/downgrade_plugins.rb +1 -1
  58. data/lib/risu/parsers/nessus/postprocess/filezilla.rb +1 -1
  59. data/lib/risu/parsers/nessus/postprocess/firefox.rb +1 -1
  60. data/lib/risu/parsers/nessus/postprocess/flash_player.rb +1 -1
  61. data/lib/risu/parsers/nessus/postprocess/flexnet.rb +1 -1
  62. data/lib/risu/parsers/nessus/postprocess/foxit_reader.rb +1 -1
  63. data/lib/risu/parsers/nessus/postprocess/google_chrome.rb +1 -1
  64. data/lib/risu/parsers/nessus/postprocess/hp_system_mgt_homepage.rb +1 -1
  65. data/lib/risu/parsers/nessus/postprocess/java.rb +1 -1
  66. data/lib/risu/parsers/nessus/postprocess/openssh.rb +3 -1
  67. data/lib/risu/parsers/nessus/postprocess/openssl.rb +1 -1
  68. data/lib/risu/parsers/nessus/postprocess/oracle_database.rb +1 -1
  69. data/lib/risu/parsers/nessus/postprocess/php.rb +1 -1
  70. data/lib/risu/parsers/nessus/postprocess/post_process.rb +1 -1
  71. data/lib/risu/parsers/nessus/postprocess/risk_score.rb +2 -2
  72. data/lib/risu/parsers/nessus/postprocess/root_cause.rb +12 -7
  73. data/lib/risu/parsers/nessus/postprocess/servu.rb +1 -1
  74. data/lib/risu/parsers/nessus/postprocess/shockwave.rb +1 -1
  75. data/lib/risu/parsers/nessus/postprocess/sigplus_pro.rb +1 -1
  76. data/lib/risu/parsers/nessus/postprocess/symantec_pcanywhere.rb +1 -1
  77. data/lib/risu/parsers/nessus/postprocess/vlc.rb +1 -1
  78. data/lib/risu/parsers/nessus/postprocess/vmware_esxi.rb +3 -1
  79. data/lib/risu/parsers/nessus/postprocess/vmware_player.rb +1 -1
  80. data/lib/risu/parsers/nessus/postprocess/vmware_vcenter.rb +1 -1
  81. data/lib/risu/parsers/nessus/postprocess/vmware_vsphere_client.rb +1 -1
  82. data/lib/risu/parsers/nessus/postprocess/windows.rb +1 -1
  83. data/lib/risu/parsers/nessus/postprocess/winscp.rb +1 -1
  84. data/lib/risu/parsers/nessus/postprocess/wireshark.rb +1 -1
  85. data/lib/risu/parsers/nexpose/nexpose_document.rb +1 -1
  86. data/lib/risu/parsers/nexpose/simple_nexpose.rb +3 -3
  87. data/lib/risu/renderers.rb +1 -1
  88. data/lib/risu/renderers/csvrenderer.rb +4 -4
  89. data/lib/risu/renderers/nilrenderer.rb +4 -4
  90. data/lib/risu/renderers/pdfrenderer.rb +5 -5
  91. data/lib/risu/template_helpers.rb +32 -0
  92. data/lib/risu/templates/assets.rb +1 -1
  93. data/lib/risu/templates/cover_sheet.rb +1 -1
  94. data/lib/risu/templates/exec_summary.rb +1 -1
  95. data/lib/risu/templates/executive_summary_detailed.rb +1 -1
  96. data/lib/risu/templates/exploitablity_summary.rb +1 -1
  97. data/lib/risu/templates/finding_statistics.rb +1 -1
  98. data/lib/risu/templates/findings_host.rb +1 -1
  99. data/lib/risu/templates/findings_summary.rb +1 -1
  100. data/lib/risu/templates/findings_summary_with_pluginid.rb +1 -1
  101. data/lib/risu/templates/graphs.rb +1 -1
  102. data/lib/risu/templates/host_findings_csv.rb +1 -1
  103. data/lib/risu/templates/host_summary.rb +1 -1
  104. data/lib/risu/templates/malicious_process_detection.rb +1 -1
  105. data/lib/risu/templates/missing_root_causes.rb +1 -1
  106. data/lib/risu/templates/ms_patch_summary.rb +1 -1
  107. data/lib/risu/templates/ms_update_summary.rb +1 -1
  108. data/lib/risu/templates/ms_wsus_findings.rb +1 -1
  109. data/lib/risu/templates/notable.rb +1 -1
  110. data/lib/risu/templates/notable_detailed.rb +1 -1
  111. data/lib/risu/templates/pci_compliance.rb +1 -1
  112. data/lib/risu/templates/stig_findings_summary.rb +2 -2
  113. data/lib/risu/templates/talking_points.rb +5 -5
  114. data/lib/risu/templates/technical_findings.rb +1 -1
  115. data/lib/risu/templates/template.rb +1 -1
  116. data/lib/risu/templates/top_25.rb +1 -1
  117. data/lib/risu/version.rb +33 -0
  118. data/risu.gemspec +21 -20
  119. metadata +161 -67
  120. data/Gemfile.ci +0 -12
@@ -0,0 +1,134 @@
1
+ # Copyright (c) 2010-2016 Arxopia LLC.
2
+ # All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are met:
6
+ #
7
+ # * Redistributions of source code must retain the above copyright
8
+ # notice, this list of conditions and the following disclaimer.
9
+ # * Redistributions in binary form must reproduce the above copyright
10
+ # notice, this list of conditions and the following disclaimer in the
11
+ # documentation and/or other materials provided with the distribution.
12
+ # * Neither the name of the Arxopia LLC nor the names of its contributors
13
+ # may be used to endorse or promote products derived from this software
14
+ # without specific prior written permission.
15
+ #
16
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
+ # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ # DISCLAIMED. IN NO EVENT SHALL ARXOPIA LLC BE LIABLE FOR ANY DIRECT, INDIRECT,
20
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
22
+ # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
24
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
25
+ # OF THE POSSIBILITY OF SUCH DAMAGE.
26
+
27
+ module Risu
28
+ module Graphs
29
+
30
+ # TopVulnGraph
31
+ #
32
+ class TopVulnGraph
33
+ def graph
34
+ g = Gruff::Pie.new(GRAPH_WIDTH)
35
+ g.title = "Windows Operating Systems By Percentage"
36
+ g.sort = false
37
+ g.marker_count = 1
38
+ g.theme = {
39
+ :colors => Risu::GRAPH_COLORS,
40
+ :background_colors => %w(white white)
41
+ }
42
+
43
+ nt = Host.os_windows_nt.to_a.count
44
+ w2k = Host.os_windows_2k.to_a.count
45
+ xp = Host.os_windows_xp.to_a.count
46
+ w2k3 = Host.os_windows_2k3.to_a.count
47
+ vista = Host.os_windows_vista.to_a.count
48
+ w2k8 = Host.os_windows_2k8.to_a.count
49
+ w2k12 = Host.os_windows_2k12.to_a.count
50
+ w7 = Host.os_windows_7.to_a.count
51
+ w8 = Host.os_windows_8.to_a.count
52
+ other = (Host.os_windows.os_windows_other).to_a.count
53
+
54
+ g.data("NT", nt) if nt >= 1
55
+ g.data("2000", w2k) if w2k >= 1
56
+ g.data("XP", xp) if xp >= 1
57
+ g.data("Server 2003", w2k3) if w2k3 >= 1
58
+ g.data("Vista", vista) if vista >= 1
59
+ g.data("Server 2008", w2k8) if w2k8 >= 1
60
+ g.data("Server 2012", w2k12) if w2k12 >= 1
61
+ g.data("7", w7) if w7 >= 1
62
+ g.data("8", w8) if w8 >= 1
63
+ g.data("Other Windows", other) if other >= 1
64
+
65
+ StringIO.new(g.to_blob)
66
+ end
67
+
68
+ def text
69
+ nt = Host.os_windows_nt.to_a.count
70
+ w2k = Host.os_windows_2k.to_a.count
71
+ xp = Host.os_windows_xp.to_a.count
72
+ w2k3 = Host.os_windows_2k3.to_a.count
73
+ vista = Host.os_windows_vista.to_a.count
74
+ w2k8 = Host.os_windows_2k8.to_a.count
75
+ w2k12 = Host.os_windows_2k12.to_a.count
76
+ w7 = Host.os_windows_7.to_a.count
77
+ w8 = Host.os_windows_8.to_a.count
78
+ other = (Host.os_windows.os_windows_other).to_a.count
79
+
80
+ windows_os_count = nt + w2k + xp + w2k3 + vista + w7 + w8 + w2k8 + w2k12 + other
81
+
82
+ nt_percent = (nt.to_f / windows_os_count.to_f) * 100
83
+ w2k_percent = (w2k.to_f / windows_os_count.to_f) * 100
84
+ xp_percent = (xp.to_f / windows_os_count.to_f) * 100
85
+ w2k3_percent = (w2k3.to_f / windows_os_count.to_f) * 100
86
+ vista_percent = (vista.to_f / windows_os_count.to_f) * 100
87
+
88
+ w2k8_percent = (w2k8.to_f / windows_os_count.to_f) * 100
89
+ w7_percent = (w7.to_f / windows_os_count.to_f) * 100
90
+ w8_percent = (w8.to_f / windows_os_count.to_f) * 100
91
+ w2k12_percent = (w2k12.to_f / windows_os_count.to_f) * 100
92
+
93
+ text = "This graph shows the percentage of the different Microsoft Windows based operating systems " +
94
+ "found on the #{Report.title} network.\n\n"
95
+
96
+ text << "#{nt_percent.round.to_i}% of the network is Windows NT. " if nt_percent >= 1
97
+ text << "#{w2k_percent.round.to_i}% of the network is Windows 2000. " if w2k_percent >= 1
98
+ text << "#{xp_percent.round.to_i}% of the network is Windows XP. " if xp_percent >= 1
99
+ text << "#{w2k3_percent.round.to_i}% of the network is Windows Server 2003. " if w2k3_percent >= 1
100
+ text << "#{vista_percent.round.to_i}% of the network is Windows Vista. " if vista_percent >= 1
101
+ text << "#{w2k8_percent.round.to_i}% of the network is Windows Server 2008. " if w2k8_percent >= 1
102
+ text << "#{w7_percent.round.to_i}% of the network is Windows 7. " if w7_percent >= 1
103
+ text << "#{w8_percent.round.to_i}% of the network is Windows 8. " if w8_percent >= 1
104
+ text << "#{w2k12_percent.round.to_i}% of the network is Windows Server 20012. " if w2k12_percent >= 1
105
+
106
+ text << "\n\n" << unsupported_os_windows if nt > 0 or w2k > 0
107
+
108
+ return text
109
+ end
110
+
111
+ #
112
+ # @TODO comments
113
+ #
114
+ def has_data?
115
+ nt = Host.os_windows_nt.to_a.size
116
+ w2k = Host.os_windows_2k.to_a.size
117
+ xp = Host.os_windows_xp.to_a.size
118
+ w2k3 = Host.os_windows_2k3.to_a.size
119
+ vista = Host.os_windows_vista.to_a.size
120
+ w2k8 = Host.os_windows_2k8.to_a.size
121
+ w2k12 = Host.os_windows_2k12.to_a.size
122
+ w7 = Host.os_windows_7.to_a.size
123
+ w8 = Host.os_windows_8.to_a.size
124
+ other = (Host.os_windows.os_windows_other).to_a.size
125
+
126
+ if nt == 0 && w2k == 0 && xp == 0 && w2k3 == 0 && vista == 0 && w2k8 == 0 && w2k12 == 0 && w7 == 0 && w8 == 0 && other == 0
127
+ return false
128
+ else
129
+ return true
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2010-2015 Arxopia LLC.
1
+ # Copyright (c) 2010-2016 Arxopia LLC.
2
2
  # All rights reserved.
3
3
  #
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2010-2015 Arxopia LLC.
1
+ # Copyright (c) 2010-2016 Arxopia LLC.
2
2
  # All rights reserved.
3
3
  #
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2010-2015 Arxopia LLC.
1
+ # Copyright (c) 2010-2016 Arxopia LLC.
2
2
  # All rights reserved.
3
3
  #
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2010-2015 Arxopia LLC.
1
+ # Copyright (c) 2010-2016 Arxopia LLC.
2
2
  # All rights reserved.
3
3
  #
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -157,6 +157,9 @@ module Risu
157
157
 
158
158
  # Negation query for all hosts with a Windows 2000 based Operating system
159
159
  #
160
+ #
161
+ # @TODO update to use rails not syntax
162
+ #
160
163
  # @return [ActiveRecord::Relation] with the query results
161
164
  def not_os_windows_2k
162
165
  where("os NOT LIKE '%Windows 2000%'")
@@ -171,6 +174,9 @@ module Risu
171
174
 
172
175
  # Negation query for all hosts with a Windows XP based Operating system
173
176
  #
177
+ #
178
+ # @TODO update to use rails not syntax
179
+ #
174
180
  # @return [ActiveRecord::Relation] with the query results
175
181
  def not_os_windows_xp
176
182
  where("os NOT LIKE '%Windows XP%'")
@@ -185,6 +191,9 @@ module Risu
185
191
 
186
192
  # Negation query for all hosts with a Windows Server 2003 based Operating system
187
193
  #
194
+ #
195
+ # @TODO update to use rails not syntax
196
+ #
188
197
  # @return [ActiveRecord::Relation] with the query results
189
198
  def not_os_windows_2k3
190
199
  where("os NOT LIKE '%Windows Server 2003%'")
@@ -199,6 +208,9 @@ module Risu
199
208
 
200
209
  # Negation query for all hosts with a Windows Vista based Operating system
201
210
  #
211
+ #
212
+ # @TODO update to use rails not syntax
213
+ #
202
214
  # @return [ActiveRecord::Relation] with the query results
203
215
  def not_os_windows_vista
204
216
  where("os NOT LIKE '%Windows Vista%'")
@@ -213,6 +225,9 @@ module Risu
213
225
 
214
226
  # Negation query for all hosts with a Windows Server 2008 based Operating system
215
227
  #
228
+ #
229
+ # @TODO update to use rails not syntax
230
+ #
216
231
  # @return [ActiveRecord::Relation] with the query results
217
232
  def not_os_windows_2k8
218
233
  where("os NOT LIKE '%Windows Server 2008%'")
@@ -227,6 +242,9 @@ module Risu
227
242
 
228
243
  # Negation query for all hosts with a Windows Server 2012 based Operating system
229
244
  #
245
+ #
246
+ # @TODO update to use rails not syntax
247
+ #
230
248
  # @return [ActiveRecord::Relation] with the query results
231
249
  def not_os_windows_2k12
232
250
  where("os NOT LIKE '%Windows Server 2012%'")
@@ -241,6 +259,9 @@ module Risu
241
259
 
242
260
  # Negation query for all hosts with a Windows 7 based Operating system
243
261
  #
262
+ #
263
+ # @TODO update to use rails not syntax
264
+ #
244
265
  # @return [ActiveRecord::Relation] with the query results
245
266
  def not_os_windows_7
246
267
  where("os NOT LIKE '%Windows 7%'")
@@ -255,11 +276,27 @@ module Risu
255
276
 
256
277
  # Negation query for all hosts with a Windows 8 based Operating system
257
278
  #
279
+ # @TODO update to use rails not syntax
280
+ #
258
281
  # @return [ActiveRecord::Relation] with the query results
259
282
  def not_os_windows_8
260
283
  where("os NOT LIKE '%Windows 8%'")
261
284
  end
262
285
 
286
+ # Queries for hosts with a Windows 10 based Operating System
287
+ #
288
+ # @return [ActiveRecord::Relation] with the query results
289
+ def os_windows_10
290
+ where("os LIKE '%Windows 10%'")
291
+ end
292
+
293
+ # Negation query for all hosts with a Windows 10 based Operating system
294
+ #
295
+ # @return [ActiveRecord::Relation] with the query results
296
+ def not_os_windows_10
297
+ where("os NOT LIKE '%Windows 10%'")
298
+ end
299
+
263
300
  # Queries for hosts with a Windows Operating System that are not 2000,
264
301
  # XP, 2003, Vista, 2008 or 7
265
302
  #
@@ -366,12 +403,12 @@ module Risu
366
403
  where("os NOT LIKE '%Mac OS X%'")
367
404
  end
368
405
 
369
- #@todo comment
406
+ #@TODO comment
370
407
  def os_aix
371
408
  where("os LIKE '%AIX%'")
372
409
  end
373
410
 
374
- #@todo comment
411
+ #@TODO comment
375
412
  def not_os_aix
376
413
  where("os NOT LIKE '%AIX%'")
377
414
  end
@@ -385,6 +422,8 @@ module Risu
385
422
 
386
423
  # Generates a graph of the high and medium findings count per host
387
424
  #
425
+ # @deprecated
426
+ #
388
427
  # @return [StringIO] Binary image object of the results
389
428
  def top_vuln_graph(limit=10)
390
429
  g = Gruff::Bar.new(GRAPH_WIDTH)
@@ -398,8 +437,8 @@ module Risu
398
437
 
399
438
  Item.risks_by_host(limit).to_a.each do |item|
400
439
  ip = Host.find_by_id(item.host_id).name
401
- # count = Item.where(:host_id => item.host_id).where("severity IN (?)", [2,3]).count
402
440
  count = Item.where(:host_id => item.host_id).where(:severity => 4).count
441
+
403
442
  if count > 0
404
443
  g.data(ip, count)
405
444
  end
@@ -408,20 +447,20 @@ module Risu
408
447
  StringIO.new(g.to_blob)
409
448
  end
410
449
 
411
- #
412
- # @todo comments
450
+ # @deprecated
451
+ # @TODO comments
413
452
  #
414
453
  def windows_os_graph_has_data?
415
- nt = Host.os_windows_nt.to_a.count
416
- w2k = Host.os_windows_2k.to_a.count
417
- xp = Host.os_windows_xp.to_a.count
418
- w2k3 = Host.os_windows_2k3.to_a.count
419
- vista = Host.os_windows_vista.to_a.count
420
- w2k8 = Host.os_windows_2k8.to_a.count
421
- w2k12 = Host.os_windows_2k12.to_a.count
422
- w7 = Host.os_windows_7.to_a.count
423
- w8 = Host.os_windows_8.to_a.count
424
- other = (Host.os_windows.os_windows_other).to_a.count
454
+ nt = Host.os_windows_nt.to_a.size
455
+ w2k = Host.os_windows_2k.to_a.size
456
+ xp = Host.os_windows_xp.to_a.size
457
+ w2k3 = Host.os_windows_2k3.to_a.size
458
+ vista = Host.os_windows_vista.to_a.size
459
+ w2k8 = Host.os_windows_2k8.to_a.size
460
+ w2k12 = Host.os_windows_2k12.to_a.size
461
+ w7 = Host.os_windows_7.to_a.size
462
+ w8 = Host.os_windows_8.to_a.size
463
+ other = (Host.os_windows.os_windows_other).to_a.size
425
464
 
426
465
  if nt == 0 && w2k == 0 && xp == 0 && w2k3 == 0 && vista == 0 && w2k8 == 0 && w2k12 == 0 && w7 == 0 && w8 == 0 && other == 0
427
466
  return false
@@ -431,20 +470,29 @@ module Risu
431
470
  end
432
471
 
433
472
  #
434
- # @todo comments
473
+ # @deprecated
474
+ # @TODO comments
435
475
  #
436
476
  def other_os_graph_has_data?
437
- linux = Host.os_linux.to_a.count
438
- osx = Host.os_osx.to_a.count
439
- freebsd = Host.os_freebsd.to_a.count
440
- netbsd = Host.os_netbsd.to_a.count
441
- cisco = Host.os_cisco.to_a.count
442
- vxworks = Host.os_vxworks.to_a.count
443
- esx = Host.os_vmware_esx.to_a.count
444
- aix = Host.os_aix.to_a.count
445
- other = Host.os_other.to_a.count
446
-
447
- if linux == 0 && osx == 0 && freebsd == 0 && cisco == 0 && vxworks == 0 && esx == 0 && aix == 0 && other == 0
477
+ linux = Host.os_linux.to_a.size
478
+ osx = Host.os_osx.to_a.size
479
+ freebsd = Host.os_freebsd.to_a.size
480
+ netbsd = Host.os_netbsd.to_a.size
481
+ cisco = Host.os_cisco.to_a.size
482
+ vxworks = Host.os_vxworks.to_a.size
483
+ esx = Host.os_vmware_esx.to_a.size
484
+ aix = Host.os_aix.to_a.size
485
+ other = Host.os_other.to_a.size
486
+
487
+ if linux == 0 &&
488
+ osx == 0 &&
489
+ freebsd == 0 &&
490
+ netbsd == 0 &&
491
+ cisco == 0 &&
492
+ vxworks == 0 &&
493
+ esx == 0 &&
494
+ aix == 0 &&
495
+ other == 0
448
496
  return false
449
497
  else
450
498
  return true
@@ -453,6 +501,7 @@ module Risu
453
501
 
454
502
  # Graphs the percentage of other "non Windows" Operating Systems
455
503
  #
504
+ # @deprecated
456
505
  # @return [StringIO] Binary image object of the results
457
506
  def other_os_graph
458
507
  g = Gruff::Pie.new(GRAPH_WIDTH)
@@ -493,6 +542,7 @@ module Risu
493
542
  end
494
543
 
495
544
  # Graphs the percentage of Windows Operating Systems
545
+ # @deprecated
496
546
  #
497
547
  # @return [StringIO] Binary image object of the results
498
548
  def windows_os_graph
@@ -530,8 +580,8 @@ module Risu
530
580
  StringIO.new(g.to_blob)
531
581
  end
532
582
 
533
- #
534
- #@todo comment
583
+ # @deprecated
584
+ #@TODO comment
535
585
  #
536
586
  def windows_os_graph_text
537
587
  nt = Host.os_windows_nt.to_a.count
@@ -561,6 +611,7 @@ module Risu
561
611
  text = "This graph shows the percentage of the different Microsoft Windows based operating systems " +
562
612
  "found on the #{Report.title} network.\n\n"
563
613
 
614
+ # @TODO this should be a table sorted by %
564
615
  text << "#{nt_percent.round.to_i}% of the network is Windows NT. " if nt_percent >= 1
565
616
  text << "#{w2k_percent.round.to_i}% of the network is Windows 2000. " if w2k_percent >= 1
566
617
  text << "#{xp_percent.round.to_i}% of the network is Windows XP. " if xp_percent >= 1
@@ -577,7 +628,7 @@ module Risu
577
628
  end
578
629
 
579
630
  #
580
- # @todo comments
631
+ # @TODO comments
581
632
  #
582
633
  def unsupported_os?
583
634
  aix_text = unsupported_os_aix
@@ -592,7 +643,8 @@ module Risu
592
643
  return true
593
644
  end
594
645
 
595
- # @todo add plural check
646
+ # @TODO add plural check
647
+ # @deprecated
596
648
  #
597
649
  def unsupported_os_text
598
650
  if !unsupported_os?
@@ -614,7 +666,8 @@ module Risu
614
666
  return unsupported_os_text
615
667
  end
616
668
 
617
- # @todo comments
669
+ # @TODO comments
670
+ # @deprecated
618
671
  def unsupported_os_windows
619
672
  win_95_text = ""
620
673
  win_98_text = ""
@@ -658,7 +711,8 @@ module Risu
658
711
  return "#{win_95_text}#{win_98_text}#{win_me_text}#{win_nt_text}#{win_2000_text}#{win_xp_text}#{win_2003_text}"
659
712
  end
660
713
 
661
- # @todo comments
714
+ # @TODO comments
715
+ # @deprecated
662
716
  def unsupported_os_aix
663
717
  text = ""
664
718
  aix = Host.os_aix.where("OS LIKE 'AIX 5.%'")
@@ -670,7 +724,8 @@ module Risu
670
724
  return text
671
725
  end
672
726
 
673
- # @todo comments
727
+ # @TODO comments
728
+ # @deprecated
674
729
  def unsupported_os_freebsd
675
730
  text = ""
676
731
  freebsd = Host.os_freebsd.where("OS LIKE 'FreeBSD 5.%'")
@@ -681,8 +736,9 @@ module Risu
681
736
  return text
682
737
  end
683
738
 
684
- # @todo comments
739
+ # @TODO comments
685
740
  #turn the os counts into blocks
741
+ # @deprecated
686
742
  def other_os_graph_text
687
743
  text = "This graph shows the percentage of the different Non-Windows based operating systems " +
688
744
  "found on the #{Report.title} network.\n\n"
@@ -718,7 +774,7 @@ module Risu
718
774
  end
719
775
 
720
776
  #
721
- # @todo comments
777
+ # @TODO comments
722
778
  #
723
779
  def top_n_vulnerable(n)
724
780
  hosts = Item.risks_by_host(Host.count).count
@@ -735,24 +791,24 @@ module Risu
735
791
  end
736
792
 
737
793
  #
738
- # @todo comments
794
+ # @TODO comments
739
795
  #
740
796
  def unique_hosts_with_critical
741
- hosts = Item.critical_risks_by_host(Host.all.count).count
742
- hosts = hosts.sort_by {|k, v| v}
797
+ hosts = Item.critical_risks_by_host(Host.all.size).size
798
+ hosts = hosts.sort_by {| _k, v | v}
743
799
  hosts.reverse!
744
800
  end
745
801
 
746
802
  #
747
- # @todo comments
803
+ # @TODO comments
748
804
  #
749
805
  def unique_hosts_with_high
750
- hosts = Item.high_risks_by_host(Host.all.count).count
751
- hosts = hosts.sort_by {|k, v| v}
806
+ hosts = Item.high_risks_by_host(Host.all.size).size
807
+ hosts = hosts.sort_by {| _k, v | v}
752
808
  hosts.reverse!
753
809
  end
754
810
 
755
- # @todo
811
+ # @TODO
756
812
  def unique_hosts_with_critical_and_high_count
757
813
  hosts = Array.new
758
814
  crit = Item.critical_risks_by_host(Host.all.count)