risu 1.5.0 → 1.5.1
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.
- data/Gemfile.ci +2 -5
- data/KNOWNISSUES.markdown +12 -11
- data/LICENSE +11 -11
- data/NEWS.markdown +43 -8
- data/README.markdown +36 -32
- data/Rakefile +29 -9
- data/TODO.markdown +150 -77
- data/bin/risu +26 -0
- data/lib/risu.rb +27 -1
- data/lib/risu/base.rb +26 -0
- data/lib/risu/base/prawn_templater.rb +36 -8
- data/lib/risu/base/schema.rb +199 -163
- data/lib/risu/base/template_base.rb +34 -7
- data/lib/risu/base/template_manager.rb +37 -37
- data/lib/risu/base/templater.rb +36 -9
- data/lib/risu/cli.rb +26 -0
- data/lib/risu/cli/application.rb +72 -39
- data/lib/risu/cli/banner.rb +47 -21
- data/lib/risu/exceptions.rb +26 -0
- data/lib/risu/exceptions/invaliddocument.rb +30 -1
- data/lib/risu/models.rb +26 -0
- data/lib/risu/models/familyselection.rb +28 -2
- data/lib/risu/models/host.rb +59 -2
- data/lib/risu/models/individualpluginselection.rb +26 -1
- data/lib/risu/models/item.rb +132 -79
- data/lib/risu/models/patch.rb +26 -1
- data/lib/risu/models/plugin.rb +28 -2
- data/lib/risu/models/pluginspreference.rb +26 -2
- data/lib/risu/models/policy.rb +27 -2
- data/lib/risu/models/reference.rb +81 -20
- data/lib/risu/models/report.rb +33 -8
- data/lib/risu/models/serverpreference.rb +26 -1
- data/lib/risu/models/servicedescription.rb +26 -1
- data/lib/risu/models/version.rb +26 -1
- data/lib/risu/parsers.rb +29 -0
- data/lib/risu/parsers/nessus/nessus_document.rb +47 -14
- data/lib/risu/parsers/nessus/nessus_sax_listener.rb +45 -16
- data/lib/risu/parsers/nexpose/nexpose_document.rb +91 -0
- data/lib/risu/parsers/nexpose/simple_nexpose.rb +108 -0
- data/lib/risu/renderers.rb +26 -0
- data/lib/risu/renderers/nilrenderer.rb +30 -4
- data/lib/risu/templates/assets.rb +36 -10
- data/lib/risu/templates/cover_sheet.rb +34 -8
- data/lib/risu/templates/exec_summary.rb +45 -19
- data/lib/risu/templates/executive_summary.rb +37 -11
- data/lib/risu/templates/finding_statistics.rb +33 -7
- data/lib/risu/templates/findings_host.rb +44 -18
- data/lib/risu/templates/findings_summary.rb +43 -17
- data/lib/risu/templates/findings_summary_with_pluginid.rb +60 -18
- data/lib/risu/templates/graphs.rb +30 -0
- data/lib/risu/templates/host_summary.rb +34 -8
- data/lib/risu/templates/ms_patch_summary.rb +35 -9
- data/lib/risu/templates/ms_update_summary.rb +34 -8
- data/lib/risu/templates/ms_wsus_findings.rb +99 -0
- data/lib/risu/templates/notable.rb +39 -13
- data/lib/risu/templates/notable_detailed.rb +42 -16
- data/lib/risu/templates/pci_compliance.rb +40 -14
- data/lib/risu/templates/stig_findings_summary.rb +62 -36
- data/lib/risu/templates/technical_findings.rb +29 -3
- data/lib/risu/templates/template.rb +35 -9
- data/risu.gemspec +28 -7
- metadata +94 -101
@@ -1,19 +1,45 @@
|
|
1
|
+
# Copyright (c) 2010-2012 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
|
+
|
1
27
|
module Risu
|
2
28
|
module Templates
|
3
29
|
class MSPatchSummary < Risu::Base::TemplateBase
|
4
|
-
|
30
|
+
|
5
31
|
#
|
6
32
|
#
|
7
33
|
def initialize ()
|
8
|
-
@template_info =
|
9
|
-
{
|
10
|
-
:name => "ms_patch_summary",
|
11
|
-
:author => "hammackj",
|
12
|
-
:version => "0.0.1",
|
34
|
+
@template_info =
|
35
|
+
{
|
36
|
+
:name => "ms_patch_summary",
|
37
|
+
:author => "hammackj",
|
38
|
+
:version => "0.0.1",
|
13
39
|
:description => "Generates a Microsoft Patch Summary Report"
|
14
40
|
}
|
15
41
|
end
|
16
|
-
|
42
|
+
|
17
43
|
#
|
18
44
|
#
|
19
45
|
def render(output)
|
@@ -21,7 +47,7 @@ module Risu
|
|
21
47
|
output.text "\n"
|
22
48
|
|
23
49
|
output.font_size(22) { output.text Report.title, :align => :center }
|
24
|
-
output.font_size(18) {
|
50
|
+
output.font_size(18) {
|
25
51
|
output.text "Missing Microsoft Patch Summary", :align => :center
|
26
52
|
output.text "\n"
|
27
53
|
output.text "This report was prepared by\n#{Report.author}", :align => :center
|
@@ -37,7 +63,7 @@ module Risu
|
|
37
63
|
end
|
38
64
|
|
39
65
|
if host.name != nil
|
40
|
-
output.text "Host:", :style => :bold
|
66
|
+
output.text "Host:", :style => :bold
|
41
67
|
output.text host.name
|
42
68
|
end
|
43
69
|
|
@@ -1,19 +1,45 @@
|
|
1
|
+
# Copyright (c) 2010-2012 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
|
+
|
1
27
|
module Risu
|
2
28
|
module Templates
|
3
29
|
class MSUpdateSummary < Risu::Base::TemplateBase
|
4
|
-
|
30
|
+
|
5
31
|
#
|
6
32
|
#
|
7
33
|
def initialize ()
|
8
|
-
@template_info =
|
9
|
-
{
|
10
|
-
:name => "ms_update_summary",
|
11
|
-
:author => "hammackj",
|
12
|
-
:version => "0.0.1",
|
34
|
+
@template_info =
|
35
|
+
{
|
36
|
+
:name => "ms_update_summary",
|
37
|
+
:author => "hammackj",
|
38
|
+
:version => "0.0.1",
|
13
39
|
:description => "Generates a Microsoft Update Summary Report"
|
14
40
|
}
|
15
41
|
end
|
16
|
-
|
42
|
+
|
17
43
|
#
|
18
44
|
#
|
19
45
|
def render(output)
|
@@ -21,7 +47,7 @@ module Risu
|
|
21
47
|
output.text "\n"
|
22
48
|
|
23
49
|
output.font_size(22) { output.text Report.title, :align => :center }
|
24
|
-
output.font_size(18) {
|
50
|
+
output.font_size(18) {
|
25
51
|
output.text "Microsoft Update Summary", :align => :center
|
26
52
|
output.text "\n"
|
27
53
|
output.text "This report was prepared by\n#{Report.author}", :align => :center
|
@@ -0,0 +1,99 @@
|
|
1
|
+
# Copyright (c) 2010-2012 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 Templates
|
29
|
+
class MSWSUSFindingsTemplate < Risu::Base::TemplateBase
|
30
|
+
|
31
|
+
# Initializes the template loading metadata
|
32
|
+
#
|
33
|
+
def initialize ()
|
34
|
+
@template_info =
|
35
|
+
{
|
36
|
+
:name => "ms_wsus_findings",
|
37
|
+
:author => "hammackj",
|
38
|
+
:version => "0.0.1",
|
39
|
+
:description => "Generates a report based on the findings of the Patch Management: WSUS Report plugin"
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Called during the rendering process
|
44
|
+
#
|
45
|
+
def render(output)
|
46
|
+
output.text Report.classification.upcase, :align => :center
|
47
|
+
output.text "\n"
|
48
|
+
|
49
|
+
output.font_size(22) { output.text Report.title, :align => :center }
|
50
|
+
output.font_size(18) {
|
51
|
+
output.text "Patch Management: WSUS Report", :align => :center
|
52
|
+
output.text "\n"
|
53
|
+
output.text "This report was prepared by\n#{Report.author}", :align => :center
|
54
|
+
}
|
55
|
+
|
56
|
+
output.text "\n\n\n"
|
57
|
+
|
58
|
+
output.font_size 12
|
59
|
+
|
60
|
+
results = Item.where(:plugin_id => 58133)
|
61
|
+
|
62
|
+
results.each do |item|
|
63
|
+
if item.plugin_output == nil
|
64
|
+
next
|
65
|
+
end
|
66
|
+
|
67
|
+
if item.plugin_output =~ /This system is not managed by or has not yet reported to the WSUS server./
|
68
|
+
next
|
69
|
+
end
|
70
|
+
|
71
|
+
item.plugin_output.scan(/\+ WSUS Computer Information \r?\n?\r?\n?\r?\n? FQDN : (.*)\r?\n? IP Address : (.*)\r?\n? Last Sync Time : (.*)\r?\n? Last Reported Status : (.*)\r?\n? Last Sync Result : (.*)$/).each do
|
72
|
+
|fqdn, ip, last_sync_time, last_reported_status, last_sync_result|
|
73
|
+
|
74
|
+
output.text "Host: #{ip} (#{fqdn})"
|
75
|
+
output.text "Last Sync Time: #{last_sync_time}"
|
76
|
+
output.text "Last Reported Status: #{last_reported_status}"
|
77
|
+
output.text "Last Sync Result: #{last_sync_result}"
|
78
|
+
end
|
79
|
+
|
80
|
+
output.text "\n"
|
81
|
+
|
82
|
+
output.font_size 10
|
83
|
+
|
84
|
+
item.plugin_output.scan(/^\d* :(.*)\n Patch State : (.*)\n Microsoft KB : (.*)\n severity : (.*)\n Bulletin Date : (.*)\n Patch Link : (.*)\n Description : (.*)\n\r?\n?/).each do
|
85
|
+
|name, patch_state, kb, severity, date, link, description|
|
86
|
+
output.text "Name: #{name}"
|
87
|
+
output.text "State: #{patch_state}"
|
88
|
+
output.text "Severity: #{severity}"
|
89
|
+
output.text "Release date: #{date}"
|
90
|
+
output.text "Link: #{link}"
|
91
|
+
output.text "Description: #{description}"
|
92
|
+
output.text "\n"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
@@ -1,29 +1,55 @@
|
|
1
|
+
# Copyright (c) 2010-2012 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
|
+
|
1
27
|
module Risu
|
2
28
|
module Templates
|
3
29
|
class Top10 < Risu::Base::TemplateBase
|
4
|
-
|
30
|
+
|
5
31
|
#
|
6
32
|
#
|
7
33
|
def initialize ()
|
8
|
-
@template_info =
|
9
|
-
{
|
10
|
-
:name => "notable",
|
11
|
-
:author => "hammackj",
|
12
|
-
:version => "0.0.2",
|
34
|
+
@template_info =
|
35
|
+
{
|
36
|
+
:name => "notable",
|
37
|
+
:author => "hammackj",
|
38
|
+
:version => "0.0.2",
|
13
39
|
:description => "Notable Vulnerabilities"
|
14
40
|
}
|
15
41
|
end
|
16
|
-
|
42
|
+
|
17
43
|
#
|
18
44
|
#
|
19
45
|
def render(output)
|
20
46
|
output.text Report.classification.upcase, :align => :center
|
21
47
|
output.text "\n"
|
22
48
|
|
23
|
-
output.font_size(22) {
|
24
|
-
output.text Report.title, :align => :center
|
49
|
+
output.font_size(22) {
|
50
|
+
output.text Report.title, :align => :center
|
25
51
|
}
|
26
|
-
|
52
|
+
|
27
53
|
output.font_size(18) {
|
28
54
|
output.text "Notable Vulnerabilities", :align => :center
|
29
55
|
output.text "\n"
|
@@ -31,13 +57,13 @@ module Risu
|
|
31
57
|
}
|
32
58
|
|
33
59
|
output.text "\n\n\n"
|
34
|
-
|
60
|
+
|
35
61
|
output.text "Scan Date:", :style => :bold
|
36
62
|
output.text "#{Report.scan_date}"
|
37
63
|
output.text "\n"
|
38
|
-
|
64
|
+
|
39
65
|
Item.top_10_table(output)
|
40
|
-
|
66
|
+
|
41
67
|
end
|
42
68
|
end
|
43
69
|
end
|
@@ -1,19 +1,45 @@
|
|
1
|
+
# Copyright (c) 2010-2012 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
|
+
|
1
27
|
module Risu
|
2
28
|
module Templates
|
3
29
|
class NotableDetailed < Risu::Base::TemplateBase
|
4
|
-
|
30
|
+
|
5
31
|
#
|
6
32
|
#
|
7
33
|
def initialize ()
|
8
|
-
@template_info =
|
9
|
-
{
|
10
|
-
:name => "notable_detailed",
|
11
|
-
:author => "hammackj",
|
12
|
-
:version => "0.0.4",
|
34
|
+
@template_info =
|
35
|
+
{
|
36
|
+
:name => "notable_detailed",
|
37
|
+
:author => "hammackj",
|
38
|
+
:version => "0.0.4",
|
13
39
|
:description => "Notable Vulnerabilities Detailed"
|
14
40
|
}
|
15
41
|
end
|
16
|
-
|
42
|
+
|
17
43
|
#
|
18
44
|
#
|
19
45
|
def render(output)
|
@@ -21,9 +47,9 @@ module Risu
|
|
21
47
|
output.text "\n"
|
22
48
|
|
23
49
|
output.font_size(22) do
|
24
|
-
output.text Report.title, :align => :center
|
50
|
+
output.text Report.title, :align => :center
|
25
51
|
end
|
26
|
-
|
52
|
+
|
27
53
|
output.font_size(18) do
|
28
54
|
output.text "Notable Vulnerabilities", :align => :center
|
29
55
|
output.text "\n"
|
@@ -31,26 +57,26 @@ module Risu
|
|
31
57
|
end
|
32
58
|
|
33
59
|
output.text "\n\n\n"
|
34
|
-
|
60
|
+
|
35
61
|
output.text "Scan Date:", :style => :bold
|
36
62
|
output.text "#{Report.scan_date}"
|
37
63
|
output.text "\n"
|
38
|
-
|
64
|
+
|
39
65
|
output.font_size(10)
|
40
|
-
|
66
|
+
|
41
67
|
data = Item.top_10_sorted_raw
|
42
|
-
|
68
|
+
|
43
69
|
unique_risks = Array.new
|
44
70
|
unique_risks << Hash[:title => "Notable Findings", :color => "9B30FF", :values => Item.top_10_sorted_raw[0..9]]
|
45
71
|
counter = 1
|
46
|
-
|
72
|
+
|
47
73
|
unique_risks.each do |h|
|
48
74
|
if h[:values].length > 1
|
49
75
|
output.text "\n"
|
50
76
|
|
51
77
|
h[:values].each do |f|
|
52
78
|
plugin_id = f[0]
|
53
|
-
|
79
|
+
|
54
80
|
hosts = Item.where(:plugin_id => plugin_id)
|
55
81
|
item = Item.where(:plugin_id => plugin_id)
|
56
82
|
plugin = Plugin.find_by_id(plugin_id)
|
@@ -127,7 +153,7 @@ module Risu
|
|
127
153
|
output.start_new_page unless h[:values] == nil
|
128
154
|
end
|
129
155
|
|
130
|
-
output.number_pages "<page> of <total>", :at => [output.bounds.right - 75, 0], :width => 150, :page_filter => :all
|
156
|
+
output.number_pages "<page> of <total>", :at => [output.bounds.right - 75, 0], :width => 150, :page_filter => :all
|
131
157
|
end
|
132
158
|
end
|
133
159
|
end
|
@@ -1,19 +1,45 @@
|
|
1
|
+
# Copyright (c) 2010-2012 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
|
+
|
1
27
|
module Risu
|
2
28
|
module Templates
|
3
29
|
class PCICompliance < Risu::Base::TemplateBase
|
4
|
-
|
30
|
+
|
5
31
|
#
|
6
32
|
#
|
7
33
|
def initialize ()
|
8
|
-
@template_info =
|
9
|
-
{
|
10
|
-
:name => "pci_compliance",
|
11
|
-
:author => "hammackj",
|
12
|
-
:version => "0.0.
|
34
|
+
@template_info =
|
35
|
+
{
|
36
|
+
:name => "pci_compliance",
|
37
|
+
:author => "hammackj",
|
38
|
+
:version => "0.0.2",
|
13
39
|
:description => "Generates a PCI Compliance Overview Report"
|
14
40
|
}
|
15
41
|
end
|
16
|
-
|
42
|
+
|
17
43
|
#
|
18
44
|
#
|
19
45
|
def render(output)
|
@@ -21,8 +47,8 @@ module Risu
|
|
21
47
|
output.text "\n"
|
22
48
|
|
23
49
|
output.font_size(22) { output.text Report.title, :align => :center }
|
24
|
-
output.font_size(18) {
|
25
|
-
output.text "PCI /DSS
|
50
|
+
output.font_size(18) {
|
51
|
+
output.text "PCI /DSS Compliance Overview", :align => :center
|
26
52
|
output.text "\n"
|
27
53
|
output.text "This report was prepared by\n#{Report.author}", :align => :center
|
28
54
|
}
|
@@ -42,7 +68,7 @@ module Risu
|
|
42
68
|
output.text "\n\n"
|
43
69
|
|
44
70
|
if @hosts_passed.length > 0
|
45
|
-
output.font_size(20) {
|
71
|
+
output.font_size(20) {
|
46
72
|
output.fill_color "00FF00"
|
47
73
|
output.text "PCI / DSS Compliant Hosts", :style => :bold
|
48
74
|
output.fill_color "000000"
|
@@ -50,7 +76,7 @@ module Risu
|
|
50
76
|
|
51
77
|
output.text "\n"
|
52
78
|
|
53
|
-
@hosts_passed.each do |host|
|
79
|
+
@hosts_passed.each do |host|
|
54
80
|
output.text "#{host.ip} / #{host.fqdn} - passed\n"
|
55
81
|
end unless @hosts_passed == nil
|
56
82
|
|
@@ -58,15 +84,15 @@ module Risu
|
|
58
84
|
end
|
59
85
|
|
60
86
|
if @hosts_failed.length > 0
|
61
|
-
output.font_size(20) {
|
87
|
+
output.font_size(20) {
|
62
88
|
output.fill_color "FF0000"
|
63
|
-
output.text "Non PCI / DSS Compliant Hosts", :style => :bold
|
89
|
+
output.text "Non PCI / DSS Compliant Hosts", :style => :bold
|
64
90
|
output.fill_color "000000"
|
65
91
|
}
|
66
92
|
|
67
93
|
output.text "\n"
|
68
94
|
|
69
|
-
@hosts_failed.each do |host|
|
95
|
+
@hosts_failed.each do |host|
|
70
96
|
host_id = host.id
|
71
97
|
plugin = Plugin.find(:first, :conditions => { :id => 33929 })
|
72
98
|
item = Item.find(:first, :conditions => { :host_id => host_id, :plugin_id => plugin.id })
|