risu 1.6.3 → 1.7.0

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 (101) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +12 -0
  3. data/Gemfile.ci +9 -9
  4. data/Gemfile.lock +118 -0
  5. data/LICENSE +1 -1
  6. data/NEWS.markdown +98 -0
  7. data/README.markdown +10 -3
  8. data/Rakefile +2 -2
  9. data/bin/risu +3 -3
  10. data/lib/risu.rb +6 -2
  11. data/lib/risu/base.rb +10 -3
  12. data/lib/risu/base/graph_template_helper.rb +71 -0
  13. data/lib/risu/base/host_template_helper.rb +75 -0
  14. data/lib/risu/base/malware_template_helper.rb +96 -0
  15. data/lib/risu/base/post_process_base.rb +210 -0
  16. data/lib/risu/base/post_process_manager.rb +120 -0
  17. data/lib/risu/base/schema.rb +10 -7
  18. data/lib/risu/base/shares_template_helper.rb +158 -0
  19. data/lib/risu/base/template_base.rb +12 -10
  20. data/lib/risu/base/template_helper.rb +105 -3
  21. data/lib/risu/base/template_manager.rb +16 -12
  22. data/lib/risu/base/templater.rb +23 -9
  23. data/lib/risu/cli.rb +1 -1
  24. data/lib/risu/cli/application.rb +23 -17
  25. data/lib/risu/cli/banner.rb +3 -3
  26. data/lib/risu/exceptions.rb +1 -1
  27. data/lib/risu/exceptions/invaliddocument.rb +1 -1
  28. data/lib/risu/models.rb +1 -1
  29. data/lib/risu/models/attachment.rb +3 -3
  30. data/lib/risu/models/familyselection.rb +3 -3
  31. data/lib/risu/models/host.rb +74 -9
  32. data/lib/risu/models/hostproperty.rb +3 -3
  33. data/lib/risu/models/individualpluginselection.rb +3 -3
  34. data/lib/risu/models/item.rb +92 -29
  35. data/lib/risu/models/patch.rb +3 -3
  36. data/lib/risu/models/plugin.rb +30 -2
  37. data/lib/risu/models/pluginspreference.rb +1 -1
  38. data/lib/risu/models/policy.rb +1 -1
  39. data/lib/risu/models/reference.rb +1 -1
  40. data/lib/risu/models/report.rb +1 -2
  41. data/lib/risu/models/serverpreference.rb +1 -1
  42. data/lib/risu/models/servicedescription.rb +3 -3
  43. data/lib/risu/models/version.rb +1 -1
  44. data/lib/risu/parsers.rb +1 -1
  45. data/lib/risu/parsers/nessus/nessus_document.rb +3 -3
  46. data/lib/risu/parsers/nessus/nessus_sax_listener.rb +23 -16
  47. data/lib/risu/parsers/nessus/postprocess.rb +3 -6
  48. data/lib/risu/parsers/nessus/postprocess/adobe_air.rb +82 -0
  49. data/lib/risu/parsers/nessus/postprocess/adobe_reader.rb +86 -0
  50. data/lib/risu/parsers/nessus/postprocess/apache.rb +67 -0
  51. data/lib/risu/parsers/nessus/postprocess/core_ftp.rb +52 -0
  52. data/lib/risu/parsers/nessus/postprocess/flash_player.rb +104 -0
  53. data/lib/risu/parsers/nessus/postprocess/flexnet.rb +53 -0
  54. data/lib/risu/parsers/nessus/postprocess/google_chrome.rb +52 -0
  55. data/lib/risu/parsers/nessus/postprocess/hp_system_mgt_homepage.rb +60 -0
  56. data/lib/risu/parsers/nessus/postprocess/java.rb +49 -198
  57. data/lib/risu/parsers/nessus/postprocess/openssh.rb +65 -0
  58. data/lib/risu/parsers/nessus/postprocess/openssl.rb +54 -0
  59. data/lib/risu/parsers/nessus/postprocess/oracle_database.rb +84 -0
  60. data/lib/risu/parsers/nessus/postprocess/php.rb +62 -0
  61. data/lib/risu/parsers/nessus/postprocess/post_process.rb +178 -0
  62. data/lib/risu/parsers/nessus/postprocess/risk_score.rb +10 -5
  63. data/lib/risu/parsers/nessus/postprocess/root_cause.rb +375 -0
  64. data/lib/risu/parsers/nessus/postprocess/servu.rb +57 -0
  65. data/lib/risu/parsers/nessus/postprocess/shockwave.rb +73 -0
  66. data/lib/risu/parsers/nessus/postprocess/windows.rb +57 -0
  67. data/lib/risu/parsers/nessus/postprocess/wireshark.rb +72 -0
  68. data/lib/risu/parsers/nexpose/nexpose_document.rb +1 -1
  69. data/lib/risu/parsers/nexpose/simple_nexpose.rb +1 -1
  70. data/lib/risu/renderers.rb +3 -1
  71. data/lib/risu/renderers/csvrenderer.rb +53 -0
  72. data/lib/risu/renderers/nilrenderer.rb +1 -1
  73. data/lib/risu/renderers/pdfrenderer.rb +57 -0
  74. data/lib/risu/templates/assets.rb +5 -4
  75. data/lib/risu/templates/cover_sheet.rb +4 -3
  76. data/lib/risu/templates/exec_summary.rb +4 -3
  77. data/lib/risu/templates/executive_summary_detailed.rb +9 -8
  78. data/lib/risu/templates/exploitablity_summary.rb +82 -0
  79. data/lib/risu/templates/failed_audits.rb +98 -0
  80. data/lib/risu/templates/finding_statistics.rb +2 -1
  81. data/lib/risu/templates/findings_host.rb +20 -22
  82. data/lib/risu/templates/findings_summary.rb +11 -9
  83. data/lib/risu/templates/findings_summary_with_pluginid.rb +31 -85
  84. data/lib/risu/templates/graphs.rb +9 -10
  85. data/lib/risu/templates/host_findings_csv.rb +67 -0
  86. data/lib/risu/templates/host_summary.rb +2 -1
  87. data/lib/risu/templates/malicious_process_detection.rb +2 -1
  88. data/lib/risu/templates/missing_root_causes.rb +162 -0
  89. data/lib/risu/templates/ms_patch_summary.rb +3 -2
  90. data/lib/risu/templates/ms_update_summary.rb +5 -4
  91. data/lib/risu/templates/ms_wsus_findings.rb +5 -4
  92. data/lib/risu/templates/notable.rb +7 -11
  93. data/lib/risu/templates/notable_detailed.rb +7 -4
  94. data/lib/risu/templates/pci_compliance.rb +5 -4
  95. data/lib/risu/templates/stig_findings_summary.rb +5 -4
  96. data/lib/risu/templates/talking_points.rb +164 -0
  97. data/lib/risu/templates/technical_findings.rb +8 -4
  98. data/lib/risu/templates/template.rb +3 -2
  99. data/lib/risu/templates/top_25.rb +115 -0
  100. data/risu.gemspec +16 -15
  101. metadata +142 -77
