foreman_openscap 10.0.3 → 10.1.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/arf_reports.js +3 -3
- data/app/assets/javascripts/foreman_openscap/locale/cs_CZ/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/de/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/en/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/en_GB/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/es/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/fr/foreman_openscap.js +3 -3
- data/app/assets/javascripts/foreman_openscap/locale/gl/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/it/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/ja/foreman_openscap.js +3 -3
- data/app/assets/javascripts/foreman_openscap/locale/ka/foreman_openscap.js +3 -3
- data/app/assets/javascripts/foreman_openscap/locale/ko/foreman_openscap.js +208 -210
- data/app/assets/javascripts/foreman_openscap/locale/pt_BR/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/ru/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/sv_SE/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/zh_CN/foreman_openscap.js +3 -3
- data/app/assets/javascripts/foreman_openscap/locale/zh_TW/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/policy_edit.js +1 -1
- data/app/assets/javascripts/foreman_openscap/reports.js +1 -1
- data/app/controllers/api/v2/compliance/scap_contents_controller.rb +0 -2
- data/app/controllers/arf_reports_controller.rb +8 -2
- data/{lib → app/services}/foreman_openscap/bulk_upload.rb +14 -7
- data/app/views/arf_reports/_list.html.erb +1 -1
- data/lib/foreman_openscap/engine.rb +1 -1
- data/lib/foreman_openscap/version.rb +1 -1
- data/lib/tasks/foreman_openscap_tasks.rake +0 -1
- data/locale/cs_CZ/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/cs_CZ/foreman_openscap.edit.po +1442 -0
- data/locale/cs_CZ/foreman_openscap.po +2 -2
- data/locale/cs_CZ/foreman_openscap.po.time_stamp +0 -0
- data/locale/de/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/de/foreman_openscap.edit.po +1450 -0
- data/locale/de/foreman_openscap.po +2 -2
- data/locale/de/foreman_openscap.po.time_stamp +0 -0
- data/locale/en/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/en/foreman_openscap.edit.po +1439 -0
- data/locale/en/foreman_openscap.po +2 -2
- data/locale/en/foreman_openscap.po.time_stamp +0 -0
- data/locale/en_GB/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/en_GB/foreman_openscap.edit.po +1440 -0
- data/locale/en_GB/foreman_openscap.po +2 -2
- data/locale/en_GB/foreman_openscap.po.time_stamp +0 -0
- data/locale/es/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/es/foreman_openscap.edit.po +1445 -0
- data/locale/es/foreman_openscap.po +2 -2
- data/locale/es/foreman_openscap.po.time_stamp +0 -0
- data/locale/foreman_openscap.pot +60 -62
- data/locale/fr/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/fr/foreman_openscap.edit.po +1459 -0
- data/locale/fr/foreman_openscap.po +3 -3
- data/locale/fr/foreman_openscap.po.time_stamp +0 -0
- data/locale/gl/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/gl/foreman_openscap.edit.po +1440 -0
- data/locale/gl/foreman_openscap.po +2 -2
- data/locale/gl/foreman_openscap.po.time_stamp +0 -0
- data/locale/it/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/it/foreman_openscap.edit.po +1442 -0
- data/locale/it/foreman_openscap.po +2 -2
- data/locale/it/foreman_openscap.po.time_stamp +0 -0
- data/locale/ja/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/ja/foreman_openscap.edit.po +1452 -0
- data/locale/ja/foreman_openscap.po +3 -3
- data/locale/ja/foreman_openscap.po.time_stamp +0 -0
- data/locale/ka/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/ka/foreman_openscap.edit.po +1448 -0
- data/locale/ka/foreman_openscap.po +3 -3
- data/locale/ka/foreman_openscap.po.time_stamp +0 -0
- data/locale/ko/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/ko/foreman_openscap.edit.po +1444 -0
- data/locale/ko/foreman_openscap.po +208 -210
- data/locale/ko/foreman_openscap.po.time_stamp +0 -0
- data/locale/pt_BR/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/pt_BR/foreman_openscap.edit.po +1450 -0
- data/locale/pt_BR/foreman_openscap.po +2 -2
- data/locale/pt_BR/foreman_openscap.po.time_stamp +0 -0
- data/locale/ru/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/ru/foreman_openscap.edit.po +1444 -0
- data/locale/ru/foreman_openscap.po +2 -2
- data/locale/ru/foreman_openscap.po.time_stamp +0 -0
- data/locale/sv_SE/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/sv_SE/foreman_openscap.edit.po +1440 -0
- data/locale/sv_SE/foreman_openscap.po +2 -2
- data/locale/sv_SE/foreman_openscap.po.time_stamp +0 -0
- data/locale/zh_CN/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/zh_CN/foreman_openscap.edit.po +1451 -0
- data/locale/zh_CN/foreman_openscap.po +3 -3
- data/locale/zh_CN/foreman_openscap.po.time_stamp +0 -0
- data/locale/zh_TW/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/zh_TW/foreman_openscap.edit.po +1441 -0
- data/locale/zh_TW/foreman_openscap.po +2 -2
- data/locale/zh_TW/foreman_openscap.po.time_stamp +0 -0
- data/test/lib/foreman_openscap/bulk_upload_test.rb +3 -4
- metadata +50 -4
@@ -3,7 +3,7 @@
|
|
3
3
|
"locale_data": {
|
4
4
|
"foreman_openscap": {
|
5
5
|
"": {
|
6
|
-
"Project-Id-Version": "foreman_openscap 10.0
|
6
|
+
"Project-Id-Version": "foreman_openscap 10.1.0",
|
7
7
|
"Report-Msgid-Bugs-To": "",
|
8
8
|
"PO-Revision-Date": "2016-04-14 07:48+0000",
|
9
9
|
"Last-Translator": "FIRST AUTHOR <EMAIL@ADDRESS>, 2016",
|
@@ -94,7 +94,7 @@
|
|
94
94
|
"By default, remediation is applied to the current host. Optionally, remediate any additional hosts that fail the rule.": [
|
95
95
|
""
|
96
96
|
],
|
97
|
-
"Can't find
|
97
|
+
"Can't find %{packages} RPM(s), are you sure it is installed on your server?": [
|
98
98
|
""
|
99
99
|
],
|
100
100
|
"Cancel": [
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"locale_data": {
|
4
4
|
"foreman_openscap": {
|
5
5
|
"": {
|
6
|
-
"Project-Id-Version": "foreman_openscap 10.0
|
6
|
+
"Project-Id-Version": "foreman_openscap 10.1.0",
|
7
7
|
"Report-Msgid-Bugs-To": "",
|
8
8
|
"PO-Revision-Date": "2016-04-14 07:48+0000",
|
9
9
|
"Last-Translator": "FIRST AUTHOR <EMAIL@ADDRESS>, 2016",
|
@@ -93,7 +93,7 @@
|
|
93
93
|
"By default, remediation is applied to the current host. Optionally, remediate any additional hosts that fail the rule.": [
|
94
94
|
""
|
95
95
|
],
|
96
|
-
"Can't find
|
96
|
+
"Can't find %{packages} RPM(s), are you sure it is installed on your server?": [
|
97
97
|
""
|
98
98
|
],
|
99
99
|
"Cancel": [
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"locale_data": {
|
4
4
|
"foreman_openscap": {
|
5
5
|
"": {
|
6
|
-
"Project-Id-Version": "foreman_openscap 10.0
|
6
|
+
"Project-Id-Version": "foreman_openscap 10.1.0",
|
7
7
|
"Report-Msgid-Bugs-To": "",
|
8
8
|
"PO-Revision-Date": "2016-04-14 07:48+0000",
|
9
9
|
"Last-Translator": "FULL NAME <EMAIL@ADDRESS>",
|
@@ -93,7 +93,7 @@
|
|
93
93
|
"By default, remediation is applied to the current host. Optionally, remediate any additional hosts that fail the rule.": [
|
94
94
|
""
|
95
95
|
],
|
96
|
-
"Can't find
|
96
|
+
"Can't find %{packages} RPM(s), are you sure it is installed on your server?": [
|
97
97
|
""
|
98
98
|
],
|
99
99
|
"Cancel": [
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"locale_data": {
|
4
4
|
"foreman_openscap": {
|
5
5
|
"": {
|
6
|
-
"Project-Id-Version": "foreman_openscap 10.0
|
6
|
+
"Project-Id-Version": "foreman_openscap 10.1.0",
|
7
7
|
"Report-Msgid-Bugs-To": "",
|
8
8
|
"PO-Revision-Date": "2016-04-14 07:48+0000",
|
9
9
|
"Last-Translator": "FIRST AUTHOR <EMAIL@ADDRESS>, 2016",
|
@@ -92,8 +92,8 @@
|
|
92
92
|
"By default, remediation is applied to the current host. Optionally, remediate any additional hosts that fail the rule.": [
|
93
93
|
"默认情况下,补救会应用到当前主机。(可选)修复任何规则失败的额外主机。"
|
94
94
|
],
|
95
|
-
"Can't find
|
96
|
-
"
|
95
|
+
"Can't find %{packages} RPM(s), are you sure it is installed on your server?": [
|
96
|
+
""
|
97
97
|
],
|
98
98
|
"Cancel": [
|
99
99
|
"取消"
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"locale_data": {
|
4
4
|
"foreman_openscap": {
|
5
5
|
"": {
|
6
|
-
"Project-Id-Version": "foreman_openscap 10.0
|
6
|
+
"Project-Id-Version": "foreman_openscap 10.1.0",
|
7
7
|
"Report-Msgid-Bugs-To": "",
|
8
8
|
"PO-Revision-Date": "2016-04-14 07:48+0000",
|
9
9
|
"Last-Translator": "FIRST AUTHOR <EMAIL@ADDRESS>, 2016",
|
@@ -93,7 +93,7 @@
|
|
93
93
|
"By default, remediation is applied to the current host. Optionally, remediate any additional hosts that fail the rule.": [
|
94
94
|
""
|
95
95
|
],
|
96
|
-
"Can't find
|
96
|
+
"Can't find %{packages} RPM(s), are you sure it is installed on your server?": [
|
97
97
|
""
|
98
98
|
],
|
99
99
|
"Cancel": [
|
@@ -10,9 +10,15 @@ class ArfReportsController < ApplicationController
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def index
|
13
|
+
# Avoid using includes() with nested associations and "order by" together. Otherwise,
|
14
|
+
# includes() will use join tables instead and Rails somehow create many objects and
|
15
|
+
# high memory consumption.
|
16
|
+
@arf_reports_pg = resource_base.search_for(params[:search], :order => params[:order])
|
17
|
+
.paginate(:page => params[:page], :per_page => params[:per_page])
|
18
|
+
arf_report_ids = @arf_reports_pg.pluck(:id)
|
13
19
|
@arf_reports = resource_base.includes(:policy, :openscap_proxy, :host => %i[policies last_report_object host_statuses])
|
14
|
-
.
|
15
|
-
.
|
20
|
+
.where(id: arf_report_ids)
|
21
|
+
.sort_by { |arf_report| arf_report_ids.index(arf_report.id) }
|
16
22
|
end
|
17
23
|
|
18
24
|
def show
|
@@ -7,21 +7,28 @@ module ForemanOpenscap
|
|
7
7
|
@result = OpenStruct.new(:errors => [], :results => [])
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
|
10
|
+
def security_guide_packages
|
11
|
+
%w(scap-security-guide)
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
15
|
-
`rpm -
|
14
|
+
def files_from_guide(package)
|
15
|
+
`rpm -ql #{package} | grep ds.xml`.split
|
16
|
+
end
|
17
|
+
|
18
|
+
def package_installed?(package)
|
19
|
+
`rpm -qa | grep #{package}`.present?
|
16
20
|
end
|
17
21
|
|
18
22
|
def upload_from_scap_guide
|
19
|
-
|
20
|
-
|
23
|
+
package = security_guide_packages.find { |p| package_installed? p }
|
24
|
+
unless package
|
25
|
+
joined_packages = security_guide_packages.join(', ')
|
26
|
+
msg = _("Can't find %{packages} RPM(s), are you sure it is installed on your server?")
|
27
|
+
@result.errors.push(msg % {packages: joined_packages})
|
21
28
|
return @result
|
22
29
|
end
|
23
30
|
|
24
|
-
upload_from_files(files_from_guide, true)
|
31
|
+
upload_from_files(files_from_guide(package), true)
|
25
32
|
end
|
26
33
|
|
27
34
|
def upload_from_files(files_array, from_scap_guide = false)
|
@@ -40,7 +40,7 @@ module ForemanOpenscap
|
|
40
40
|
initializer 'foreman_openscap.register_plugin', :before => :finisher_hook do |app|
|
41
41
|
app.reloader.to_prepare do
|
42
42
|
Foreman::Plugin.register :foreman_openscap do
|
43
|
-
requires_foreman '>= 3.
|
43
|
+
requires_foreman '>= 3.14'
|
44
44
|
register_gettext
|
45
45
|
|
46
46
|
apipie_documented_controllers ["#{ForemanOpenscap::Engine.root}/app/controllers/api/v2/compliance/*.rb"]
|
Binary file
|