foreman_openscap 0.4.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/foreman_openscap/load_report.js +1 -1
- data/app/assets/javascripts/foreman_openscap/policy_edit.js +0 -2
- data/app/controllers/api/v2/compliance/arf_reports_controller.rb +7 -22
- data/app/controllers/api/v2/compliance/policies_controller.rb +5 -5
- data/app/controllers/api/v2/compliance/scap_contents_controller.rb +3 -3
- data/app/controllers/arf_reports_controller.rb +62 -0
- data/app/controllers/{scaptimony_dashboard_controller.rb → compliance_dashboard_controller.rb} +1 -1
- data/app/controllers/compliance_hosts_controller.rb +5 -0
- data/app/controllers/{scaptimony_policies_controller.rb → policies_controller.rb} +13 -13
- data/app/controllers/{scaptimony_policy_dashboard_controller.rb → policy_dashboard_controller.rb} +3 -3
- data/app/controllers/{scaptimony_scap_contents_controller.rb → scap_contents_controller.rb} +11 -11
- data/app/helpers/{scaptimony_report_dashboard_helper.rb → arf_report_dashboard_helper.rb} +3 -5
- data/app/helpers/arf_reports_helper.rb +21 -0
- data/app/helpers/compliance_hosts_helper.rb +25 -0
- data/app/helpers/concerns/foreman_openscap/hosts_helper_extensions.rb +2 -32
- data/app/helpers/{scaptimony_policies_helper.rb → policies_helper.rb} +6 -2
- data/app/helpers/{scaptimony_policy_dashboard_helper.rb → policy_dashboard_helper.rb} +8 -8
- data/app/lib/proxy_api/available_proxy.rb +26 -0
- data/app/lib/proxy_api/openscap.rb +40 -0
- data/app/mailers/foreman_openscap/policy_mailer.rb +42 -0
- data/app/models/concerns/foreman_openscap/compliance_status_scoped_search.rb +91 -0
- data/app/models/concerns/foreman_openscap/host_extensions.rb +73 -17
- data/app/models/concerns/foreman_openscap/hostgroup_extensions.rb +3 -5
- data/app/models/foreman_openscap/arf_report.rb +165 -0
- data/app/models/foreman_openscap/asset.rb +27 -0
- data/app/models/foreman_openscap/asset_policy.rb +6 -0
- data/app/models/foreman_openscap/compliance_status.rb +50 -0
- data/app/models/{concerns/foreman_openscap/policy_extensions.rb → foreman_openscap/policy.rb} +72 -45
- data/app/models/foreman_openscap/policy_arf_report.rb +8 -0
- data/app/models/foreman_openscap/policy_revision.rb +6 -0
- data/app/models/foreman_openscap/scap_content.rb +112 -0
- data/app/models/foreman_openscap/scap_content_profile.rb +6 -0
- data/app/overrides/hosts/overview/host_compliance_status.rb +4 -4
- data/app/services/foreman_openscap/arf_report_status_calculator.rb +45 -0
- data/app/services/{scaptimony → foreman_openscap}/host_report_dashboard/data.rb +12 -6
- data/app/services/{scaptimony → foreman_openscap}/policy_dashboard/data.rb +5 -5
- data/app/services/{scaptimony → foreman_openscap}/report_dashboard/data.rb +4 -4
- data/app/views/api/v2/compliance/policies/create.json.rabl +3 -0
- data/app/views/{scaptimony_arf_reports → arf_reports}/_list.html.erb +4 -4
- data/app/views/arf_reports/_metrics.html.erb +37 -0
- data/app/views/arf_reports/_output.html.erb +23 -0
- data/app/views/{scaptimony_arf_reports → arf_reports}/index.html.erb +0 -0
- data/app/views/arf_reports/show.html.erb +14 -0
- data/app/views/{scaptimony_arf_reports/show.html.erb → arf_reports/show_html.html.erb} +2 -3
- data/app/views/compliance_hosts/_compliance_status.erb +6 -0
- data/app/views/{scaptimony_hosts → compliance_hosts}/show.html.erb +9 -2
- data/app/views/dashboard/{_foreman_openscap_host_reports_widget.html.erb → _compliance_host_reports_widget.html.erb} +3 -3
- data/app/views/dashboard/{_foreman_openscap_reports_breakdown_widget.html.erb → _compliance_reports_breakdown_widget.html.erb} +1 -1
- data/app/views/foreman_openscap/policy_mailer/_dashboard.erb +21 -0
- data/app/views/foreman_openscap/policy_mailer/_hosts.erb +44 -0
- data/app/views/foreman_openscap/policy_mailer/_list.erb +10 -0
- data/app/views/foreman_openscap/policy_mailer/_policy.erb +7 -0
- data/app/views/foreman_openscap/policy_mailer/policy_summary.erb +19 -0
- data/app/views/{scaptimony_policies → policies}/_form.html.erb +2 -8
- data/app/views/{scaptimony_policies → policies}/_list.html.erb +5 -5
- data/app/views/policies/_scap_content_results.html.erb +3 -0
- data/app/views/policies/create.html.erb +2 -0
- data/app/views/{scaptimony_policies → policies}/disassociate_multiple_hosts.html.erb +2 -2
- data/app/views/{scaptimony_policies → policies}/edit.html.erb +0 -0
- data/app/views/{scaptimony_policies → policies}/index.html.erb +1 -1
- data/app/views/policies/new.html.erb +2 -0
- data/app/views/{scaptimony_policies → policies}/select_multiple_hosts.html.erb +2 -2
- data/app/views/{scaptimony_policies → policies}/show.html.erb +1 -1
- data/app/views/{scaptimony_policies → policies}/steps/_create_policy_form.html.erb +0 -0
- data/app/views/{scaptimony_policies → policies}/steps/_hostgroups_form.html.erb +0 -0
- data/app/views/{scaptimony_policies → policies}/steps/_locations_form.html.erb +0 -0
- data/app/views/{scaptimony_policies → policies}/steps/_organizations_form.html.erb +0 -0
- data/app/views/policies/steps/_scap_content_form.html.erb +9 -0
- data/app/views/{scaptimony_policies → policies}/steps/_schedule_form.html.erb +1 -1
- data/app/views/{scaptimony_policies → policies}/steps/_step_form.html.erb +3 -3
- data/app/views/{scaptimony_policies → policies}/welcome.html.erb +2 -2
- data/app/views/{scaptimony_policy_dashboard → policy_dashboard}/_policy_chart_widget.html.erb +0 -0
- data/app/views/{scaptimony_policy_dashboard → policy_dashboard}/_policy_reports.html.erb +2 -2
- data/app/views/{scaptimony_policy_dashboard → policy_dashboard}/_policy_status_widget.html.erb +3 -3
- data/app/views/{scaptimony_policy_dashboard → policy_dashboard}/index.html.erb +0 -0
- data/app/views/{scaptimony_scap_contents → scap_contents}/_form.html.erb +5 -6
- data/app/views/{scaptimony_scap_contents → scap_contents}/_list.html.erb +3 -3
- data/app/views/{scaptimony_scap_contents → scap_contents}/edit.html.erb +0 -0
- data/app/views/{scaptimony_scap_contents → scap_contents}/index.html.erb +1 -1
- data/app/views/{scaptimony_scap_contents → scap_contents}/new.html.erb +0 -0
- data/app/views/{scaptimony_scap_contents → scap_contents}/welcome.html.erb +2 -2
- data/config/routes.rb +15 -11
- data/db/migrate/20141013172051_create_scaptimony_policies.rb +9 -0
- data/db/migrate/20141014105333_create_scaptimony_assets.rb +10 -0
- data/db/migrate/20141015092642_create_scaptimony_arf_reports.rb +13 -0
- data/db/migrate/20141015115511_add_arf_report_unique_constraint.rb +6 -0
- data/db/migrate/20141104164201_create_scaptimony_scap_contents.rb +7 -0
- data/db/migrate/20141104171545_create_scaptimony_policy_revisions.rb +14 -0
- data/db/migrate/20141105174625_add_description_to_scaptimony_policy_revisions.rb +5 -0
- data/db/migrate/20141105174834_add_columns_to_scaptimony_policies.rb +12 -0
- data/db/migrate/20141107091756_add_columns_to_scaptimony_scap_contents.rb +8 -0
- data/db/migrate/20141111104519_add_constraint_to_scaptimony_scap_contents.rb +5 -0
- data/db/migrate/20141113221054_create_scaptimony_scap_content_profiles.rb +12 -0
- data/db/migrate/20141116170632_remove_xccdf_profile_from_scaptimony_policies.rb +5 -0
- data/db/migrate/20141116171305_add_profile_to_scaptimony_policies.rb +6 -0
- data/db/migrate/20141118142954_add_constraint_to_scaptimony_policies.rb +5 -0
- data/db/migrate/20141119164918_create_scaptimony_xccdf_results.rb +8 -0
- data/db/migrate/20141119175434_create_scaptimony_xccdf_rules.rb +8 -0
- data/db/migrate/20141119182606_create_scaptimony_xccdf_rule_results.rb +9 -0
- data/db/migrate/20141121120326_create_scaptimony_arf_report_breakdowns.rb +24 -0
- data/db/migrate/20141121164042_replace_arf_report_breakdown_view.rb +25 -0
- data/db/migrate/20141206211151_create_scaptimony_assets_policies.rb +9 -0
- data/db/migrate/20141214112917_add_scap_file_to_scap_content.rb +5 -0
- data/db/migrate/20141216154502_rename_scaptimony_asset_policies.rb +5 -0
- data/db/migrate/20150111085317_polymorph_asset.rb +8 -0
- data/db/migrate/20150112152944_create_scaptimony_arf_report_raws.rb +10 -0
- data/db/migrate/20150114210634_rename_scaptimony_arf_report_raw_raw.rb +5 -0
- data/db/migrate/20150115155947_add_scaptimony_scap_content_digest.rb +21 -0
- data/db/migrate/20150116083129_add_day_of_month_and_cron_line_to_scaptimony_policy.rb +6 -0
- data/db/migrate/20150821100137_migrate_from_scaptimony.rb +59 -0
- data/db/migrate/20150827123826_remove_scaptimony_permissions.rb +21 -0
- data/db/migrate/20150925124959_create_policy_arf_reports.rb +13 -0
- data/db/migrate/20150929124853_add_result_to_logs.rb +9 -0
- data/db/migrate/20150929152345_move_arf_reports_to_reports_table.rb +179 -0
- data/db/migrate/20151023131950_link_arf_report_directly_to_host.rb +17 -0
- data/db/seeds.d/openscap_policy_notification.rb +9 -0
- data/lib/foreman_openscap/bulk_upload.rb +3 -1
- data/lib/foreman_openscap/engine.rb +53 -42
- data/lib/foreman_openscap/helper.rb +8 -0
- data/lib/foreman_openscap/version.rb +1 -1
- data/lib/tasks/foreman_openscap_tasks.rake +14 -0
- data/test/factories/arf_report_factory.rb +9 -6
- data/test/factories/asset_factory.rb +1 -1
- data/test/factories/compliance_host_factory.rb +9 -0
- data/test/factories/compliance_log_factory.rb +11 -0
- data/test/factories/policy_arf_report_factory.rb +6 -0
- data/test/factories/policy_factory.rb +3 -2
- data/test/factories/scap_content_related.rb +2 -2
- data/test/functional/api/v2/compliance/arf_reports_controller_test.rb +4 -3
- data/test/functional/api/v2/compliance/policies_controller_test.rb +2 -2
- data/test/functional/api/v2/compliance/scap_contents_controller_test.rb +3 -1
- data/test/lib/foreman_openscap/bulk_upload_test.rb +1 -1
- data/test/test_plugin_helper.rb +30 -0
- data/test/unit/arf_report_status_calculator_test.rb +11 -0
- data/test/unit/arf_report_test.rb +148 -0
- data/test/unit/compliance_status_test.rb +71 -0
- data/test/unit/openscap_host_test.rb +38 -7
- data/test/unit/policy_mailer_test.rb +38 -0
- data/test/unit/scap_content_test.rb +32 -0
- metadata +130 -74
- data/app/controllers/scaptimony_arf_reports_controller.rb +0 -34
- data/app/controllers/scaptimony_hosts_controller.rb +0 -5
- data/app/models/concerns/foreman_openscap/arf_report_extensions.rb +0 -50
- data/app/models/concerns/foreman_openscap/asset_extensions.rb +0 -34
- data/app/models/concerns/foreman_openscap/scap_content_extensions.rb +0 -40
- data/app/overrides/hosts/index/host_arf_report.rb +0 -5
- data/app/views/scaptimony_arf_reports/_host_report.html.erb +0 -8
- data/app/views/scaptimony_hosts/_host_status.html.erb +0 -17
- data/app/views/scaptimony_policies/_scap_content_results.html.erb +0 -7
- data/app/views/scaptimony_policies/create.html.erb +0 -2
- data/app/views/scaptimony_policies/new.html.erb +0 -2
- data/app/views/scaptimony_policies/steps/_scap_content_form.html.erb +0 -17
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ArfReportStatusCalculatorTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
test 'it should save metrics as bits' do
|
6
|
+
calc = ForemanOpenscap::ArfReportStatusCalculator.new(:counters => { 'passed' => 25, 'othered' => 1024, 'failed' => 10 })
|
7
|
+
assert_equal 25, calc.status['passed']
|
8
|
+
assert_equal ForemanOpenscap::ArfReport::MAX, calc.status['othered']
|
9
|
+
assert_equal 10, calc.status['failed']
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,148 @@
|
|
1
|
+
require 'test_plugin_helper'
|
2
|
+
|
3
|
+
module ForemanOpenscap
|
4
|
+
class ArfReportTest < ActiveSupport::TestCase
|
5
|
+
setup do
|
6
|
+
disable_orchestration
|
7
|
+
User.current = users :admin
|
8
|
+
ForemanOpenscap::Policy.any_instance.stubs(:ensure_needed_puppetclasses).returns(true)
|
9
|
+
@policy = FactoryGirl.create(:policy)
|
10
|
+
@asset = FactoryGirl.create(:asset)
|
11
|
+
@host = FactoryGirl.create(:compliance_host)
|
12
|
+
@failed_source = FactoryGirl.create(:source)
|
13
|
+
@passed_source = FactoryGirl.create(:source)
|
14
|
+
@log_1 = FactoryGirl.create(:compliance_log, :result => "pass", :source => @passed_source)
|
15
|
+
@log_2 = FactoryGirl.create(:compliance_log, :result => "fail", :source => @failed_source)
|
16
|
+
@log_3 = FactoryGirl.create(:compliance_log, :result => "pass", :source => @passed_source)
|
17
|
+
@status = {:passed => 5, :failed => 1, :othered => 7}.with_indifferent_access
|
18
|
+
end
|
19
|
+
|
20
|
+
test 'equal? should return true when there is no change in report results' do
|
21
|
+
log_4 = FactoryGirl.create(:compliance_log, :result => "fail", :source => @failed_source)
|
22
|
+
report_1 = FactoryGirl.create(:arf_report, :policy => @policy, :host_id => @host.id, :logs => [@log_1, @log_2])
|
23
|
+
report_2 = FactoryGirl.create(:arf_report, :policy => @policy, :host_id => @host.id, :logs => [@log_3, log_4])
|
24
|
+
|
25
|
+
assert(report_1.equal? report_2)
|
26
|
+
end
|
27
|
+
|
28
|
+
test 'equal? should return false when there is change in report results' do
|
29
|
+
new_source = FactoryGirl.create(:source)
|
30
|
+
log_4 = FactoryGirl.build(:compliance_log, :result => "pass", :source => new_source)
|
31
|
+
report_1 = FactoryGirl.create(:arf_report, :policy => @policy, :host_id => @host.id, :logs => [@log_1, @log_2])
|
32
|
+
report_2 = FactoryGirl.create(:arf_report, :policy => @policy, :host_id => @host.id, :logs => [@log_3, log_4])
|
33
|
+
|
34
|
+
refute(report_1.equal? report_2)
|
35
|
+
end
|
36
|
+
|
37
|
+
test 'equal? should return false when reports have different sets of rules' do
|
38
|
+
report_1 = FactoryGirl.create(:arf_report, :policy => @policy, :host_id => @host.id, :logs => [@log_1, @log_2])
|
39
|
+
report_2 = FactoryGirl.create(:arf_report, :policy => @policy, :host_id => @host.id, :logs => [@log_3])
|
40
|
+
|
41
|
+
refute(report_1.equal? report_2)
|
42
|
+
end
|
43
|
+
|
44
|
+
test 'equal? should return false when reports have different hosts' do
|
45
|
+
host = FactoryGirl.create(:compliance_host)
|
46
|
+
log_4 = FactoryGirl.create(:compliance_log, :result => "fail", :source => @failed_source)
|
47
|
+
report_1 = FactoryGirl.create(:arf_report, :policy => @policy, :host_id => @host.id, :logs => [@log_1, @log_2])
|
48
|
+
report_2 = FactoryGirl.create(:arf_report, :policy => @policy, :host_id => host.id, :logs => [@log_3, log_4])
|
49
|
+
|
50
|
+
refute(report_1.equal? report_2)
|
51
|
+
end
|
52
|
+
|
53
|
+
test 'equal? should return false when reports have different policies' do
|
54
|
+
policy = FactoryGirl.create(:policy)
|
55
|
+
log_4 = FactoryGirl.create(:compliance_log, :result => "fail", :source => @failed_source)
|
56
|
+
report_1 = FactoryGirl.create(:arf_report, :policy => @policy, :host_id => @host.id, :logs => [@log_1, @log_2])
|
57
|
+
report_2 = FactoryGirl.create(:arf_report, :policy => policy, :host_id => @host.id, :logs => [@log_3, log_4])
|
58
|
+
|
59
|
+
refute(report_1.equal? report_2)
|
60
|
+
end
|
61
|
+
|
62
|
+
test 'should recognize report that failed' do
|
63
|
+
report = FactoryGirl.create(:arf_report, :host_id => @host.id, :status => @status)
|
64
|
+
assert report.failed?
|
65
|
+
end
|
66
|
+
|
67
|
+
test 'should recognize report that othered' do
|
68
|
+
@status[:failed] = 0
|
69
|
+
report = FactoryGirl.create(:arf_report, :host_id => @host.id, :status => @status)
|
70
|
+
assert report.othered?
|
71
|
+
end
|
72
|
+
|
73
|
+
test 'should recognize report that passed' do
|
74
|
+
@status[:failed], @status[:othered] = 0, 0
|
75
|
+
report = FactoryGirl.create(:arf_report, :host_id => @host.id, :status => @status)
|
76
|
+
assert report.passed?
|
77
|
+
end
|
78
|
+
|
79
|
+
test 'should return latest report for each of the hosts' do
|
80
|
+
reports = []
|
81
|
+
host = FactoryGirl.create(:compliance_host)
|
82
|
+
5.times do
|
83
|
+
reports << FactoryGirl.create(:arf_report, :host_id => @host.id, :status => @status)
|
84
|
+
FactoryGirl.create(:policy_arf_report, :arf_report_id => reports.last.id)
|
85
|
+
reports << FactoryGirl.create(:arf_report, :host_id => host.id, :status => @status)
|
86
|
+
FactoryGirl.create(:policy_arf_report, :arf_report_id => reports.last.id)
|
87
|
+
end
|
88
|
+
assert ForemanOpenscap::ArfReport.latest.include? reports[-2]
|
89
|
+
assert ForemanOpenscap::ArfReport.latest.include? reports[-1]
|
90
|
+
end
|
91
|
+
|
92
|
+
test 'should return latest report of policy for each of the hosts' do
|
93
|
+
reports = []
|
94
|
+
host = FactoryGirl.create(:compliance_host)
|
95
|
+
policy = FactoryGirl.create(:policy)
|
96
|
+
3.times do
|
97
|
+
reports << FactoryGirl.create(:arf_report, :host_id => @host.id, :status => @status)
|
98
|
+
FactoryGirl.create(:policy_arf_report, :arf_report_id => reports.last.id, :policy_id => @policy.id)
|
99
|
+
|
100
|
+
reports << FactoryGirl.create(:arf_report, :host_id => host.id, :status => @status)
|
101
|
+
FactoryGirl.create(:policy_arf_report, :arf_report_id => reports.last.id, :policy_id => @policy.id)
|
102
|
+
|
103
|
+
reports << FactoryGirl.create(:arf_report, :host_id => @host.id, :status => @status)
|
104
|
+
FactoryGirl.create(:policy_arf_report, :arf_report_id => reports.last.id, :policy_id => policy.id)
|
105
|
+
|
106
|
+
reports << FactoryGirl.create(:arf_report, :host_id => host.id, :status => @status)
|
107
|
+
FactoryGirl.create(:policy_arf_report, :arf_report_id => reports.last.id, :policy_id => policy.id)
|
108
|
+
end
|
109
|
+
|
110
|
+
assert ForemanOpenscap::ArfReport.latest_of_policy(policy).include? reports[-1]
|
111
|
+
assert ForemanOpenscap::ArfReport.latest_of_policy(policy).include? reports[-2]
|
112
|
+
assert ForemanOpenscap::ArfReport.latest_of_policy(@policy).include? reports[-3]
|
113
|
+
assert ForemanOpenscap::ArfReport.latest_of_policy(@policy).include? reports[-4]
|
114
|
+
assert_equal 2, ForemanOpenscap::ArfReport.latest_of_policy(@policy).count
|
115
|
+
assert_equal 2, ForemanOpenscap::ArfReport.latest_of_policy(policy).count
|
116
|
+
end
|
117
|
+
|
118
|
+
context 'retrieving reports by status' do
|
119
|
+
setup do
|
120
|
+
@passed_status = {:passed => 5, :failed => 0, :othered => 0}.with_indifferent_access
|
121
|
+
@othered_status = {:passed => 5, :failed => 0, :othered => 3}.with_indifferent_access
|
122
|
+
@failed_reports = []
|
123
|
+
@othered_reports = []
|
124
|
+
@passed_reports = []
|
125
|
+
3.times do
|
126
|
+
@failed_reports << FactoryGirl.create(:arf_report, :host_id => @host.id, :status => @status)
|
127
|
+
@passed_reports << FactoryGirl.create(:arf_report, :host_id => @host.id, :status => @passed_status)
|
128
|
+
@othered_reports << FactoryGirl.create(:arf_report, :host_id => @host.id, :status => @othered_status)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
test 'should return failed reports' do
|
133
|
+
assert_equal 3, ForemanOpenscap::ArfReport.failed.count
|
134
|
+
@failed_reports.each { |failure| assert ForemanOpenscap::ArfReport.failed.include?(failure) }
|
135
|
+
end
|
136
|
+
|
137
|
+
test 'should return othered reports' do
|
138
|
+
assert_equal 3, ForemanOpenscap::ArfReport.othered.count
|
139
|
+
@othered_reports.each { |other| assert ForemanOpenscap::ArfReport.othered.include?(other) }
|
140
|
+
end
|
141
|
+
|
142
|
+
test 'should return passed reports' do
|
143
|
+
assert_equal 3, ForemanOpenscap::ArfReport.passed.count
|
144
|
+
@passed_reports.each { |pass| assert ForemanOpenscap::ArfReport.passed.include?(pass) }
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'test_plugin_helper'
|
2
|
+
|
3
|
+
class ComplianceStatusTest < ActiveSupport::TestCase
|
4
|
+
def setup
|
5
|
+
disable_orchestration
|
6
|
+
User.current = users :admin
|
7
|
+
ForemanOpenscap::Policy.any_instance.stubs(:ensure_needed_puppetclasses).returns(true)
|
8
|
+
@policy_a = FactoryGirl.create(:policy)
|
9
|
+
@policy_b = FactoryGirl.create(:policy)
|
10
|
+
@failed_report = FactoryGirl.create(:arf_report)
|
11
|
+
@failed_report.stubs(:failed?).returns(true)
|
12
|
+
@passed_report = FactoryGirl.create(:arf_report)
|
13
|
+
@passed_report.stubs(:failed?).returns(false)
|
14
|
+
@passed_report.stubs(:othered?).returns(false)
|
15
|
+
@othered_report = FactoryGirl.create(:arf_report)
|
16
|
+
@othered_report.stubs(:failed?).returns(false)
|
17
|
+
@othered_report.stubs(:othered?).returns(true)
|
18
|
+
end
|
19
|
+
|
20
|
+
test 'status should be incompliant' do
|
21
|
+
status = ForemanOpenscap::ComplianceStatus.new
|
22
|
+
host = FactoryGirl.create(:compliance_host, :policies => [@policy_a])
|
23
|
+
status.host = host
|
24
|
+
host.stubs(:last_report_for_policy).returns(@failed_report)
|
25
|
+
s = status.to_status
|
26
|
+
assert_equal 2, status.to_status
|
27
|
+
end
|
28
|
+
|
29
|
+
test 'status should be inconclusive' do
|
30
|
+
status = ForemanOpenscap::ComplianceStatus.new
|
31
|
+
host = FactoryGirl.create(:compliance_host, :policies => [@policy_a])
|
32
|
+
host.stubs(:last_report_for_policy).returns(@othered_report)
|
33
|
+
status.host = host
|
34
|
+
assert_equal 1, status.to_status
|
35
|
+
end
|
36
|
+
|
37
|
+
test 'status should be compliant' do
|
38
|
+
status = ForemanOpenscap::ComplianceStatus.new
|
39
|
+
host = FactoryGirl.create(:compliance_host, :policies => [@policy_a])
|
40
|
+
host.stubs(:last_report_for_policy).returns(@passed_report)
|
41
|
+
status.host = host
|
42
|
+
assert_equal 0, status.to_status
|
43
|
+
end
|
44
|
+
|
45
|
+
test 'status should be incompliant for multiple policies' do
|
46
|
+
status = ForemanOpenscap::ComplianceStatus.new
|
47
|
+
host = FactoryGirl.create(:compliance_host, :policies => [@policy_a, @policy_b])
|
48
|
+
status.host = host
|
49
|
+
host.stubs(:last_report_for_policy).returns(@failed_report, @passed_report)
|
50
|
+
assert_equal 2, status.to_status
|
51
|
+
end
|
52
|
+
|
53
|
+
test 'status should be inconclusive for multiple policies' do
|
54
|
+
status = ForemanOpenscap::ComplianceStatus.new
|
55
|
+
host = FactoryGirl.create(:compliance_host, :policies => [@policy_a, @policy_b])
|
56
|
+
host.stubs(:last_report_for_policy).returns(@othered_report, @passed_report)
|
57
|
+
status.host = host
|
58
|
+
assert_equal 1, status.to_status
|
59
|
+
end
|
60
|
+
|
61
|
+
test 'status should be compliant for multiple policies' do
|
62
|
+
status = ForemanOpenscap::ComplianceStatus.new
|
63
|
+
host = FactoryGirl.create(:compliance_host, :policies => [@policy_a, @policy_b])
|
64
|
+
passed_report = FactoryGirl.create(:arf_report)
|
65
|
+
passed_report.stubs(:othered?).returns(false)
|
66
|
+
passed_report.stubs(:failed?).returns(false)
|
67
|
+
host.stubs(:last_report_for_policy).returns(passed_report, @passed_report)
|
68
|
+
status.host = host
|
69
|
+
assert_equal 0, status.to_status
|
70
|
+
end
|
71
|
+
end
|
@@ -4,24 +4,55 @@ class OpenscapHostTest < ActiveSupport::TestCase
|
|
4
4
|
setup do
|
5
5
|
disable_orchestration
|
6
6
|
User.current = users :admin
|
7
|
-
|
7
|
+
ForemanOpenscap::Policy.any_instance.stubs(:ensure_needed_puppetclasses).returns(true)
|
8
|
+
@policy = FactoryGirl.create(:policy)
|
8
9
|
end
|
9
10
|
|
10
11
|
test 'Host has policy' do
|
11
12
|
host = FactoryGirl.create(:host)
|
12
13
|
assert_empty(host.policies)
|
13
|
-
policy = FactoryGirl.create(:policy)
|
14
14
|
|
15
|
-
assert(policy.assign_hosts([host]), 'Host policies should be assigned')
|
16
|
-
assert_includes(host.policies, policy)
|
15
|
+
assert(@policy.assign_hosts([host]), 'Host policies should be assigned')
|
16
|
+
assert_includes(host.policies, @policy)
|
17
17
|
end
|
18
18
|
|
19
19
|
test 'Host has policies via its hostgroup' do
|
20
20
|
host = FactoryGirl.create(:host, :with_hostgroup)
|
21
21
|
hostgroup = host.hostgroup
|
22
|
-
policy =
|
23
|
-
assert(policy.hostgroup_ids = ["#{hostgroup.id}"])
|
22
|
+
assert(@policy.hostgroup_ids = ["#{hostgroup.id}"])
|
24
23
|
refute_empty(host.combined_policies)
|
25
|
-
assert_includes(host.combined_policies, policy)
|
24
|
+
assert_includes(host.combined_policies, @policy)
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'testing scap_status_changed?' do
|
28
|
+
setup do
|
29
|
+
@host = FactoryGirl.create(:compliance_host)
|
30
|
+
@report_1 = FactoryGirl.create(:arf_report, :policy => @policy, :host_id => @host.id)
|
31
|
+
@report_2 = FactoryGirl.create(:arf_report, :policy => @policy, :host_id => @host.id)
|
32
|
+
@policy_report_1 = FactoryGirl.create(:policy_arf_report, :policy_id => @policy.id, :arf_report_id => @report_1.id)
|
33
|
+
@policy_report_2 = FactoryGirl.create(:policy_arf_report, :policy_id => @policy.id, :arf_report_id => @report_2.id)
|
34
|
+
end
|
35
|
+
|
36
|
+
test "reports for policy should return expected reports" do
|
37
|
+
reports = @host.reports_for_policy(@policy)
|
38
|
+
assert_equal 2, reports.count
|
39
|
+
assert reports.include?(@report_1)
|
40
|
+
assert reports.include?(@report_2)
|
41
|
+
end
|
42
|
+
|
43
|
+
test 'scap_status_changed should detect status change' do
|
44
|
+
ForemanOpenscap::ArfReport.any_instance.stubs(:equal?).returns(false)
|
45
|
+
assert @host.scap_status_changed?(@policy)
|
46
|
+
end
|
47
|
+
|
48
|
+
test 'scap_status_changed should not detect status change when there is none' do
|
49
|
+
ForemanOpenscap::ArfReport.any_instance.stubs(:equal?).returns(true)
|
50
|
+
refute @host.scap_status_changed?(@policy)
|
51
|
+
end
|
52
|
+
|
53
|
+
test 'scap_status_changed should not detect status change when there are reports < 2' do
|
54
|
+
@report_2.destroy
|
55
|
+
refute @host.scap_status_changed?(@policy)
|
56
|
+
end
|
26
57
|
end
|
27
58
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'test_plugin_helper'
|
2
|
+
|
3
|
+
class PolicyMailerTest < ActiveSupport::TestCase
|
4
|
+
setup do
|
5
|
+
@user = User.current = users :admin
|
6
|
+
|
7
|
+
FactoryGirl.create(:mail_notification,
|
8
|
+
:name => :openscap_policy_summary,
|
9
|
+
:description => N_('A summary of reports for OpenScap policies'),
|
10
|
+
:mailer => 'ForemanOpenscap::PolicyMailer',
|
11
|
+
:method => 'policy_summary',
|
12
|
+
:subscription_type => 'report',
|
13
|
+
)
|
14
|
+
|
15
|
+
@user.mail_notifications << MailNotification[:openscap_policy_summary]
|
16
|
+
|
17
|
+
ActionMailer::Base.deliveries = []
|
18
|
+
@user.user_mail_notifications.first.deliver
|
19
|
+
@email = ActionMailer::Base.deliveries.first
|
20
|
+
end
|
21
|
+
|
22
|
+
test 'policy mailer should deliver summary' do
|
23
|
+
assert @email.to.include?("admin@someware.com")
|
24
|
+
end
|
25
|
+
|
26
|
+
test 'policy mailer should contain body' do
|
27
|
+
refute @email.body.nil?
|
28
|
+
end
|
29
|
+
|
30
|
+
test 'policy mailer should have a correct subject' do
|
31
|
+
refute @email.subject.empty?
|
32
|
+
assert @email.subject.include? Setting[:email_subject_prefix].first
|
33
|
+
end
|
34
|
+
|
35
|
+
test 'policy mailer sends Foreman URL in body' do
|
36
|
+
assert @email.body.include? Setting[:foreman_url]
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'test_plugin_helper'
|
2
|
+
|
3
|
+
class ScapContentTest < ActiveSupport::TestCase
|
4
|
+
setup do
|
5
|
+
@scap_file = File.new('../foreman_openscap/test/files/scap_contents/ssg-fedora-ds.xml', 'rb').read
|
6
|
+
end
|
7
|
+
context 'validate scap contents' do
|
8
|
+
test 'create scap content' do
|
9
|
+
scap_content = ForemanOpenscap::ScapContent.new(:title => 'Fedora', :scap_file => @scap_file)
|
10
|
+
assert(scap_content.valid?)
|
11
|
+
end
|
12
|
+
|
13
|
+
test 'scap content should fail if no openscap proxy' do
|
14
|
+
SmartProxy.stubs(:with_features).returns([])
|
15
|
+
ProxyAPI::AvailableProxy.any_instance.stubs(:available?).returns(false)
|
16
|
+
scap_content = ForemanOpenscap::ScapContent.new(:title => 'Fedora', :scap_file => @scap_file)
|
17
|
+
refute(scap_content.save)
|
18
|
+
assert_includes(scap_content.errors.messages[:base], 'No Proxy with OpenScap features')
|
19
|
+
end
|
20
|
+
|
21
|
+
test 'proxy_url should return the first available proxy it finds' do
|
22
|
+
available_proxy = SmartProxy.with_features('Openscap').first
|
23
|
+
unavailable_proxy = FactoryGirl.create(:smart_proxy, :url => 'http://proxy.example.com:8443', :features => [FactoryGirl.create(:feature, :name => 'Openscap')])
|
24
|
+
proxy1_url = ProxyAPI::AvailableProxy.new(:url => available_proxy.url)
|
25
|
+
proxy2_url = ProxyAPI::AvailableProxy.new(:url => unavailable_proxy.url)
|
26
|
+
proxy1_url.stubs(:available?).returns(available_proxy.url)
|
27
|
+
proxy2_url.stubs(:available?).returns(false)
|
28
|
+
scap_content = ForemanOpenscap::ScapContent.new(:title => 'Fedora', :scap_file => @scap_file)
|
29
|
+
assert_equal(available_proxy.url, scap_content.proxy_url)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
metadata
CHANGED
@@ -1,43 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_openscap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Šimon Lukašík
|
8
|
+
- Shlomi Zadok
|
9
|
+
- Marek Hulan
|
10
|
+
- Ondrej Prazak
|
8
11
|
autorequire:
|
9
12
|
bindir: bin
|
10
13
|
cert_chain: []
|
11
|
-
date: 2015-
|
14
|
+
date: 2015-11-01 00:00:00.000000000 Z
|
12
15
|
dependencies:
|
13
16
|
- !ruby/object:Gem::Dependency
|
14
17
|
name: deface
|
15
18
|
requirement: !ruby/object:Gem::Requirement
|
16
19
|
requirements:
|
17
|
-
- -
|
20
|
+
- - <
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: '2.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - <
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '2.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: scaptimony
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.3.2
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.3.2
|
41
30
|
description: Foreman plug-in for managing security compliance reports
|
42
31
|
email:
|
43
32
|
- slukasik@redhat.com
|
@@ -55,33 +44,44 @@ files:
|
|
55
44
|
- app/controllers/api/v2/compliance/arf_reports_controller.rb
|
56
45
|
- app/controllers/api/v2/compliance/policies_controller.rb
|
57
46
|
- app/controllers/api/v2/compliance/scap_contents_controller.rb
|
58
|
-
- app/controllers/
|
59
|
-
- app/controllers/
|
60
|
-
- app/controllers/
|
61
|
-
- app/controllers/
|
62
|
-
- app/controllers/
|
63
|
-
- app/controllers/
|
47
|
+
- app/controllers/arf_reports_controller.rb
|
48
|
+
- app/controllers/compliance_dashboard_controller.rb
|
49
|
+
- app/controllers/compliance_hosts_controller.rb
|
50
|
+
- app/controllers/policies_controller.rb
|
51
|
+
- app/controllers/policy_dashboard_controller.rb
|
52
|
+
- app/controllers/scap_contents_controller.rb
|
53
|
+
- app/helpers/arf_report_dashboard_helper.rb
|
64
54
|
- app/helpers/arf_reports_helper.rb
|
55
|
+
- app/helpers/compliance_hosts_helper.rb
|
65
56
|
- app/helpers/concerns/foreman_openscap/hosts_helper_extensions.rb
|
66
|
-
- app/helpers/
|
67
|
-
- app/helpers/
|
68
|
-
- app/
|
69
|
-
- app/
|
70
|
-
- app/
|
57
|
+
- app/helpers/policies_helper.rb
|
58
|
+
- app/helpers/policy_dashboard_helper.rb
|
59
|
+
- app/lib/proxy_api/available_proxy.rb
|
60
|
+
- app/lib/proxy_api/openscap.rb
|
61
|
+
- app/mailers/foreman_openscap/policy_mailer.rb
|
62
|
+
- app/models/concerns/foreman_openscap/compliance_status_scoped_search.rb
|
71
63
|
- app/models/concerns/foreman_openscap/host_extensions.rb
|
72
64
|
- app/models/concerns/foreman_openscap/hostgroup_extensions.rb
|
73
|
-
- app/models/
|
74
|
-
- app/models/
|
75
|
-
- app/
|
65
|
+
- app/models/foreman_openscap/arf_report.rb
|
66
|
+
- app/models/foreman_openscap/asset.rb
|
67
|
+
- app/models/foreman_openscap/asset_policy.rb
|
68
|
+
- app/models/foreman_openscap/compliance_status.rb
|
69
|
+
- app/models/foreman_openscap/policy.rb
|
70
|
+
- app/models/foreman_openscap/policy_arf_report.rb
|
71
|
+
- app/models/foreman_openscap/policy_revision.rb
|
72
|
+
- app/models/foreman_openscap/scap_content.rb
|
73
|
+
- app/models/foreman_openscap/scap_content_profile.rb
|
76
74
|
- app/overrides/hosts/overview/host_compliance_status.rb
|
77
|
-
- app/services/
|
78
|
-
- app/services/
|
79
|
-
- app/services/
|
75
|
+
- app/services/foreman_openscap/arf_report_status_calculator.rb
|
76
|
+
- app/services/foreman_openscap/host_report_dashboard/data.rb
|
77
|
+
- app/services/foreman_openscap/policy_dashboard/data.rb
|
78
|
+
- app/services/foreman_openscap/report_dashboard/data.rb
|
80
79
|
- app/views/api/v2/compliance/arf_reports/base.json.rabl
|
81
80
|
- app/views/api/v2/compliance/arf_reports/index.json.rabl
|
82
81
|
- app/views/api/v2/compliance/arf_reports/main.json.rabl
|
83
82
|
- app/views/api/v2/compliance/arf_reports/show.json.rabl
|
84
83
|
- app/views/api/v2/compliance/policies/base.json.rabl
|
84
|
+
- app/views/api/v2/compliance/policies/create.json.rabl
|
85
85
|
- app/views/api/v2/compliance/policies/index.json.rabl
|
86
86
|
- app/views/api/v2/compliance/policies/main.json.rabl
|
87
87
|
- app/views/api/v2/compliance/policies/show.json.rabl
|
@@ -89,44 +89,85 @@ files:
|
|
89
89
|
- app/views/api/v2/compliance/scap_contents/index.json.rabl
|
90
90
|
- app/views/api/v2/compliance/scap_contents/main.json.rabl
|
91
91
|
- app/views/api/v2/compliance/scap_contents/show.json.rabl
|
92
|
-
- app/views/
|
93
|
-
- app/views/
|
94
|
-
- app/views/
|
95
|
-
- app/views/
|
96
|
-
- app/views/
|
97
|
-
- app/views/
|
98
|
-
- app/views/
|
99
|
-
- app/views/
|
100
|
-
- app/views/
|
101
|
-
- app/views/
|
102
|
-
- app/views/
|
103
|
-
- app/views/
|
104
|
-
- app/views/
|
105
|
-
- app/views/
|
106
|
-
- app/views/
|
107
|
-
- app/views/
|
108
|
-
- app/views/
|
109
|
-
- app/views/
|
110
|
-
- app/views/
|
111
|
-
- app/views/
|
112
|
-
- app/views/
|
113
|
-
- app/views/
|
114
|
-
- app/views/
|
115
|
-
- app/views/
|
116
|
-
- app/views/
|
117
|
-
- app/views/
|
118
|
-
- app/views/
|
119
|
-
- app/views/
|
120
|
-
- app/views/
|
121
|
-
- app/views/
|
122
|
-
- app/views/
|
123
|
-
- app/views/
|
124
|
-
- app/views/
|
125
|
-
- app/views/
|
126
|
-
- app/views/
|
127
|
-
- app/views/
|
92
|
+
- app/views/arf_reports/_list.html.erb
|
93
|
+
- app/views/arf_reports/_metrics.html.erb
|
94
|
+
- app/views/arf_reports/_output.html.erb
|
95
|
+
- app/views/arf_reports/index.html.erb
|
96
|
+
- app/views/arf_reports/show.html.erb
|
97
|
+
- app/views/arf_reports/show_html.html.erb
|
98
|
+
- app/views/compliance_hosts/_compliance_status.erb
|
99
|
+
- app/views/compliance_hosts/show.html.erb
|
100
|
+
- app/views/dashboard/_compliance_host_reports_widget.html.erb
|
101
|
+
- app/views/dashboard/_compliance_reports_breakdown_widget.html.erb
|
102
|
+
- app/views/foreman_openscap/policy_mailer/_dashboard.erb
|
103
|
+
- app/views/foreman_openscap/policy_mailer/_hosts.erb
|
104
|
+
- app/views/foreman_openscap/policy_mailer/_list.erb
|
105
|
+
- app/views/foreman_openscap/policy_mailer/_policy.erb
|
106
|
+
- app/views/foreman_openscap/policy_mailer/policy_summary.erb
|
107
|
+
- app/views/policies/_form.html.erb
|
108
|
+
- app/views/policies/_list.html.erb
|
109
|
+
- app/views/policies/_scap_content_results.html.erb
|
110
|
+
- app/views/policies/create.html.erb
|
111
|
+
- app/views/policies/disassociate_multiple_hosts.html.erb
|
112
|
+
- app/views/policies/edit.html.erb
|
113
|
+
- app/views/policies/index.html.erb
|
114
|
+
- app/views/policies/new.html.erb
|
115
|
+
- app/views/policies/select_multiple_hosts.html.erb
|
116
|
+
- app/views/policies/show.html.erb
|
117
|
+
- app/views/policies/steps/_create_policy_form.html.erb
|
118
|
+
- app/views/policies/steps/_hostgroups_form.html.erb
|
119
|
+
- app/views/policies/steps/_locations_form.html.erb
|
120
|
+
- app/views/policies/steps/_organizations_form.html.erb
|
121
|
+
- app/views/policies/steps/_scap_content_form.html.erb
|
122
|
+
- app/views/policies/steps/_schedule_form.html.erb
|
123
|
+
- app/views/policies/steps/_step_form.html.erb
|
124
|
+
- app/views/policies/welcome.html.erb
|
125
|
+
- app/views/policy_dashboard/_policy_chart_widget.html.erb
|
126
|
+
- app/views/policy_dashboard/_policy_reports.html.erb
|
127
|
+
- app/views/policy_dashboard/_policy_status_widget.html.erb
|
128
|
+
- app/views/policy_dashboard/index.html.erb
|
129
|
+
- app/views/scap_contents/_form.html.erb
|
130
|
+
- app/views/scap_contents/_list.html.erb
|
131
|
+
- app/views/scap_contents/edit.html.erb
|
132
|
+
- app/views/scap_contents/index.html.erb
|
133
|
+
- app/views/scap_contents/new.html.erb
|
134
|
+
- app/views/scap_contents/welcome.html.erb
|
128
135
|
- config/routes.rb
|
136
|
+
- db/migrate/20141013172051_create_scaptimony_policies.rb
|
137
|
+
- db/migrate/20141014105333_create_scaptimony_assets.rb
|
138
|
+
- db/migrate/20141015092642_create_scaptimony_arf_reports.rb
|
139
|
+
- db/migrate/20141015115511_add_arf_report_unique_constraint.rb
|
140
|
+
- db/migrate/20141104164201_create_scaptimony_scap_contents.rb
|
141
|
+
- db/migrate/20141104171545_create_scaptimony_policy_revisions.rb
|
142
|
+
- db/migrate/20141105174625_add_description_to_scaptimony_policy_revisions.rb
|
143
|
+
- db/migrate/20141105174834_add_columns_to_scaptimony_policies.rb
|
144
|
+
- db/migrate/20141107091756_add_columns_to_scaptimony_scap_contents.rb
|
145
|
+
- db/migrate/20141111104519_add_constraint_to_scaptimony_scap_contents.rb
|
146
|
+
- db/migrate/20141113221054_create_scaptimony_scap_content_profiles.rb
|
147
|
+
- db/migrate/20141116170632_remove_xccdf_profile_from_scaptimony_policies.rb
|
148
|
+
- db/migrate/20141116171305_add_profile_to_scaptimony_policies.rb
|
149
|
+
- db/migrate/20141118142954_add_constraint_to_scaptimony_policies.rb
|
150
|
+
- db/migrate/20141119164918_create_scaptimony_xccdf_results.rb
|
151
|
+
- db/migrate/20141119175434_create_scaptimony_xccdf_rules.rb
|
152
|
+
- db/migrate/20141119182606_create_scaptimony_xccdf_rule_results.rb
|
153
|
+
- db/migrate/20141121120326_create_scaptimony_arf_report_breakdowns.rb
|
154
|
+
- db/migrate/20141121164042_replace_arf_report_breakdown_view.rb
|
155
|
+
- db/migrate/20141206211151_create_scaptimony_assets_policies.rb
|
156
|
+
- db/migrate/20141214112917_add_scap_file_to_scap_content.rb
|
157
|
+
- db/migrate/20141216154502_rename_scaptimony_asset_policies.rb
|
158
|
+
- db/migrate/20150111085317_polymorph_asset.rb
|
159
|
+
- db/migrate/20150112152944_create_scaptimony_arf_report_raws.rb
|
160
|
+
- db/migrate/20150114210634_rename_scaptimony_arf_report_raw_raw.rb
|
161
|
+
- db/migrate/20150115155947_add_scaptimony_scap_content_digest.rb
|
162
|
+
- db/migrate/20150116083129_add_day_of_month_and_cron_line_to_scaptimony_policy.rb
|
163
|
+
- db/migrate/20150821100137_migrate_from_scaptimony.rb
|
164
|
+
- db/migrate/20150827123826_remove_scaptimony_permissions.rb
|
165
|
+
- db/migrate/20150925124959_create_policy_arf_reports.rb
|
166
|
+
- db/migrate/20150929124853_add_result_to_logs.rb
|
167
|
+
- db/migrate/20150929152345_move_arf_reports_to_reports_table.rb
|
168
|
+
- db/migrate/20151023131950_link_arf_report_directly_to_host.rb
|
129
169
|
- db/seeds.d/openscap_feature.rb
|
170
|
+
- db/seeds.d/openscap_policy_notification.rb
|
130
171
|
- db/seeds.d/openscap_scap_default.rb
|
131
172
|
- lib/foreman_openscap.rb
|
132
173
|
- lib/foreman_openscap/bulk_upload.rb
|
@@ -136,6 +177,9 @@ files:
|
|
136
177
|
- lib/tasks/foreman_openscap_tasks.rake
|
137
178
|
- test/factories/arf_report_factory.rb
|
138
179
|
- test/factories/asset_factory.rb
|
180
|
+
- test/factories/compliance_host_factory.rb
|
181
|
+
- test/factories/compliance_log_factory.rb
|
182
|
+
- test/factories/policy_arf_report_factory.rb
|
139
183
|
- test/factories/policy_factory.rb
|
140
184
|
- test/factories/scap_content_related.rb
|
141
185
|
- test/files/scap_contents/ssg-fedora-ds.xml
|
@@ -144,7 +188,12 @@ files:
|
|
144
188
|
- test/functional/api/v2/compliance/scap_contents_controller_test.rb
|
145
189
|
- test/lib/foreman_openscap/bulk_upload_test.rb
|
146
190
|
- test/test_plugin_helper.rb
|
191
|
+
- test/unit/arf_report_status_calculator_test.rb
|
192
|
+
- test/unit/arf_report_test.rb
|
193
|
+
- test/unit/compliance_status_test.rb
|
147
194
|
- test/unit/openscap_host_test.rb
|
195
|
+
- test/unit/policy_mailer_test.rb
|
196
|
+
- test/unit/scap_content_test.rb
|
148
197
|
homepage: https://github.com/OpenSCAP/foreman_openscap
|
149
198
|
licenses:
|
150
199
|
- GPL-3.0
|
@@ -155,12 +204,12 @@ require_paths:
|
|
155
204
|
- lib
|
156
205
|
required_ruby_version: !ruby/object:Gem::Requirement
|
157
206
|
requirements:
|
158
|
-
- -
|
207
|
+
- - '>='
|
159
208
|
- !ruby/object:Gem::Version
|
160
209
|
version: '0'
|
161
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
211
|
requirements:
|
163
|
-
- -
|
212
|
+
- - '>='
|
164
213
|
- !ruby/object:Gem::Version
|
165
214
|
version: '0'
|
166
215
|
requirements: []
|
@@ -170,15 +219,22 @@ signing_key:
|
|
170
219
|
specification_version: 4
|
171
220
|
summary: Foreman plug-in for displaying OpenSCAP audit reports
|
172
221
|
test_files:
|
222
|
+
- test/factories/policy_arf_report_factory.rb
|
173
223
|
- test/factories/policy_factory.rb
|
224
|
+
- test/factories/compliance_log_factory.rb
|
174
225
|
- test/factories/asset_factory.rb
|
175
226
|
- test/factories/scap_content_related.rb
|
176
227
|
- test/factories/arf_report_factory.rb
|
228
|
+
- test/factories/compliance_host_factory.rb
|
177
229
|
- test/lib/foreman_openscap/bulk_upload_test.rb
|
230
|
+
- test/unit/scap_content_test.rb
|
178
231
|
- test/unit/openscap_host_test.rb
|
232
|
+
- test/unit/compliance_status_test.rb
|
233
|
+
- test/unit/arf_report_status_calculator_test.rb
|
234
|
+
- test/unit/policy_mailer_test.rb
|
235
|
+
- test/unit/arf_report_test.rb
|
179
236
|
- test/files/scap_contents/ssg-fedora-ds.xml
|
180
237
|
- test/functional/api/v2/compliance/policies_controller_test.rb
|
181
238
|
- test/functional/api/v2/compliance/scap_contents_controller_test.rb
|
182
239
|
- test/functional/api/v2/compliance/arf_reports_controller_test.rb
|
183
240
|
- test/test_plugin_helper.rb
|
184
|
-
has_rdoc:
|