foreman_openscap 0.3.1 → 0.3.2
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.
- checksums.yaml +4 -4
- data/app/assets/javascript/foreman_openscap/policy_edit.js +2 -0
- data/app/models/concerns/foreman_openscap/arf_report_extensions.rb +2 -2
- data/app/models/concerns/foreman_openscap/policy_extensions.rb +15 -5
- data/app/views/scaptimony_policies/_form.html.erb +8 -2
- data/app/views/scaptimony_policies/_scap_content_results.html.erb +3 -0
- data/app/views/scaptimony_policies/steps/_scap_content_form.html.erb +3 -1
- data/lib/foreman_openscap/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0b2635b4110d762e082b3b0deea79656f308712
|
4
|
+
data.tar.gz: 6488a4c319870ff0347bfedf2d1ad27659dab5a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 257acb224a1ffaeed43d9cba4216038920357ea2fed6c493d52b8d0efa0b639f58021cd159681d4eef6970de6067bfdbc358cd5cebf8d60af5b28c6627269797
|
7
|
+
data.tar.gz: 351b39d8450200c2884d63a419741a93900600b229c7fa492db305b74c9bfd7b74701ed206705472842490d17b0d1932925e34a1c718e0dd6403a99a47042e0b
|
@@ -8,7 +8,9 @@ function scap_content_selected(element){
|
|
8
8
|
url: url,
|
9
9
|
complete: function() { $(element).indicator_hide();},
|
10
10
|
success: function(request) {
|
11
|
+
$('#file-location').remove();
|
11
12
|
$('#scap_content_profile_select').html(request);
|
13
|
+
$('#scap_content .alert-info').append($('#file-location'));
|
12
14
|
}
|
13
15
|
})
|
14
16
|
}
|
@@ -33,8 +33,8 @@ module ForemanOpenscap
|
|
33
33
|
|
34
34
|
def assign_locations_organizations
|
35
35
|
if host
|
36
|
-
self.location_ids = [host.
|
37
|
-
self.organization_ids = [host.
|
36
|
+
self.location_ids = [host.location_id] if SETTINGS[:locations_enabled]
|
37
|
+
self.organization_ids = [host.organization_id] if SETTINGS[:organizations_enabled]
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -22,6 +22,7 @@ module ForemanOpenscap
|
|
22
22
|
SCAP_PUPPET_CLASS = 'foreman_scap_client'
|
23
23
|
POLICIES_CLASS_PARAMETER = 'policies'
|
24
24
|
SERVER_CLASS_PARAMETER = 'server'
|
25
|
+
PORT_CLASS_PARAMETER = 'port'
|
25
26
|
|
26
27
|
validates :name, :presence => true, :uniqueness => true, :format => { without: /\s/ }
|
27
28
|
validate :ensure_needed_puppetclasses
|
@@ -50,9 +51,11 @@ module ForemanOpenscap
|
|
50
51
|
end
|
51
52
|
|
52
53
|
def hostgroup_ids=(ids)
|
54
|
+
hostgroup_assets = []
|
53
55
|
ids.reject(&:empty?).map do |id|
|
54
|
-
|
56
|
+
hostgroup_assets << assets.where(:assetable_type => 'Hostgroup', :assetable_id => id).first_or_create!
|
55
57
|
end
|
58
|
+
self.assets = hostgroup_assets
|
56
59
|
end
|
57
60
|
|
58
61
|
def hostgroups
|
@@ -221,11 +224,18 @@ module ForemanOpenscap
|
|
221
224
|
end
|
222
225
|
|
223
226
|
def populate_overrides(puppetclass, hostgroup)
|
224
|
-
puppetclass.class_params.where(:override => true
|
227
|
+
puppetclass.class_params.where(:override => true).each do |override|
|
225
228
|
if hostgroup.puppet_proxy && (url = hostgroup.puppet_proxy.url).present?
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
+
case override.key
|
230
|
+
when SERVER_CLASS_PARAMETER
|
231
|
+
lookup_value = LookupValue.where(:match => "hostgroup=#{hostgroup.to_label}", :lookup_key_id => override.id).first_or_initialize
|
232
|
+
puppet_proxy_fqdn = URI.parse(url).host
|
233
|
+
lookup_value.update_attribute(:value, puppet_proxy_fqdn)
|
234
|
+
when PORT_CLASS_PARAMETER
|
235
|
+
lookup_value = LookupValue.where(:match => "hostgroup=#{hostgroup.to_label}", :lookup_key_id => override.id).first_or_initialize
|
236
|
+
puppet_proxy_port = URI.parse(url).port
|
237
|
+
lookup_value.update_attribute(:value, puppet_proxy_port)
|
238
|
+
end
|
229
239
|
end
|
230
240
|
end
|
231
241
|
end
|
@@ -24,8 +24,14 @@
|
|
24
24
|
<div class="tab-pane" id="scap_content">
|
25
25
|
<%= scap_content_selector(f) %>
|
26
26
|
<span id="scap_content_profile_select">
|
27
|
-
|
28
|
-
|
27
|
+
<%= scap_content_profile_selector(f) %>
|
28
|
+
</span>
|
29
|
+
<div class="alert alert-info">
|
30
|
+
<%= icon_text("info-sign", _('Notice: Ensure the selected SCAP content exists on your hosts.')) %>
|
31
|
+
<div id="file-location">
|
32
|
+
<b><%= _('SCAP content file should be /var/lib/openscap/content/%s.xml on your clients.') % @policy.scap_content.digest %></b>
|
33
|
+
</div>
|
34
|
+
</div>
|
29
35
|
</div>
|
30
36
|
<div class="tab-pane" id="scap_schedule">
|
31
37
|
<%= select_f(f, :period, %w[Weekly Monthly Custom], :downcase, :to_s,
|
@@ -5,6 +5,8 @@
|
|
5
5
|
<span id="scap_content_profile_select">
|
6
6
|
<%= scap_content_profile_selector(f) %>
|
7
7
|
</span>
|
8
|
-
<
|
8
|
+
<div class="alert alert-info">
|
9
|
+
<%= icon_text("info-sign", _('Notice: Ensure the selected SCAP content exists on your hosts.')) %>
|
10
|
+
</div>
|
9
11
|
</div>
|
10
12
|
|
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: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Šimon Lukašík"
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02
|
11
|
+
date: 2015-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -143,3 +143,4 @@ test_files:
|
|
143
143
|
- test/unit/foreman_openscap_test.rb
|
144
144
|
- test/test_plugin_helper.rb
|
145
145
|
- test/factories/foreman_openscap_factories.rb
|
146
|
+
has_rdoc:
|