@@ -0,0 +1,65 @@
1
+ # Copyright (c) 2010-2014 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 Parsers
29
+ module Nessus
30
+ module PostProcess
31
+ class OpenSSHRollups < Risu::Base::PostProcessBase
32
+
33
+ #
34
+ def initialize
35
+ @info =
36
+ {
37
+ :description => "OpenSSH Patch Rollup",
38
+ :plugin_id => -99995,
39
+ :plugin_name => "Update to the latest OpenSSH",
40
+ :item_name => "Update to the latest OpenSSH",
41
+ :plugin_ids => [
42
+ 11837,
43
+ 17702,
44
+ 44077,
45
+ 44078,
46
+ 44065,
47
+ 31737,
48
+ 44074,
49
+ 44076,
50
+ 44079,
51
+ 19592,
52
+ 44075,
53
+ 53841,
54
+ 44080,
55
+ 44077,
56
+ 44078,
57
+
58
+ ]
59
+ }
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,54 @@
1
+ # Copyright (c) 2010-2014 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 Parsers
29
+ module Nessus
30
+ module PostProcess
31
+ class OpenSSLRollups < Risu::Base::PostProcessBase
32
+
33
+ #
34
+ def initialize
35
+ @info =
36
+ {
37
+ :description => "OpenSSL Patch Rollup",
38
+ :plugin_id => -99984,
39
+ :plugin_name => "Update to the latest OpenSSL",
40
+ :item_name => "Update to the latest OpenSSL",
41
+ :plugin_ids => [
42
+ 11267,
43
+ 12110,
44
+ 74363,
45
+ 77086,
46
+ 74326
47
+ ]
48
+ }
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,84 @@
1
+ # Copyright (c) 2010-2014 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 Parsers
29
+ module Nessus
30
+ module PostProcess
31
+ class OracleDatabase < Risu::Base::PostProcessBase
32
+
33
+ #
34
+ def initialize
35
+ @info =
36
+ {
37
+ :description => "Oracle Database Patch Rollup",
38
+ :plugin_id => -99993,
39
+ :plugin_name => "Update to the latest Oracle Database",
40
+ :item_name => "Update to the latest Oracle Database",
41
+ :plugin_ids => [
42
+ 45625,
43
+ 56051,
44
+ 56052,
45
+ 56053,
46
+ 56056,
47
+ 56066,
48
+ 50652,
49
+ 47718,
50
+ 45626,
51
+ 51573,
52
+ 53897,
53
+ 56054,
54
+ 56055,
55
+ 56057,
56
+ 56058,
57
+ 56060,
58
+ 56064,
59
+ 56065,
60
+ 56059,
61
+ 56061,
62
+ 56062,
63
+ 56063,
64
+ 56653,
65
+ 57589,
66
+ 55632,
67
+ 11227,
68
+ 10848,
69
+ 10851,
70
+ 11223,
71
+ 11224,
72
+ 11226,
73
+ 10852,
74
+ 55786
75
+
76
+
77
+ ]
78
+ }
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,62 @@
1
+ # Copyright (c) 2010-2014 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 Parsers
29
+ module Nessus
30
+ module PostProcess
31
+ class PHP < Risu::Base::PostProcessBase
32
+
33
+ #
34
+ def initialize
35
+ @info =
36
+ {
37
+ :description => "PHP Patch Rollup",
38
+ :plugin_id => -99988,
39
+ :plugin_name => "Update to the latest PHP",
40
+ :item_name => "Update to the latest PHP",
41
+ :plugin_ids => [
42
+ 76281,
43
+ 66843,
44
+ 67260,
45
+ 69401,
46
+ 72881,
47
+ 46803,
48
+ 66585,
49
+ 71427,
50
+ 71927,
51
+ 73338,
52
+ 73862,
53
+ 74291,
54
+ 76791,
55
+ ]
56
+ }
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,178 @@
1
+ # Copyright (c) 2010-2014 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 Parsers
29
+ module Nessus
30
+ module PostProcess
31
+ class PostProcess #< Risu::Base::PostProcessBase
32
+
33
+ #
34
+ def initialize
35
+ @name = ""
36
+ @plugin_id = -1
37
+ @plugin_ids = []
38
+ @plugin_name = ""
39
+ @item_name = ""
40
+ end
41
+
42
+ #NOTE:
43
+ #looks like its working
44
+ def newest_plugin
45
+ newest = DateTime.new(0001, 01, 01)
46
+ newest_plugin = nil
47
+
48
+ @plugin_ids.uniq.each do |id|
49
+ plugin = Plugin.find_by_id(id)
50
+
51
+ if plugin == nil || plugin.plugin_modification_date == nil
52
+ next
53
+ end
54
+
55
+ if plugin.plugin_modification_date >= newest
56
+ newest = plugin.plugin_modification_date if plugin.plugin_modification_date != nil
57
+ newest_plugin = plugin
58
+ end
59
+ end
60
+
61
+ return newest_plugin
62
+ end
63
+
64
+ # Creates a rollup plugin
65
+ #
66
+ def create_plugin
67
+ plugin = Plugin.find_by_id(@plugin_id)
68
+
69
+ newest_plugin = newest_plugin()
70
+
71
+ if newest_plugin == nil
72
+ return
73
+ end
74
+
75
+ if plugin == nil
76
+ plugin = Plugin.new
77
+ end
78
+
79
+ plugin.id = @plugin_id
80
+ plugin.plugin_name = @plugin_name
81
+ plugin.family_name = "Risu Rollup Plugins"
82
+ plugin.description = @description #newest_plugin.description || ""
83
+ plugin.plugin_version = newest_plugin.plugin_version || ""
84
+ plugin.plugin_publication_date = newest_plugin.plugin_publication_date
85
+ plugin.plugin_modification_date = newest_plugin.plugin_modification_date
86
+ plugin.vuln_publication_date = newest_plugin.vuln_publication_date
87
+ plugin.cvss_vector = newest_plugin.cvss_vector || ""
88
+ plugin.cvss_base_score = newest_plugin.cvss_base_score
89
+ plugin.cvss_temporal_score = newest_plugin.cvss_temporal_score
90
+ plugin.cvss_temporal_vector = newest_plugin.cvss_temporal_vector
91
+ plugin.risk_factor = newest_plugin.risk_factor
92
+ plugin.solution = newest_plugin.solution
93
+ plugin.synopsis = newest_plugin.synopsis
94
+ plugin.plugin_type = "Rollup"
95
+ plugin.rollup = true
96
+
97
+ plugin.save
98
+ end
99
+
100
+ #
101
+ def create_item(host_id, severity)
102
+ item = Item.new
103
+
104
+ item.host_id = host_id
105
+ item.plugin_id = @plugin_id
106
+ item.plugin_output = nil
107
+ item.port = 0
108
+ item.severity = severity
109
+ item.plugin_name = @item_name
110
+
111
+ item.save
112
+ end
113
+
114
+ #
115
+ def has_findings
116
+ @plugin_ids.each do |plugin_id|
117
+ if Item.where(:plugin_id => plugin_id)
118
+ return true
119
+ end
120
+ end
121
+
122
+ return false
123
+ end
124
+
125
+ def has_host_findings? (host_id)
126
+ @plugin_ids.each do |plugin_id|
127
+ if Item.where(:plugin_id => plugin_id).where(:host_id => host_id).count >= 1
128
+ return true
129
+ end
130
+ end
131
+
132
+ return false
133
+ end
134
+
135
+ #
136
+ def calculate_severity current_severity, severity
137
+ if severity >= current_severity
138
+ return severity
139
+ else
140
+ return current_severity
141
+ end
142
+ end
143
+
144
+ #
145
+ def run
146
+ if !has_findings()
147
+ return
148
+ end
149
+
150
+ #Create the dummy plugin
151
+ create_plugin()
152
+
153
+ Host.all.each do |host|
154
+ if !has_host_findings?(host.id)
155
+ next
156
+ end
157
+
158
+ finding_severity = 0
159
+
160
+ @plugin_ids.each do |plugin_id|
161
+ Item.where(:plugin_id => plugin_id).each do |item|
162
+ severity = item.severity
163
+ item.real_severity = severity
164
+ item.severity = -1
165
+ item.save
166
+
167
+ finding_severity = calculate_severity(finding_severity, severity)
168
+ end
169
+ end
170
+
171
+ create_item(host.id, finding_severity)
172
+ end
173
+ end
174
+ end
175
+ end
176
+ end
177
+ end
178
+ end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2010-2013 Arxopia LLC.
1
+ # Copyright (c) 2010-2014 Arxopia LLC.
2
2
  # All rights reserved.
3
3
  #
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -21,17 +21,22 @@
21
21
  # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
22
22
  # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23
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.
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
26
 
27
27
  module Risu
28
28
  module Parsers
29
29
  module Nessus
30
30
  module PostProcess
31
- class RiskScore
31
+ class RiskScore < Risu::Base::PostProcessBase
32
32
 
33
33
  #
34
34
  def initialize
35
+ @info =
36
+ {
37
+ :description => "RiskScore Calculator",
38
+ :plugin_id => 0
39
+ }
35
40
  end
36
41
 
37
42
  # Calculates the RiskScore for a Item which is == to the Plugin's
@@ -81,7 +86,7 @@ module Risu
81
86
  risk_score = risk_score + item.risk_score
82
87
  end
83
88
 
84
- #weighting goes here
89
+ #@todo weighting goes here
85
90
 
86
91
  host.risk_score = risk_score
87
92
  host.save