foreman_openscap 4.1.2 → 4.2.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/stylesheets/foreman_openscap/policy.css +5 -0
- data/app/helpers/arf_reports_helper.rb +7 -10
- data/app/helpers/policies_helper.rb +4 -17
- data/app/models/foreman_openscap/arf_report.rb +2 -2
- data/app/models/foreman_openscap/policy.rb +3 -4
- data/app/views/arf_reports/show.html.erb +1 -1
- data/app/views/arf_reports/show_html.html.erb +1 -0
- data/app/views/compliance_hosts/show.html.erb +1 -8
- data/app/views/policies/edit.html.erb +3 -2
- data/app/views/policies/show.html.erb +3 -1
- data/app/views/scap_contents/edit.html.erb +2 -12
- data/app/views/tailoring_files/edit.html.erb +2 -10
- data/db/seeds.d/75-job_templates.rb +3 -2
- data/lib/foreman_openscap/bulk_upload.rb +2 -2
- data/lib/foreman_openscap/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69eab4d9434f1b502ba511db38d8a7faff9721c5416703f6010ccc87fdc52b86
|
4
|
+
data.tar.gz: 94ba4cbecc85106f968d9b5f137e0808dbd12711db01fd14e0f0c4e9761e27a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e3253f876e3ab4efd5c853fdb05f0b81cbbe7184c5b00ea552690b0cce9664a76210c32f92fe86c631bc9eaa2ed81ba1a8762b8b47e0678149a946cf593554e
|
7
|
+
data.tar.gz: a6c3706f6fcc836af18f7aeda76c1cf735981836a0661cdcc66e4ead2272b6249519f305ff3b6766266ebb05eda1ebfe778811993286be3e162e269412aa6fd8
|
@@ -14,16 +14,13 @@ module ArfReportsHelper
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def arf_report_breadcrumbs
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
:url => (arf_report_path(@arf_report) if authorized_for(hash_for_arf_report_path(@arf_report))) }
|
25
|
-
])
|
26
|
-
end
|
17
|
+
breadcrumbs(:resource_url => api_compliance_arf_reports_path,
|
18
|
+
:switchable => false,
|
19
|
+
:items => [
|
20
|
+
{ :caption => _('Compliance Reports'),
|
21
|
+
:url => url_for(arf_reports_path) },
|
22
|
+
{ :caption => @arf_report.host.to_s }
|
23
|
+
])
|
27
24
|
end
|
28
25
|
|
29
26
|
def result_tag(level)
|
@@ -11,10 +11,10 @@ module PoliciesHelper
|
|
11
11
|
|
12
12
|
def deploy_by_radios(f, policy)
|
13
13
|
ForemanOpenscap::ConfigNameService.new.configs.map do |tool|
|
14
|
-
popover_block = popover("", config_inline_help(tool.inline_help))
|
14
|
+
popover_block = tag.span(popover("", config_inline_help(tool.inline_help)), class: 'scap_policy_popover')
|
15
15
|
|
16
|
-
label = label_tag('', :class => 'col-md-2 control-label') do
|
17
|
-
tool.type.to_s.capitalize.html_safe
|
16
|
+
label = label_tag('', :class => 'col-md-2 control-label', :for => "policy_deploy_by_#{tool.type}") do
|
17
|
+
tool.type.to_s.capitalize.html_safe
|
18
18
|
end
|
19
19
|
|
20
20
|
radio = content_tag(:div, :class => "col-md-2") do
|
@@ -23,7 +23,7 @@ module PoliciesHelper
|
|
23
23
|
|
24
24
|
content_tag(:div, :class => "clearfix") do
|
25
25
|
content_tag(:div, :class => "form-group") do
|
26
|
-
label.html_safe + radio.html_safe
|
26
|
+
label.html_safe + popover_block.html_safe + radio.html_safe
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end.join('').html_safe
|
@@ -136,17 +136,4 @@ module PoliciesHelper
|
|
136
136
|
def translate_steps(policy)
|
137
137
|
policy.steps.map { |step| _(step) }
|
138
138
|
end
|
139
|
-
|
140
|
-
def policy_breadcrumbs
|
141
|
-
if @policy
|
142
|
-
breadcrumbs(:resource_url => api_compliance_policies_path,
|
143
|
-
:name_field => 'name',
|
144
|
-
:items => [
|
145
|
-
{ :caption => _('Policies'),
|
146
|
-
:url => url_for(policies_path) },
|
147
|
-
{ :caption => @policy.name,
|
148
|
-
:url => (edit_policy_path(@policy) if authorized_for(hash_for_edit_policy_path(@policy))) }
|
149
|
-
])
|
150
|
-
end
|
151
|
-
end
|
152
139
|
end
|
@@ -156,8 +156,8 @@ module ForemanOpenscap
|
|
156
156
|
|
157
157
|
def assign_locations_organizations
|
158
158
|
if host
|
159
|
-
self.location_ids = [host.location_id]
|
160
|
-
self.organization_ids = [host.organization_id]
|
159
|
+
self.location_ids = [host.location_id]
|
160
|
+
self.organization_ids = [host.organization_id]
|
161
161
|
end
|
162
162
|
end
|
163
163
|
|
@@ -6,6 +6,8 @@ module ForemanOpenscap
|
|
6
6
|
include Taxonomix
|
7
7
|
attr_writer :current_step, :wizard_initiated
|
8
8
|
|
9
|
+
STEPS_LIST = [N_('Deployment Options'), N_('Policy Attributes'), N_('SCAP Content'), N_('Schedule'), N_('Locations'), N_('Organizations'), N_('Hostgroups')]
|
10
|
+
|
9
11
|
belongs_to :scap_content
|
10
12
|
belongs_to :scap_content_profile
|
11
13
|
belongs_to :tailoring_file
|
@@ -108,10 +110,7 @@ module ForemanOpenscap
|
|
108
110
|
end
|
109
111
|
|
110
112
|
def steps
|
111
|
-
|
112
|
-
base_steps << N_('Locations') if SETTINGS[:locations_enabled]
|
113
|
-
base_steps << N_('Organizations') if SETTINGS[:organizations_enabled]
|
114
|
-
base_steps << N_('Hostgroups') # always be last.
|
113
|
+
STEPS_LIST
|
115
114
|
end
|
116
115
|
|
117
116
|
def current_step
|
@@ -3,14 +3,7 @@
|
|
3
3
|
|
4
4
|
<%= breadcrumbs(:resource_url => api_hosts_path,
|
5
5
|
:resource_filter => "is_compliance_host = true",
|
6
|
-
:name_field => 'name'
|
7
|
-
:switchable => true,
|
8
|
-
:items => [
|
9
|
-
{ :caption => _('Compliance Hosts'),
|
10
|
-
:url => url_for(hosts_path(:search => "is_compliance_host = true")) },
|
11
|
-
{ :caption => ((N_("%s compliance reports by policy") % @host.to_label)),
|
12
|
-
:url => (host_path(@host) if authorized_for(hash_for_host_path(@host))) }
|
13
|
-
])
|
6
|
+
:name_field => 'name')
|
14
7
|
%>
|
15
8
|
<% title n_("%s compliance report by policy", "%s compliance reports by policy" , @host.combined_policies.length) % @host.to_label %>
|
16
9
|
<% @host.combined_policies.each do |policy| %>
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
<% title _("Details for Compliance Policy %s") % @policy.name %>
|
2
|
+
<%= breadcrumbs(:resource_url => api_compliance_policies_path,
|
3
|
+
:name_field => 'name') %>
|
2
4
|
|
3
5
|
<div class="row">
|
4
6
|
<iframe style="min-height: 800px" height="100%" width="100%" frameborder="0" src="<%= parse_policy_path(@policy) %>"></iframe>
|
@@ -1,15 +1,5 @@
|
|
1
|
-
<% title _("Edit
|
1
|
+
<% title _("Edit %s") % @scap_content.title %>
|
2
2
|
<%= breadcrumbs(:resource_url => api_compliance_scap_contents_path,
|
3
|
-
:name_field => 'title'
|
4
|
-
:items => [
|
5
|
-
{ :caption => _('Scap Contents'),
|
6
|
-
:url => url_for(scap_contents_path)
|
7
|
-
},
|
8
|
-
{ :caption => @scap_content.title,
|
9
|
-
:url => (edit_scap_content_path(@scap_content) if authorized_for(hash_for_edit_scap_content_path(@scap_content)))
|
10
|
-
}
|
11
|
-
]
|
12
|
-
) if @scap_content %>
|
13
|
-
|
3
|
+
:name_field => 'title') %>
|
14
4
|
|
15
5
|
<%= render :partial => 'form' %>
|
@@ -1,13 +1,5 @@
|
|
1
|
-
<% title _("Edit
|
1
|
+
<% title _("Edit %s") % @tailoring_file.name %>
|
2
2
|
<%= breadcrumbs(:resource_url => api_compliance_tailoring_files_path,
|
3
|
-
:
|
4
|
-
{ :caption => _('Tailoring Files'),
|
5
|
-
:url => url_for(tailoring_files_path)
|
6
|
-
},
|
7
|
-
{ :caption => @tailoring_file.name,
|
8
|
-
:url => (edit_tailoring_file_path(@tailoring_file) if authorized_for(hash_for_edit_tailoring_file_path(@tailoring_file)))
|
9
|
-
}
|
10
|
-
]
|
11
|
-
) if @tailoring_file %>
|
3
|
+
:name_field => 'name') %>
|
12
4
|
|
13
5
|
<%= render :partial => 'form' %>
|
@@ -11,8 +11,9 @@ if ForemanOpenscap.with_remote_execution?
|
|
11
11
|
else
|
12
12
|
template = JobTemplate.import!(File.read(template), :default => true, :lock => true, :update => sync)
|
13
13
|
end
|
14
|
-
|
15
|
-
template.
|
14
|
+
next unless template.present?
|
15
|
+
template.organizations = organizations
|
16
|
+
template.locations = locations
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
@@ -49,8 +49,8 @@ module ForemanOpenscap
|
|
49
49
|
next if scap_content.persisted?
|
50
50
|
scap_content.scap_file = file
|
51
51
|
scap_content.original_filename = filename
|
52
|
-
scap_content.location_ids = Location.all.
|
53
|
-
scap_content.organization_ids = Organization.all.
|
52
|
+
scap_content.location_ids = Location.all.pluck(:id)
|
53
|
+
scap_content.organization_ids = Organization.all.pluck(:id)
|
54
54
|
|
55
55
|
if scap_content.save
|
56
56
|
@result.results.push(scap_content)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_openscap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- slukasik@redhat.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|