Class: Risu::Templates::RollupSummary
- Inherits:
-
Base::TemplateBase
- Object
- Base::TemplateBase
- Risu::Templates::RollupSummary
- Includes:
- TemplateHelper
- Defined in:
- lib/risu/templates/rollup_summary.rb
Instance Attribute Summary
Attributes inherited from Base::TemplateBase
Instance Method Summary collapse
-
#initialize ⇒ RollupSummary
constructor
A new instance of RollupSummary.
-
#print_risk_summary_with_plugin_id(risks, text, color) ⇒ Object
TODO doc.
-
#print_risk_title(text, color) ⇒ Object
TODO doc.
-
#render(output) ⇒ Object
TODO doc.
Methods included from TemplateHelper
#default_credential_plugins, #default_credentials_appendix_section, #default_credentials_section, #definition, #has_default_credentials?, #heading1, #heading2, #heading3, #heading4, #heading5, #heading6, #item_count_by_plugin_id, #item_count_by_plugin_name, #new_page, #report_author, #report_classification, #report_subtitle, #report_title, #table, #text, #title
Methods included from ScanHelper
#authenticated_count, #scan_info_to_hash
Methods included from SharesTemplateHelper
#anon_ftp_count, #anon_ftp_section, #anon_smb_count, #anon_smb_query, #anon_smb_section, #shares_appendix_section, #shares_section, #shares_section_has_findings?
Methods included from GraphTemplateHelper
#other_os_graph_page, #risks_by_service_graph_page, #risks_by_severity_graph_page, #root_cause_graph_page, #windows_os_graph_page
Methods included from MalwareTemplateHelper
#conficker_appendix_section, #conficker_count, #conficker_section, #known_malicious_process_appendix_section, #known_malicious_process_count, #known_malicious_process_section, #malware_appendix_section, #malware_section
Methods included from HostTemplateHelper
#unsupported_os, #unsupported_os_appendix_section
Methods inherited from Base::TemplateBase
Constructor Details
#initialize ⇒ RollupSummary
Returns a new instance of RollupSummary.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/risu/templates/rollup_summary.rb', line 29 def initialize @template_info = { :name => "rollup_summary", :author => "hammackj", :version => "0.0.1", :renderer => "PDF", :description => "Generates a Findings Summary with Nessus Plugin ID" } end |
Instance Method Details
#print_risk_summary_with_plugin_id(risks, text, color) ⇒ Object
TODO doc
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/risu/templates/rollup_summary.rb', line 52 def print_risk_summary_with_plugin_id risks, text, color print_risk_title(text, color) if risks.length != 0 risks.each do |item| name = Plugin.find_by_id(item.plugin_id).plugin_name #count = Item.where(:plugin_id => item.plugin_id).count text "#{item.plugin_id}, ##{name}" end end |
#print_risk_title(text, color) ⇒ Object
TODO doc
42 43 44 45 46 47 48 |
# File 'lib/risu/templates/rollup_summary.rb', line 42 def print_risk_title text, color @output.font_size(20) do @output.fill_color color.gsub('#', '') @output.text text, :style => :bold @output.fill_color "000000" end end |
#render(output) ⇒ Object
TODO doc
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/risu/templates/rollup_summary.rb', line 65 def render output text Report.classification.upcase, :align => :center text "\n" report_title Report.title report_subtitle "Findings Summary Report" "This report was prepared by\n#{Report.}" text "\n\n\n" print_risk_summary_with_plugin_id(Item.critical_risks_unique_sorted, "Critical Findings", Risu::GRAPH_COLORS[0]) print_risk_summary_with_plugin_id(Item.high_risks_unique_sorted, "High Findings", Risu::GRAPH_COLORS[1]) print_risk_summary_with_plugin_id(Item.medium_risks_unique_sorted, "Medium Findings", Risu::GRAPH_COLORS[2]) print_risk_summary_with_plugin_id(Item.low_risks_unique_sorted, "Low Findings", Risu::GRAPH_COLORS[3]) print_risk_summary_with_plugin_id(Item.info_risks_unique_sorted, "Informational Findings", Risu::GRAPH_COLORS[4]) end |