brakeman-lib 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGES +872 -0
- data/FEATURES +16 -0
- data/README.md +169 -0
- data/WARNING_TYPES +95 -0
- data/bin/brakeman +89 -0
- data/lib/brakeman.rb +495 -0
- data/lib/brakeman/app_tree.rb +161 -0
- data/lib/brakeman/brakeman.rake +17 -0
- data/lib/brakeman/call_index.rb +219 -0
- data/lib/brakeman/checks.rb +191 -0
- data/lib/brakeman/checks/base_check.rb +518 -0
- data/lib/brakeman/checks/check_basic_auth.rb +88 -0
- data/lib/brakeman/checks/check_basic_auth_timing_attack.rb +33 -0
- data/lib/brakeman/checks/check_content_tag.rb +160 -0
- data/lib/brakeman/checks/check_create_with.rb +75 -0
- data/lib/brakeman/checks/check_cross_site_scripting.rb +385 -0
- data/lib/brakeman/checks/check_default_routes.rb +86 -0
- data/lib/brakeman/checks/check_deserialize.rb +57 -0
- data/lib/brakeman/checks/check_detailed_exceptions.rb +55 -0
- data/lib/brakeman/checks/check_digest_dos.rb +38 -0
- data/lib/brakeman/checks/check_dynamic_finders.rb +49 -0
- data/lib/brakeman/checks/check_escape_function.rb +21 -0
- data/lib/brakeman/checks/check_evaluation.rb +36 -0
- data/lib/brakeman/checks/check_execute.rb +167 -0
- data/lib/brakeman/checks/check_file_access.rb +63 -0
- data/lib/brakeman/checks/check_file_disclosure.rb +35 -0
- data/lib/brakeman/checks/check_filter_skipping.rb +31 -0
- data/lib/brakeman/checks/check_forgery_setting.rb +74 -0
- data/lib/brakeman/checks/check_header_dos.rb +31 -0
- data/lib/brakeman/checks/check_i18n_xss.rb +48 -0
- data/lib/brakeman/checks/check_jruby_xml.rb +38 -0
- data/lib/brakeman/checks/check_json_encoding.rb +47 -0
- data/lib/brakeman/checks/check_json_parsing.rb +107 -0
- data/lib/brakeman/checks/check_link_to.rb +132 -0
- data/lib/brakeman/checks/check_link_to_href.rb +115 -0
- data/lib/brakeman/checks/check_mail_to.rb +49 -0
- data/lib/brakeman/checks/check_mass_assignment.rb +198 -0
- data/lib/brakeman/checks/check_mime_type_dos.rb +39 -0
- data/lib/brakeman/checks/check_model_attr_accessible.rb +55 -0
- data/lib/brakeman/checks/check_model_attributes.rb +119 -0
- data/lib/brakeman/checks/check_model_serialize.rb +67 -0
- data/lib/brakeman/checks/check_nested_attributes.rb +38 -0
- data/lib/brakeman/checks/check_nested_attributes_bypass.rb +58 -0
- data/lib/brakeman/checks/check_number_to_currency.rb +74 -0
- data/lib/brakeman/checks/check_quote_table_name.rb +40 -0
- data/lib/brakeman/checks/check_redirect.rb +215 -0
- data/lib/brakeman/checks/check_regex_dos.rb +69 -0
- data/lib/brakeman/checks/check_render.rb +92 -0
- data/lib/brakeman/checks/check_render_dos.rb +37 -0
- data/lib/brakeman/checks/check_render_inline.rb +54 -0
- data/lib/brakeman/checks/check_response_splitting.rb +21 -0
- data/lib/brakeman/checks/check_route_dos.rb +42 -0
- data/lib/brakeman/checks/check_safe_buffer_manipulation.rb +31 -0
- data/lib/brakeman/checks/check_sanitize_methods.rb +79 -0
- data/lib/brakeman/checks/check_secrets.rb +40 -0
- data/lib/brakeman/checks/check_select_tag.rb +60 -0
- data/lib/brakeman/checks/check_select_vulnerability.rb +60 -0
- data/lib/brakeman/checks/check_send.rb +48 -0
- data/lib/brakeman/checks/check_send_file.rb +19 -0
- data/lib/brakeman/checks/check_session_manipulation.rb +36 -0
- data/lib/brakeman/checks/check_session_settings.rb +170 -0
- data/lib/brakeman/checks/check_simple_format.rb +59 -0
- data/lib/brakeman/checks/check_single_quotes.rb +101 -0
- data/lib/brakeman/checks/check_skip_before_filter.rb +60 -0
- data/lib/brakeman/checks/check_sql.rb +660 -0
- data/lib/brakeman/checks/check_sql_cves.rb +101 -0
- data/lib/brakeman/checks/check_ssl_verify.rb +49 -0
- data/lib/brakeman/checks/check_strip_tags.rb +89 -0
- data/lib/brakeman/checks/check_symbol_dos.rb +64 -0
- data/lib/brakeman/checks/check_symbol_dos_cve.rb +30 -0
- data/lib/brakeman/checks/check_translate_bug.rb +45 -0
- data/lib/brakeman/checks/check_unsafe_reflection.rb +51 -0
- data/lib/brakeman/checks/check_unscoped_find.rb +41 -0
- data/lib/brakeman/checks/check_validation_regex.rb +116 -0
- data/lib/brakeman/checks/check_weak_hash.rb +151 -0
- data/lib/brakeman/checks/check_without_protection.rb +80 -0
- data/lib/brakeman/checks/check_xml_dos.rb +51 -0
- data/lib/brakeman/checks/check_yaml_parsing.rb +121 -0
- data/lib/brakeman/differ.rb +66 -0
- data/lib/brakeman/file_parser.rb +50 -0
- data/lib/brakeman/format/style.css +133 -0
- data/lib/brakeman/options.rb +301 -0
- data/lib/brakeman/parsers/rails2_erubis.rb +6 -0
- data/lib/brakeman/parsers/rails2_xss_plugin_erubis.rb +48 -0
- data/lib/brakeman/parsers/rails3_erubis.rb +74 -0
- data/lib/brakeman/parsers/template_parser.rb +89 -0
- data/lib/brakeman/processor.rb +102 -0
- data/lib/brakeman/processors/alias_processor.rb +1013 -0
- data/lib/brakeman/processors/base_processor.rb +277 -0
- data/lib/brakeman/processors/config_processor.rb +14 -0
- data/lib/brakeman/processors/controller_alias_processor.rb +273 -0
- data/lib/brakeman/processors/controller_processor.rb +326 -0
- data/lib/brakeman/processors/erb_template_processor.rb +80 -0
- data/lib/brakeman/processors/erubis_template_processor.rb +104 -0
- data/lib/brakeman/processors/gem_processor.rb +57 -0
- data/lib/brakeman/processors/haml_template_processor.rb +190 -0
- data/lib/brakeman/processors/lib/basic_processor.rb +37 -0
- data/lib/brakeman/processors/lib/find_all_calls.rb +223 -0
- data/lib/brakeman/processors/lib/find_call.rb +183 -0
- data/lib/brakeman/processors/lib/find_return_value.rb +134 -0
- data/lib/brakeman/processors/lib/processor_helper.rb +75 -0
- data/lib/brakeman/processors/lib/rails2_config_processor.rb +145 -0
- data/lib/brakeman/processors/lib/rails2_route_processor.rb +313 -0
- data/lib/brakeman/processors/lib/rails3_config_processor.rb +132 -0
- data/lib/brakeman/processors/lib/rails3_route_processor.rb +308 -0
- data/lib/brakeman/processors/lib/render_helper.rb +181 -0
- data/lib/brakeman/processors/lib/render_path.rb +107 -0
- data/lib/brakeman/processors/lib/route_helper.rb +68 -0
- data/lib/brakeman/processors/lib/safe_call_helper.rb +16 -0
- data/lib/brakeman/processors/library_processor.rb +119 -0
- data/lib/brakeman/processors/model_processor.rb +191 -0
- data/lib/brakeman/processors/output_processor.rb +171 -0
- data/lib/brakeman/processors/route_processor.rb +17 -0
- data/lib/brakeman/processors/slim_template_processor.rb +107 -0
- data/lib/brakeman/processors/template_alias_processor.rb +116 -0
- data/lib/brakeman/processors/template_processor.rb +74 -0
- data/lib/brakeman/report.rb +78 -0
- data/lib/brakeman/report/config/remediation.yml +71 -0
- data/lib/brakeman/report/ignore/config.rb +135 -0
- data/lib/brakeman/report/ignore/interactive.rb +311 -0
- data/lib/brakeman/report/renderer.rb +24 -0
- data/lib/brakeman/report/report_base.rb +286 -0
- data/lib/brakeman/report/report_codeclimate.rb +70 -0
- data/lib/brakeman/report/report_csv.rb +55 -0
- data/lib/brakeman/report/report_hash.rb +23 -0
- data/lib/brakeman/report/report_html.rb +216 -0
- data/lib/brakeman/report/report_json.rb +42 -0
- data/lib/brakeman/report/report_markdown.rb +156 -0
- data/lib/brakeman/report/report_table.rb +107 -0
- data/lib/brakeman/report/report_tabs.rb +17 -0
- data/lib/brakeman/report/templates/controller_overview.html.erb +22 -0
- data/lib/brakeman/report/templates/controller_warnings.html.erb +21 -0
- data/lib/brakeman/report/templates/error_overview.html.erb +29 -0
- data/lib/brakeman/report/templates/header.html.erb +58 -0
- data/lib/brakeman/report/templates/ignored_warnings.html.erb +25 -0
- data/lib/brakeman/report/templates/model_warnings.html.erb +21 -0
- data/lib/brakeman/report/templates/overview.html.erb +38 -0
- data/lib/brakeman/report/templates/security_warnings.html.erb +23 -0
- data/lib/brakeman/report/templates/template_overview.html.erb +21 -0
- data/lib/brakeman/report/templates/view_warnings.html.erb +34 -0
- data/lib/brakeman/report/templates/warning_overview.html.erb +17 -0
- data/lib/brakeman/rescanner.rb +483 -0
- data/lib/brakeman/scanner.rb +317 -0
- data/lib/brakeman/tracker.rb +347 -0
- data/lib/brakeman/tracker/collection.rb +93 -0
- data/lib/brakeman/tracker/config.rb +101 -0
- data/lib/brakeman/tracker/constants.rb +101 -0
- data/lib/brakeman/tracker/controller.rb +161 -0
- data/lib/brakeman/tracker/library.rb +17 -0
- data/lib/brakeman/tracker/model.rb +90 -0
- data/lib/brakeman/tracker/template.rb +33 -0
- data/lib/brakeman/util.rb +481 -0
- data/lib/brakeman/version.rb +3 -0
- data/lib/brakeman/warning.rb +255 -0
- data/lib/brakeman/warning_codes.rb +111 -0
- data/lib/ruby_parser/bm_sexp.rb +610 -0
- data/lib/ruby_parser/bm_sexp_processor.rb +116 -0
- metadata +362 -0
@@ -0,0 +1,107 @@
|
|
1
|
+
Brakeman.load_brakeman_dependency 'terminal-table'
|
2
|
+
|
3
|
+
class Brakeman::Report::Table < Brakeman::Report::Base
|
4
|
+
def generate_report
|
5
|
+
out = text_header <<
|
6
|
+
"\n\n+SUMMARY+\n\n" <<
|
7
|
+
truncate_table(generate_overview.to_s) << "\n\n" <<
|
8
|
+
truncate_table(generate_warning_overview.to_s) << "\n"
|
9
|
+
|
10
|
+
#Return output early if only summarizing
|
11
|
+
return out if tracker.options[:summary_only]
|
12
|
+
|
13
|
+
if tracker.options[:report_routes] or tracker.options[:debug]
|
14
|
+
out << "\n+CONTROLLERS+\n" <<
|
15
|
+
truncate_table(generate_controllers.to_s) << "\n"
|
16
|
+
end
|
17
|
+
|
18
|
+
if tracker.options[:debug]
|
19
|
+
out << "\n+TEMPLATES+\n\n" <<
|
20
|
+
truncate_table(generate_templates.to_s) << "\n"
|
21
|
+
end
|
22
|
+
|
23
|
+
res = generate_errors
|
24
|
+
out << "+Errors+\n" << truncate_table(res.to_s) if res
|
25
|
+
|
26
|
+
res = generate_warnings
|
27
|
+
out << "\n\n+SECURITY WARNINGS+\n\n" << truncate_table(res.to_s) if res
|
28
|
+
|
29
|
+
res = generate_controller_warnings
|
30
|
+
out << "\n\n\nController Warnings:\n\n" << truncate_table(res.to_s) if res
|
31
|
+
|
32
|
+
res = generate_model_warnings
|
33
|
+
out << "\n\n\nModel Warnings:\n\n" << truncate_table(res.to_s) if res
|
34
|
+
|
35
|
+
res = generate_template_warnings
|
36
|
+
out << "\n\nView Warnings:\n\n" << truncate_table(res.to_s) if res
|
37
|
+
|
38
|
+
out << "\n"
|
39
|
+
out
|
40
|
+
end
|
41
|
+
|
42
|
+
def generate_overview
|
43
|
+
num_warnings = all_warnings.length
|
44
|
+
|
45
|
+
Terminal::Table.new(:headings => ['Scanned/Reported', 'Total']) do |t|
|
46
|
+
t.add_row ['Controllers', tracker.controllers.length]
|
47
|
+
t.add_row ['Models', tracker.models.length - 1]
|
48
|
+
t.add_row ['Templates', number_of_templates(@tracker)]
|
49
|
+
t.add_row ['Errors', tracker.errors.length]
|
50
|
+
t.add_row ['Security Warnings', "#{num_warnings} (#{warnings_summary[:high_confidence]})"]
|
51
|
+
t.add_row ['Ignored Warnings', ignored_warnings.length] unless ignored_warnings.empty?
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
#Generate listings of templates and their output
|
56
|
+
def generate_templates
|
57
|
+
out_processor = Brakeman::OutputProcessor.new
|
58
|
+
template_rows = {}
|
59
|
+
tracker.templates.each do |name, template|
|
60
|
+
template.each_output do |out|
|
61
|
+
out = out_processor.format out
|
62
|
+
template_rows[name] ||= []
|
63
|
+
template_rows[name] << out.gsub("\n", ";").gsub(/\s+/, " ")
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
template_rows = template_rows.sort_by{|name, value| name.to_s}
|
68
|
+
|
69
|
+
output = ''
|
70
|
+
template_rows.each do |template|
|
71
|
+
output << template.first.to_s << "\n\n"
|
72
|
+
table = Terminal::Table.new(:headings => ['Output']) do |t|
|
73
|
+
# template[1] is an array of calls
|
74
|
+
template[1].each do |v|
|
75
|
+
t.add_row [v]
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
output << table.to_s << "\n\n"
|
80
|
+
end
|
81
|
+
|
82
|
+
output
|
83
|
+
end
|
84
|
+
|
85
|
+
def render_array template, headings, value_array, locals
|
86
|
+
return if value_array.empty?
|
87
|
+
|
88
|
+
Terminal::Table.new(:headings => headings) do |t|
|
89
|
+
value_array.each { |value_row| t.add_row value_row }
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
#Generate header for text output
|
94
|
+
def text_header
|
95
|
+
<<-HEADER
|
96
|
+
|
97
|
+
+BRAKEMAN REPORT+
|
98
|
+
|
99
|
+
Application path: #{tracker.app_path}
|
100
|
+
Rails version: #{rails_version}
|
101
|
+
Brakeman version: #{Brakeman::Version}
|
102
|
+
Started at #{tracker.start_time}
|
103
|
+
Duration: #{tracker.duration} seconds
|
104
|
+
Checks run: #{checks.checks_run.sort.join(", ")}
|
105
|
+
HEADER
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#Generated tab-separated output suitable for the Jenkins Brakeman Plugin:
|
2
|
+
#https://github.com/presidentbeef/brakeman-jenkins-plugin
|
3
|
+
class Brakeman::Report::Tabs < Brakeman::Report::Base
|
4
|
+
def generate_report
|
5
|
+
[[:generic_warnings, "General"], [:controller_warnings, "Controller"],
|
6
|
+
[:model_warnings, "Model"], [:template_warnings, "Template"]].map do |meth, category|
|
7
|
+
|
8
|
+
self.send(meth).map do |w|
|
9
|
+
line = w.line || 0
|
10
|
+
w.warning_type.gsub!(/[^\w\s]/, ' ')
|
11
|
+
"#{warning_file(w, :absolute)}\t#{line}\t#{w.warning_type}\t#{category}\t#{w.format_message}\t#{TEXT_CONFIDENCE[w.confidence]}"
|
12
|
+
end.join "\n"
|
13
|
+
|
14
|
+
end.join "\n"
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<h2>Controllers</h2>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<th>Name</th>
|
7
|
+
<th>Parent</th>
|
8
|
+
<th>Includes</th>
|
9
|
+
<th>Routes</th>
|
10
|
+
</tr>
|
11
|
+
</thead>
|
12
|
+
<tbody>
|
13
|
+
<% controller_rows.each do |row| %>
|
14
|
+
<tr>
|
15
|
+
<td><%= row['Name'] %></td>
|
16
|
+
<td><%= row['Parent'] %></td>
|
17
|
+
<td><%= row['Includes'] %></td>
|
18
|
+
<td><%= row['Routes'] %></td>
|
19
|
+
</tr>
|
20
|
+
<% end %>
|
21
|
+
</tbody>
|
22
|
+
</table>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<p>Controller Warnings</p>
|
2
|
+
<table>
|
3
|
+
<thead>
|
4
|
+
<tr>
|
5
|
+
<th>Confidence</th>
|
6
|
+
<th>Controller</th>
|
7
|
+
<th>Warning Type</th>
|
8
|
+
<th>Message</th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody>
|
12
|
+
<% warnings.each do |warning| %>
|
13
|
+
<tr>
|
14
|
+
<td><%= warning['Confidence']%></td>
|
15
|
+
<td><%= warning['Controller']%></td>
|
16
|
+
<td><%= warning['Warning Type']%></td>
|
17
|
+
<td><%= warning['Message']%></td>
|
18
|
+
</tr>
|
19
|
+
<% end %>
|
20
|
+
</tbody>
|
21
|
+
</table>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<div onClick="toggle('errors_table');"> <h2>Exceptions raised during the analysis (click to see them)</h2 ></div>
|
2
|
+
<div>
|
3
|
+
<div id='errors_table' style='display:none'>
|
4
|
+
<table>
|
5
|
+
<thead>
|
6
|
+
<tr>
|
7
|
+
<th>Error</th>
|
8
|
+
<th>Location</th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody>
|
12
|
+
<% tracker.errors.each do |warning| %>
|
13
|
+
<tr>
|
14
|
+
<td><%= CGI.escapeHTML warning[:error] %></td>
|
15
|
+
<td>
|
16
|
+
<% if tracker.options[:debug] %>
|
17
|
+
<% warning[:backtrace].each do |line| %>
|
18
|
+
<%= line %><br/>
|
19
|
+
<% end %>
|
20
|
+
<% else %>
|
21
|
+
<%= warning[:backtrace][0] %>
|
22
|
+
<% end %>
|
23
|
+
</td>
|
24
|
+
</tr>
|
25
|
+
<% end %>
|
26
|
+
</tbody>
|
27
|
+
</table>
|
28
|
+
</div>
|
29
|
+
</div>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<!DOCTYPE HTML SYSTEM>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5
|
+
<title>Brakeman Report</title>
|
6
|
+
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
|
7
|
+
<script type="text/javascript" src="https://cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js"></script>
|
8
|
+
<script type="text/javascript">
|
9
|
+
function toggle(context) {
|
10
|
+
var elem = document.getElementById(context);
|
11
|
+
|
12
|
+
if (elem.style.display != "block")
|
13
|
+
elem.style.display = "block";
|
14
|
+
else
|
15
|
+
elem.style.display = "none";
|
16
|
+
|
17
|
+
elem.parentNode.scrollIntoView();
|
18
|
+
}
|
19
|
+
|
20
|
+
$(document).ready(function() {
|
21
|
+
$('table').DataTable({
|
22
|
+
searching: false,
|
23
|
+
paging: false,
|
24
|
+
info: false
|
25
|
+
});
|
26
|
+
});
|
27
|
+
</script>
|
28
|
+
<style>
|
29
|
+
<%= css %>
|
30
|
+
</style>
|
31
|
+
</head>
|
32
|
+
<body>
|
33
|
+
|
34
|
+
<h1>Brakeman Report</h1>
|
35
|
+
<table>
|
36
|
+
<thead>
|
37
|
+
<tr>
|
38
|
+
<th>Application Path</th>
|
39
|
+
<th>Rails Version</th>
|
40
|
+
<th>Brakeman Version</th>
|
41
|
+
<th>Report Time</th>
|
42
|
+
<th>Checks Performed</th>
|
43
|
+
</tr>
|
44
|
+
</thead>
|
45
|
+
<tbody>
|
46
|
+
<tr>
|
47
|
+
<td><%= tracker.app_path %></td>
|
48
|
+
<td><%= rails_version %></td>
|
49
|
+
<td><%= brakeman_version %>
|
50
|
+
<td>
|
51
|
+
<%= tracker.start_time %><br><br>
|
52
|
+
<%= tracker.duration %> seconds
|
53
|
+
</td>
|
54
|
+
<td><%= checks.checks_run.sort.join(", ") %></td>
|
55
|
+
</tr>
|
56
|
+
</tbody>
|
57
|
+
</table>
|
58
|
+
<br>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div onClick="toggle('ignored_table');"> <h2><%= warnings.length %> Ignored Warnings (click to see them)</h2 ></div>
|
2
|
+
<div>
|
3
|
+
<table style="display:none" id="ignored_table">
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<th>Confidence</th>
|
7
|
+
<th>File</th>
|
8
|
+
<th>Warning Type</th>
|
9
|
+
<th>Message</th>
|
10
|
+
<th>Note</th>
|
11
|
+
</tr>
|
12
|
+
</thead>
|
13
|
+
<tbody>
|
14
|
+
<% warnings.each do |warning| %>
|
15
|
+
<tr>
|
16
|
+
<td><%= warning['Confidence']%></td>
|
17
|
+
<td><%= warning['File']%></td>
|
18
|
+
<td><%= warning['Warning Type']%></td>
|
19
|
+
<td><%= warning['Message']%></td>
|
20
|
+
<td><%= warning['Note']%></td>
|
21
|
+
</tr>
|
22
|
+
<% end %>
|
23
|
+
</tbody>
|
24
|
+
</table>
|
25
|
+
</div>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<p>Model Warnings</p>
|
2
|
+
<table>
|
3
|
+
<thead>
|
4
|
+
<tr>
|
5
|
+
<th>Confidence</th>
|
6
|
+
<th>Model</th>
|
7
|
+
<th>Warning Type</th>
|
8
|
+
<th>Message</th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody>
|
12
|
+
<% warnings.each do |warning| %>
|
13
|
+
<tr>
|
14
|
+
<td><%= warning['Confidence']%></td>
|
15
|
+
<td><%= warning['Model']%></td>
|
16
|
+
<td><%= warning['Warning Type']%></td>
|
17
|
+
<td><%= warning['Message']%></td>
|
18
|
+
</tr>
|
19
|
+
<% end %>
|
20
|
+
</tbody>
|
21
|
+
</table>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<h2 id='summary'>Summary</h2>
|
2
|
+
<table>
|
3
|
+
<thead>
|
4
|
+
<tr>
|
5
|
+
<th>Scanned/Reported</th>
|
6
|
+
<th>Total</th>
|
7
|
+
</tr>
|
8
|
+
</thead>
|
9
|
+
<tbody>
|
10
|
+
<tr>
|
11
|
+
<td>Controllers</td>
|
12
|
+
<td><%= tracker.controllers.length %></td>
|
13
|
+
</tr>
|
14
|
+
<tr>
|
15
|
+
<td>Models</td>
|
16
|
+
<td><%= tracker.models.length - 1 %></td>
|
17
|
+
</tr>
|
18
|
+
<tr>
|
19
|
+
<td>Templates</td>
|
20
|
+
<td><%= number_of_templates %></td>
|
21
|
+
</tr>
|
22
|
+
<tr>
|
23
|
+
<td>Errors</td>
|
24
|
+
<td><%= tracker.errors.length %></td>
|
25
|
+
</tr>
|
26
|
+
<tr>
|
27
|
+
<td>Security Warnings</td>
|
28
|
+
<td><%= warnings %> <span class='high-confidence'>(<%= warnings_summary[:high_confidence] %>)</span></td>
|
29
|
+
</tr>
|
30
|
+
<% if warnings_summary['Ignored Warnings'] %>
|
31
|
+
<tr>
|
32
|
+
<td>Ignored Warnings</td>
|
33
|
+
<td><%= ignored_warnings %></td>
|
34
|
+
</tr>
|
35
|
+
<% end %>
|
36
|
+
</tbody>
|
37
|
+
</table>
|
38
|
+
<br>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<h2>Security Warnings</h2>
|
2
|
+
<table>
|
3
|
+
<thead>
|
4
|
+
<tr>
|
5
|
+
<th>Confidence</th>
|
6
|
+
<th>Class</th>
|
7
|
+
<th>Method</th>
|
8
|
+
<th>Warning Type</th>
|
9
|
+
<th>Message</th>
|
10
|
+
</tr>
|
11
|
+
</thead>
|
12
|
+
<tbody>
|
13
|
+
<% warnings.each do |warning| %>
|
14
|
+
<tr>
|
15
|
+
<td><%= warning['Confidence']%></td>
|
16
|
+
<td><%= warning['Class']%></td>
|
17
|
+
<td><%= warning['Method']%></td>
|
18
|
+
<td><%= warning['Warning Type']%></td>
|
19
|
+
<td><%= warning['Message']%></td>
|
20
|
+
</tr>
|
21
|
+
<% end %>
|
22
|
+
</tbody>
|
23
|
+
</table>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<h2>Templates</h2>
|
2
|
+
|
3
|
+
<% template_rows.each do |template| %>
|
4
|
+
|
5
|
+
<p><%= template[0] %></p>
|
6
|
+
<table>
|
7
|
+
<thead>
|
8
|
+
<tr>
|
9
|
+
<th>Output</th>
|
10
|
+
</tr>
|
11
|
+
</thead>
|
12
|
+
<tbody>
|
13
|
+
<% template[1].each do |call| %>
|
14
|
+
<tr>
|
15
|
+
<td><%= call %></td>
|
16
|
+
</tr>
|
17
|
+
<% end %>
|
18
|
+
</tbody>
|
19
|
+
</table>
|
20
|
+
|
21
|
+
<% end %>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<p>View Warnings</p>
|
2
|
+
<table>
|
3
|
+
<thead>
|
4
|
+
<tr>
|
5
|
+
<th>Confidence</th>
|
6
|
+
<th>Template</th>
|
7
|
+
<th>Warning Type</th>
|
8
|
+
<th>Message</th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody>
|
12
|
+
<% warnings.each_with_index do |warning, i| %>
|
13
|
+
<tr>
|
14
|
+
<td><%= warning['Confidence']%></td>
|
15
|
+
<td>
|
16
|
+
<% if warning['Called From'] and warning['Called From'].length > 1 %>
|
17
|
+
<div class="template_name" onClick="toggle('callers<%= i %>')" >
|
18
|
+
<div>
|
19
|
+
<%= warning['Template'] %>
|
20
|
+
</div>
|
21
|
+
<div class="render_path" id="callers<%= i %>" >
|
22
|
+
<%= warning['Called From'].join(' → ') %> → <%= warning['Template Name'] %>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
<% else %>
|
26
|
+
<%= warning['Template']%>
|
27
|
+
<% end %>
|
28
|
+
</td>
|
29
|
+
<td><%= warning['Warning Type']%></td>
|
30
|
+
<td><%= warning['Message']%></td>
|
31
|
+
</tr>
|
32
|
+
<% end %>
|
33
|
+
</tbody>
|
34
|
+
</table>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<table>
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th>Warning Type</th>
|
5
|
+
<th>Total</th>
|
6
|
+
</tr>
|
7
|
+
</thead>
|
8
|
+
<tbody>
|
9
|
+
<% types.sort.each do |warning_type| %>
|
10
|
+
<tr>
|
11
|
+
<td><%= warning_type %></td>
|
12
|
+
<td><%= warnings_summary[warning_type] %></td>
|
13
|
+
</tr>
|
14
|
+
<% end %>
|
15
|
+
</tbody>
|
16
|
+
</table>
|
17
|
+
<br>
|