foreman_openscap 12.0.0 → 12.0.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/javascripts/foreman_openscap/locale/cs_CZ/foreman_openscap.js +1 -1
- data/app/assets/javascripts/foreman_openscap/locale/de/foreman_openscap.js +1 -1
- data/app/assets/javascripts/foreman_openscap/locale/en/foreman_openscap.js +6 -6
- data/app/assets/javascripts/foreman_openscap/locale/en_GB/foreman_openscap.js +1 -1
- data/app/assets/javascripts/foreman_openscap/locale/es/foreman_openscap.js +1 -1
- data/app/assets/javascripts/foreman_openscap/locale/fr/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/gl/foreman_openscap.js +1 -1
- data/app/assets/javascripts/foreman_openscap/locale/it/foreman_openscap.js +1 -1
- data/app/assets/javascripts/foreman_openscap/locale/ja/foreman_openscap.js +3 -3
- data/app/assets/javascripts/foreman_openscap/locale/ka/foreman_openscap.js +1 -1
- data/app/assets/javascripts/foreman_openscap/locale/ko/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/pt_BR/foreman_openscap.js +1 -1
- data/app/assets/javascripts/foreman_openscap/locale/ru/foreman_openscap.js +1 -1
- data/app/assets/javascripts/foreman_openscap/locale/sv_SE/foreman_openscap.js +1 -1
- data/app/assets/javascripts/foreman_openscap/locale/zh_CN/foreman_openscap.js +2 -2
- data/app/assets/javascripts/foreman_openscap/locale/zh_TW/foreman_openscap.js +1 -1
- data/app/controllers/api/v2/compliance/arf_reports_controller.rb +9 -9
- data/app/models/foreman_openscap/arf_report.rb +3 -3
- data/db/migrate/20260218133925_drop_host_policy_assignments_shadowing_hostgroup_policy_assignments.rb +40 -0
- data/lib/foreman_openscap/version.rb +1 -1
- data/locale/cs_CZ/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/cs_CZ/foreman_openscap.po +1 -1
- data/locale/de/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/de/foreman_openscap.po +2 -2
- data/locale/en/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/en/foreman_openscap.po +9 -9
- data/locale/en_GB/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/en_GB/foreman_openscap.po +1 -1
- data/locale/es/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/es/foreman_openscap.po +1 -1
- data/locale/foreman_openscap.pot +11 -11
- data/locale/fr/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/fr/foreman_openscap.po +2 -2
- data/locale/gl/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/gl/foreman_openscap.po +1 -1
- data/locale/it/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/it/foreman_openscap.po +1 -1
- data/locale/ja/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/ja/foreman_openscap.po +3 -3
- data/locale/ka/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/ka/foreman_openscap.po +1 -1
- data/locale/ko/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/ko/foreman_openscap.po +2 -2
- data/locale/pt_BR/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/pt_BR/foreman_openscap.po +1 -1
- data/locale/ru/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/ru/foreman_openscap.po +1 -1
- data/locale/sv_SE/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/sv_SE/foreman_openscap.po +1 -1
- data/locale/zh_CN/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/zh_CN/foreman_openscap.po +2 -2
- data/locale/zh_TW/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/zh_TW/foreman_openscap.po +1 -1
- data/test/functional/api/v2/compliance/arf_reports_controller_test.rb +55 -14
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d6d702c15f10295e783094bf36709e7dfb87725df26fd0bd40cfe3a85516e5d8
|
|
4
|
+
data.tar.gz: df9a4e96688af91ac7841a323e93818c5a09b03bdbcad2990656faed696ecb29
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b91020fb86c158f1314a722be4c72e6f48ef5a845b6854d3d6e47c5a739838bb133ff8f72efdc44f26d47f09fd6e3ee67bcc9a92fb6ac7c50a598a4b2a149812
|
|
7
|
+
data.tar.gz: 62e3c36e54a58d6da6a82d1511c5685f9879dd6110d617163537e1bef81cead7d782776d8bd35b7ba582e8efba1c91e57579bf5764bfdb871765033c7b964aa4
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
7
7
|
"Report-Msgid-Bugs-To": "",
|
|
8
8
|
"PO-Revision-Date": "2016-04-14 07:48+0000",
|
|
9
9
|
"Last-Translator": "Pavel Borecki <pavel.borecki@gmail.com>, 2018-2020",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
7
7
|
"Report-Msgid-Bugs-To": "",
|
|
8
8
|
"PO-Revision-Date": "2016-04-14 07:48+0000",
|
|
9
9
|
"Last-Translator": "pdolinic, 2021",
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
7
7
|
"Report-Msgid-Bugs-To": "",
|
|
8
|
-
"PO-Revision-Date": "
|
|
8
|
+
"PO-Revision-Date": "2026-02-10 13:04+0100",
|
|
9
9
|
"Last-Translator": "FULL NAME <EMAIL@ADDRESS>",
|
|
10
|
-
"Language-Team": "
|
|
11
|
-
"Language": "
|
|
10
|
+
"Language-Team": "LANGUAGE <LL@li.org>",
|
|
11
|
+
"Language": "",
|
|
12
12
|
"MIME-Version": "1.0",
|
|
13
13
|
"Content-Type": "text/plain; charset=UTF-8",
|
|
14
14
|
"Content-Transfer-Encoding": "8bit",
|
|
15
|
-
"Plural-Forms": "nplurals
|
|
15
|
+
"Plural-Forms": "nplurals=INTEGER; plural=EXPRESSION;",
|
|
16
16
|
"lang": "en",
|
|
17
17
|
"domain": "foreman_openscap",
|
|
18
|
-
"plural_forms": "nplurals
|
|
18
|
+
"plural_forms": "nplurals=INTEGER; plural=EXPRESSION;"
|
|
19
19
|
},
|
|
20
20
|
" for policy %s": [
|
|
21
21
|
""
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
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>",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
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",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
7
7
|
"Report-Msgid-Bugs-To": "",
|
|
8
8
|
"PO-Revision-Date": "2016-04-14 07:48+0000",
|
|
9
9
|
"Last-Translator": "Pierre-Emmanuel Dutang <dutangp@gmail.com>, 2016",
|
|
@@ -902,7 +902,7 @@
|
|
|
902
902
|
"Les %{key_name} suivants étaient manquants pour %{item_name} : %{key_names}. Assurez-vous qu'ils aient bien été importés avant de poursuivre."
|
|
903
903
|
],
|
|
904
904
|
"The host was moved or deleted": [
|
|
905
|
-
""
|
|
905
|
+
"L'hôte a été déplacé ou supprimé"
|
|
906
906
|
],
|
|
907
907
|
"The identifier of the host": [
|
|
908
908
|
"Identifiant de l’hôte"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
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>",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
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",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
7
7
|
"Report-Msgid-Bugs-To": "",
|
|
8
8
|
"PO-Revision-Date": "2016-04-14 07:48+0000",
|
|
9
9
|
"Last-Translator": "Kazuki Omo <kazuki.omo@gmail.com>, 2016",
|
|
@@ -900,7 +900,7 @@
|
|
|
900
900
|
"%{item_name} には、以下の %{key_name} がありませんでした: %{key_names}。続行前にインポートされていることを確認してください。"
|
|
901
901
|
],
|
|
902
902
|
"The host was moved or deleted": [
|
|
903
|
-
""
|
|
903
|
+
"ホストが移動または削除されました"
|
|
904
904
|
],
|
|
905
905
|
"The identifier of the host": [
|
|
906
906
|
"ホストの ID"
|
|
@@ -924,7 +924,7 @@
|
|
|
924
924
|
"これにより、foreman_scap_client のセットアップはユーザーにのみ残ります。受信 ARF レポートをリンクするには、ポリシーを定義する必要があります。"
|
|
925
925
|
],
|
|
926
926
|
"This profile will be used to override the one from scap content": [
|
|
927
|
-
"
|
|
927
|
+
"このプロファイルは、scap コンテンツのプロファイルをオーバーライドするために使用されます"
|
|
928
928
|
],
|
|
929
929
|
"Title": [
|
|
930
930
|
"タイトル"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
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>",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
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",
|
|
@@ -900,7 +900,7 @@
|
|
|
900
900
|
"다음은%{key_name}이/가 %{item_name}에 대해 누락되었습니다:%{key_names}. 계속하기 전에 반드시 가져왔는지 확인하세요."
|
|
901
901
|
],
|
|
902
902
|
"The host was moved or deleted": [
|
|
903
|
-
""
|
|
903
|
+
"호스트가 이동되었거나 삭제되었습니다."
|
|
904
904
|
],
|
|
905
905
|
"The identifier of the host": [
|
|
906
906
|
"호스트의 식별자"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
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",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
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",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
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>",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
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",
|
|
@@ -900,7 +900,7 @@
|
|
|
900
900
|
"%{item_name} 缺少以下 %{key_name}:%{key_names}。在继续操作之前,请确保已将其导入。"
|
|
901
901
|
],
|
|
902
902
|
"The host was moved or deleted": [
|
|
903
|
-
""
|
|
903
|
+
"主机被移动或删除"
|
|
904
904
|
],
|
|
905
905
|
"The identifier of the host": [
|
|
906
906
|
"主机 ID"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_openscap": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_openscap
|
|
6
|
+
"Project-Id-Version": "foreman_openscap 12.0.1",
|
|
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",
|
|
@@ -49,8 +49,8 @@ module Api
|
|
|
49
49
|
param :date, :identifier, :required => true
|
|
50
50
|
|
|
51
51
|
def create
|
|
52
|
-
arf_report = ForemanOpenscap::ArfReport.create_arf(@
|
|
53
|
-
@
|
|
52
|
+
arf_report = ForemanOpenscap::ArfReport.create_arf(@host, @smart_proxy, params.to_unsafe_h)
|
|
53
|
+
@host.refresh_statuses([HostStatus.find_status_by_humanized_name("compliance")])
|
|
54
54
|
respond_for_report arf_report
|
|
55
55
|
end
|
|
56
56
|
|
|
@@ -97,20 +97,20 @@ module Api
|
|
|
97
97
|
return
|
|
98
98
|
end
|
|
99
99
|
|
|
100
|
-
@
|
|
100
|
+
@host = ForemanOpenscap::Helper::find_host_by_name_or_uuid(params[:cname])
|
|
101
101
|
|
|
102
|
-
unless @
|
|
102
|
+
unless @host
|
|
103
103
|
upload_fail(_('Could not find host identified by: %s') % params[:cname])
|
|
104
104
|
return
|
|
105
105
|
end
|
|
106
106
|
|
|
107
|
-
if !params[:openscap_proxy_url] && !params[:openscap_proxy_name] && !@
|
|
108
|
-
msg = _('Failed to upload Arf Report, OpenSCAP proxy name or url not found in params when uploading for %s and host is missing openscap_proxy') % @
|
|
107
|
+
if !params[:openscap_proxy_url] && !params[:openscap_proxy_name] && !@host.openscap_proxy
|
|
108
|
+
msg = _('Failed to upload Arf Report, OpenSCAP proxy name or url not found in params when uploading for %s and host is missing openscap_proxy') % @host.name
|
|
109
109
|
upload_fail(msg)
|
|
110
110
|
return
|
|
111
|
-
elsif !params[:openscap_proxy_url] && !params[:openscap_proxy_name] && @
|
|
112
|
-
logger.debug 'No proxy params found when uploading arf report, falling back to
|
|
113
|
-
@smart_proxy = @
|
|
111
|
+
elsif !params[:openscap_proxy_url] && !params[:openscap_proxy_name] && @host.openscap_proxy
|
|
112
|
+
logger.debug 'No proxy params found when uploading arf report, falling back to host.openscap_proxy'
|
|
113
|
+
@smart_proxy = @host.openscap_proxy
|
|
114
114
|
else
|
|
115
115
|
@smart_proxy = SmartProxy.unscoped.find_by :name => params[:openscap_proxy_name]
|
|
116
116
|
@smart_proxy ||= SmartProxy.unscoped.find_by :url => params[:openscap_proxy_url]
|
|
@@ -107,13 +107,13 @@ module ForemanOpenscap
|
|
|
107
107
|
status.values.sum
|
|
108
108
|
end
|
|
109
109
|
|
|
110
|
-
def self.create_arf(
|
|
110
|
+
def self.create_arf(host, proxy, params)
|
|
111
111
|
arf_report = nil
|
|
112
112
|
policy = Policy.find_by :id => params[:policy_id]
|
|
113
113
|
return unless policy
|
|
114
114
|
|
|
115
115
|
ArfReport.transaction do
|
|
116
|
-
arf_report = ArfReport.create(:host =>
|
|
116
|
+
arf_report = ArfReport.create(:host => host,
|
|
117
117
|
:reported_at => Time.at(params[:date].to_i),
|
|
118
118
|
:status => params[:metrics],
|
|
119
119
|
:metrics => params[:metrics],
|
|
@@ -230,7 +230,7 @@ module ForemanOpenscap
|
|
|
230
230
|
def self.fixes(raw_fixes)
|
|
231
231
|
return if raw_fixes.empty?
|
|
232
232
|
|
|
233
|
-
JSON.
|
|
233
|
+
JSON.generate(raw_fixes)
|
|
234
234
|
end
|
|
235
235
|
|
|
236
236
|
def self.update_msg_with_changes(msg, incoming_data)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
class DropHostPolicyAssignmentsShadowingHostgroupPolicyAssignments < ActiveRecord::Migration[7.0]
|
|
2
|
+
def up
|
|
3
|
+
ForemanOpenscap::Asset.where(assetable_type: 'Hostgroup').joins(:asset_policies).find_each do |hg_asset|
|
|
4
|
+
hostgroup = hg_asset.hostgroup
|
|
5
|
+
next if hostgroup.nil?
|
|
6
|
+
|
|
7
|
+
# Take all policies assigned to the hostgroup
|
|
8
|
+
policy_ids = hg_asset.asset_policies.pluck(:policy_id)
|
|
9
|
+
|
|
10
|
+
# Take ids of the hostgroup and all its children, all of these provide the policies extracted above
|
|
11
|
+
hostgroup_ids = hostgroup.subtree_ids
|
|
12
|
+
|
|
13
|
+
# Find hosts which are assigned to the hostgroup or its descendants, the hostgroup provides its policies to all of those
|
|
14
|
+
host_subselect = Host.where(hostgroup_id: hostgroup_ids)
|
|
15
|
+
|
|
16
|
+
# Take all the hosts which have direct association with a policy that is already provided by their hostgroup
|
|
17
|
+
scope = ForemanOpenscap::AssetPolicy.joins(:asset).joins(:policy)
|
|
18
|
+
.where(asset: { assetable_type: 'Host::Base', assetable_id: host_subselect })
|
|
19
|
+
.where(policy_id: policy_ids)
|
|
20
|
+
|
|
21
|
+
scope.pluck(:asset_id, :policy_id).each_slice(1000) do |asset_id_policy_id_pairs|
|
|
22
|
+
# Composite primary keys are supported in rails >=7.1, since we're on 7.0, raw SQL will have to do.
|
|
23
|
+
connection = ActiveRecord::Base.connection
|
|
24
|
+
tuples_sql = asset_id_policy_id_pairs.map { |asset_id, policy_id|
|
|
25
|
+
"(#{connection.quote(asset_id)}, #{connection.quote(policy_id)})"
|
|
26
|
+
}.join(', ')
|
|
27
|
+
connection.execute("DELETE FROM foreman_openscap_asset_policies WHERE (asset_id, policy_id) IN (#{tuples_sql})")
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Prune host assets which do not have any policies assigned to them
|
|
32
|
+
scope = ForemanOpenscap::Asset.where(assetable_type: 'Host::Base').left_outer_joins(:asset_policies)
|
|
33
|
+
scope = scope.where('foreman_openscap_asset_policies.asset_id IS NULL')
|
|
34
|
+
# ForemanOpenscap::Asset has :dependent => :delete_all callback on asset_policies, but since we're pruning assets which don't have any asset_policies, we don't need the callback
|
|
35
|
+
scope.delete_all
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def down
|
|
39
|
+
end
|
|
40
|
+
end
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# Pavel Borecki <pavel.borecki@gmail.com>, 2018-2020
|
|
7
7
|
msgid ""
|
|
8
8
|
msgstr ""
|
|
9
|
-
"Project-Id-Version: foreman_openscap
|
|
9
|
+
"Project-Id-Version: foreman_openscap 12.0.1\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
11
|
"PO-Revision-Date: 2016-04-14 07:48+0000\n"
|
|
12
12
|
"Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>, 2018-2020\n"
|
|
Binary file
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
# This file is distributed under the same license as the foreman_openscap package.
|
|
4
4
|
#
|
|
5
5
|
# Translators:
|
|
6
|
-
#
|
|
6
|
+
# Alexander Stoll <Alexander.Stoll@netways.de>, 2019
|
|
7
7
|
# Ettore Atalan <atalanttore@googlemail.com>, 2016-2017
|
|
8
8
|
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016
|
|
9
9
|
# Ludwig B <lbayerlein@lbayerlein.de>, 2020
|
|
10
10
|
# pdolinic, 2021
|
|
11
11
|
msgid ""
|
|
12
12
|
msgstr ""
|
|
13
|
-
"Project-Id-Version: foreman_openscap
|
|
13
|
+
"Project-Id-Version: foreman_openscap 12.0.1\n"
|
|
14
14
|
"Report-Msgid-Bugs-To: \n"
|
|
15
15
|
"PO-Revision-Date: 2016-04-14 07:48+0000\n"
|
|
16
16
|
"Last-Translator: pdolinic, 2021\n"
|
|
Binary file
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Copyright (C)
|
|
1
|
+
# SOME DESCRIPTIVE TITLE.
|
|
2
|
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
3
|
# This file is distributed under the same license as the foreman_openscap package.
|
|
4
|
-
# FIRST AUTHOR <EMAIL@ADDRESS>,
|
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
5
5
|
#
|
|
6
|
+
#, fuzzy
|
|
6
7
|
msgid ""
|
|
7
8
|
msgstr ""
|
|
8
|
-
"Project-Id-Version: foreman_openscap
|
|
9
|
+
"Project-Id-Version: foreman_openscap 12.0.1\n"
|
|
9
10
|
"Report-Msgid-Bugs-To: \n"
|
|
10
|
-
"PO-Revision-Date:
|
|
11
|
+
"PO-Revision-Date: 2026-02-10 13:04+0100\n"
|
|
11
12
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
12
|
-
"Language-Team:
|
|
13
|
-
"Language:
|
|
13
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
14
|
+
"Language: \n"
|
|
14
15
|
"MIME-Version: 1.0\n"
|
|
15
16
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
16
17
|
"Content-Transfer-Encoding: 8bit\n"
|
|
17
|
-
"Plural-Forms: nplurals
|
|
18
|
-
"\n"
|
|
18
|
+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
|
19
19
|
|
|
20
20
|
msgid " for policy %s"
|
|
21
21
|
msgstr ""
|
|
Binary file
|
|
Binary file
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016
|
|
8
8
|
msgid ""
|
|
9
9
|
msgstr ""
|
|
10
|
-
"Project-Id-Version: foreman_openscap
|
|
10
|
+
"Project-Id-Version: foreman_openscap 12.0.1\n"
|
|
11
11
|
"Report-Msgid-Bugs-To: \n"
|
|
12
12
|
"PO-Revision-Date: 2016-04-14 07:48+0000\n"
|
|
13
13
|
"Last-Translator: FIRST AUTHOR <EMAIL@ADDRESS>, 2016\n"
|
data/locale/foreman_openscap.pot
CHANGED
|
@@ -8,8 +8,8 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: foreman_openscap 1.0.0\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-
|
|
12
|
-
"PO-Revision-Date: 2025-
|
|
11
|
+
"POT-Creation-Date: 2025-10-08 11:04+0000\n"
|
|
12
|
+
"PO-Revision-Date: 2025-10-08 11:04+0000\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
15
15
|
"Language: \n"
|
|
@@ -239,39 +239,39 @@ msgstr ""
|
|
|
239
239
|
msgid "Deletes a Tailoring file"
|
|
240
240
|
msgstr ""
|
|
241
241
|
|
|
242
|
-
#: ../app/controllers/arf_reports_controller.rb:
|
|
242
|
+
#: ../app/controllers/arf_reports_controller.rb:42
|
|
243
243
|
msgid "Failed to downloaded ARF report as bzip: %s"
|
|
244
244
|
msgstr ""
|
|
245
245
|
|
|
246
|
-
#: ../app/controllers/arf_reports_controller.rb:
|
|
246
|
+
#: ../app/controllers/arf_reports_controller.rb:53
|
|
247
247
|
msgid "Failed to downloaded ARF report in HTML: %s"
|
|
248
248
|
msgstr ""
|
|
249
249
|
|
|
250
|
-
#: ../app/controllers/arf_reports_controller.rb:
|
|
250
|
+
#: ../app/controllers/arf_reports_controller.rb:60
|
|
251
251
|
msgid "Successfully deleted ARF report."
|
|
252
252
|
msgstr ""
|
|
253
253
|
|
|
254
|
-
#: ../app/controllers/arf_reports_controller.rb:
|
|
254
|
+
#: ../app/controllers/arf_reports_controller.rb:62
|
|
255
255
|
msgid "Failed to delete ARF Report for host %{host_name} reported at %{reported_at}"
|
|
256
256
|
msgstr ""
|
|
257
257
|
|
|
258
|
-
#: ../app/controllers/arf_reports_controller.rb:
|
|
258
|
+
#: ../app/controllers/arf_reports_controller.rb:72
|
|
259
259
|
msgid "Failed to delete %s compliance reports"
|
|
260
260
|
msgstr ""
|
|
261
261
|
|
|
262
|
-
#: ../app/controllers/arf_reports_controller.rb:
|
|
262
|
+
#: ../app/controllers/arf_reports_controller.rb:75
|
|
263
263
|
msgid "Successfully deleted %s compliance reports"
|
|
264
264
|
msgstr ""
|
|
265
265
|
|
|
266
|
-
#: ../app/controllers/arf_reports_controller.rb:
|
|
266
|
+
#: ../app/controllers/arf_reports_controller.rb:111
|
|
267
267
|
msgid "No compliance reports were found."
|
|
268
268
|
msgstr ""
|
|
269
269
|
|
|
270
|
-
#: ../app/controllers/arf_reports_controller.rb:
|
|
270
|
+
#: ../app/controllers/arf_reports_controller.rb:115
|
|
271
271
|
msgid "No compliance reports selected"
|
|
272
272
|
msgstr ""
|
|
273
273
|
|
|
274
|
-
#: ../app/controllers/arf_reports_controller.rb:
|
|
274
|
+
#: ../app/controllers/arf_reports_controller.rb:120
|
|
275
275
|
msgid "Something went wrong while selecting compliance reports - %s"
|
|
276
276
|
msgstr ""
|
|
277
277
|
|
|
Binary file
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
# Pierre-Emmanuel Dutang <dutangp@gmail.com>, 2016
|
|
9
9
|
msgid ""
|
|
10
10
|
msgstr ""
|
|
11
|
-
"Project-Id-Version: foreman_openscap
|
|
11
|
+
"Project-Id-Version: foreman_openscap 12.0.1\n"
|
|
12
12
|
"Report-Msgid-Bugs-To: \n"
|
|
13
13
|
"PO-Revision-Date: 2016-04-14 07:48+0000\n"
|
|
14
14
|
"Last-Translator: Pierre-Emmanuel Dutang <dutangp@gmail.com>, 2016\n"
|
|
@@ -921,7 +921,7 @@ msgid "The following %{key_name} were missing for %{item_name}: %{key_names}. Ma
|
|
|
921
921
|
msgstr "Les %{key_name} suivants étaient manquants pour %{item_name} : %{key_names}. Assurez-vous qu'ils aient bien été importés avant de poursuivre."
|
|
922
922
|
|
|
923
923
|
msgid "The host was moved or deleted"
|
|
924
|
-
msgstr ""
|
|
924
|
+
msgstr "L'hôte a été déplacé ou supprimé"
|
|
925
925
|
|
|
926
926
|
msgid "The identifier of the host"
|
|
927
927
|
msgstr "Identifiant de l’hôte"
|
|
Binary file
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016
|
|
7
7
|
msgid ""
|
|
8
8
|
msgstr ""
|
|
9
|
-
"Project-Id-Version: foreman_openscap
|
|
9
|
+
"Project-Id-Version: foreman_openscap 12.0.1\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
11
|
"PO-Revision-Date: 2016-04-14 07:48+0000\n"
|
|
12
12
|
"Last-Translator: FIRST AUTHOR <EMAIL@ADDRESS>, 2016\n"
|
|
Binary file
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# Kazuki Omo <kazuki.omo@gmail.com>, 2016
|
|
8
8
|
msgid ""
|
|
9
9
|
msgstr ""
|
|
10
|
-
"Project-Id-Version: foreman_openscap
|
|
10
|
+
"Project-Id-Version: foreman_openscap 12.0.1\n"
|
|
11
11
|
"Report-Msgid-Bugs-To: \n"
|
|
12
12
|
"PO-Revision-Date: 2016-04-14 07:48+0000\n"
|
|
13
13
|
"Last-Translator: Kazuki Omo <kazuki.omo@gmail.com>, 2016\n"
|
|
@@ -918,7 +918,7 @@ msgid "The following %{key_name} were missing for %{item_name}: %{key_names}. Ma
|
|
|
918
918
|
msgstr "%{item_name} には、以下の %{key_name} がありませんでした: %{key_names}。続行前にインポートされていることを確認してください。"
|
|
919
919
|
|
|
920
920
|
msgid "The host was moved or deleted"
|
|
921
|
-
msgstr ""
|
|
921
|
+
msgstr "ホストが移動または削除されました"
|
|
922
922
|
|
|
923
923
|
msgid "The identifier of the host"
|
|
924
924
|
msgstr "ホストの ID"
|
|
@@ -942,7 +942,7 @@ msgid "This leaves the setup of the foreman_scap_client solely on the user. The
|
|
|
942
942
|
msgstr "これにより、foreman_scap_client のセットアップはユーザーにのみ残ります。受信 ARF レポートをリンクするには、ポリシーを定義する必要があります。"
|
|
943
943
|
|
|
944
944
|
msgid "This profile will be used to override the one from scap content"
|
|
945
|
-
msgstr "
|
|
945
|
+
msgstr "このプロファイルは、scap コンテンツのプロファイルをオーバーライドするために使用されます"
|
|
946
946
|
|
|
947
947
|
msgid "Title"
|
|
948
948
|
msgstr "タイトル"
|
|
Binary file
|
|
Binary file
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016
|
|
8
8
|
msgid ""
|
|
9
9
|
msgstr ""
|
|
10
|
-
"Project-Id-Version: foreman_openscap
|
|
10
|
+
"Project-Id-Version: foreman_openscap 12.0.1\n"
|
|
11
11
|
"Report-Msgid-Bugs-To: \n"
|
|
12
12
|
"PO-Revision-Date: 2016-04-14 07:48+0000\n"
|
|
13
13
|
"Last-Translator: FIRST AUTHOR <EMAIL@ADDRESS>, 2016\n"
|
|
@@ -911,7 +911,7 @@ msgid "The following %{key_name} were missing for %{item_name}: %{key_names}. Ma
|
|
|
911
911
|
msgstr "다음은%{key_name}이/가 %{item_name}에 대해 누락되었습니다:%{key_names}. 계속하기 전에 반드시 가져왔는지 확인하세요."
|
|
912
912
|
|
|
913
913
|
msgid "The host was moved or deleted"
|
|
914
|
-
msgstr ""
|
|
914
|
+
msgstr "호스트가 이동되었거나 삭제되었습니다."
|
|
915
915
|
|
|
916
916
|
msgid "The identifier of the host"
|
|
917
917
|
msgstr "호스트의 식별자"
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016
|
|
7
7
|
msgid ""
|
|
8
8
|
msgstr ""
|
|
9
|
-
"Project-Id-Version: foreman_openscap
|
|
9
|
+
"Project-Id-Version: foreman_openscap 12.0.1\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
11
|
"PO-Revision-Date: 2016-04-14 07:48+0000\n"
|
|
12
12
|
"Last-Translator: FIRST AUTHOR <EMAIL@ADDRESS>, 2016\n"
|
|
Binary file
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# Yulia <yulia.poyarkova@redhat.com>, 2016
|
|
8
8
|
msgid ""
|
|
9
9
|
msgstr ""
|
|
10
|
-
"Project-Id-Version: foreman_openscap
|
|
10
|
+
"Project-Id-Version: foreman_openscap 12.0.1\n"
|
|
11
11
|
"Report-Msgid-Bugs-To: \n"
|
|
12
12
|
"PO-Revision-Date: 2016-04-14 07:48+0000\n"
|
|
13
13
|
"Last-Translator: FIRST AUTHOR <EMAIL@ADDRESS>, 2016\n"
|
|
Binary file
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016
|
|
7
7
|
msgid ""
|
|
8
8
|
msgstr ""
|
|
9
|
-
"Project-Id-Version: foreman_openscap
|
|
9
|
+
"Project-Id-Version: foreman_openscap 12.0.1\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
11
|
"PO-Revision-Date: 2016-04-14 07:48+0000\n"
|
|
12
12
|
"Last-Translator: FIRST AUTHOR <EMAIL@ADDRESS>, 2016\n"
|
|
@@ -917,7 +917,7 @@ msgid "The following %{key_name} were missing for %{item_name}: %{key_names}. Ma
|
|
|
917
917
|
msgstr "%{item_name} 缺少以下 %{key_name}:%{key_names}。在继续操作之前,请确保已将其导入。"
|
|
918
918
|
|
|
919
919
|
msgid "The host was moved or deleted"
|
|
920
|
-
msgstr ""
|
|
920
|
+
msgstr "主机被移动或删除"
|
|
921
921
|
|
|
922
922
|
msgid "The identifier of the host"
|
|
923
923
|
msgstr "主机 ID"
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016
|
|
7
7
|
msgid ""
|
|
8
8
|
msgstr ""
|
|
9
|
-
"Project-Id-Version: foreman_openscap
|
|
9
|
+
"Project-Id-Version: foreman_openscap 12.0.1\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
11
|
"PO-Revision-Date: 2016-04-14 07:48+0000\n"
|
|
12
12
|
"Last-Translator: FIRST AUTHOR <EMAIL@ADDRESS>, 2016\n"
|
|
@@ -46,7 +46,7 @@ class Api::V2::Compliance::ArfReportsControllerTest < ActionController::TestCase
|
|
|
46
46
|
test "should create report using proxy name" do
|
|
47
47
|
reports_cleanup
|
|
48
48
|
date = Time.new(1984, 9, 15)
|
|
49
|
-
ForemanOpenscap::Helper.stubs(:
|
|
49
|
+
ForemanOpenscap::Helper.stubs(:find_host_by_name_or_uuid).returns(@host)
|
|
50
50
|
post :create,
|
|
51
51
|
:params => @from_json.merge(:cname => @cname,
|
|
52
52
|
:policy_id => @policy.id,
|
|
@@ -65,7 +65,8 @@ class Api::V2::Compliance::ArfReportsControllerTest < ActionController::TestCase
|
|
|
65
65
|
test "should create report using proxy url" do
|
|
66
66
|
reports_cleanup
|
|
67
67
|
date = Time.new(1984, 9, 15)
|
|
68
|
-
ForemanOpenscap::Helper.stubs(:
|
|
68
|
+
ForemanOpenscap::Helper.stubs(:find_host_by_name_or_uuid).returns(@host)
|
|
69
|
+
@host.stubs(:openscap_proxy).returns(nil)
|
|
69
70
|
post :create,
|
|
70
71
|
:params => @from_json.merge(:cname => @cname,
|
|
71
72
|
:policy_id => @policy.id,
|
|
@@ -75,10 +76,35 @@ class Api::V2::Compliance::ArfReportsControllerTest < ActionController::TestCase
|
|
|
75
76
|
assert_response :success
|
|
76
77
|
end
|
|
77
78
|
|
|
79
|
+
test "should not create host asset but tie report to hostgroup policy when policy is from hostgroup" do
|
|
80
|
+
policy = FactoryBot.create(:policy)
|
|
81
|
+
hostgroup = FactoryBot.create(:hostgroup, :openscap_proxy => @proxy)
|
|
82
|
+
host = FactoryBot.create(:host, :hostgroup_id => hostgroup.id)
|
|
83
|
+
hostgroup_asset = FactoryBot.create(:asset, :assetable_id => hostgroup.id, :assetable_type => 'Hostgroup', policies: [policy])
|
|
84
|
+
|
|
85
|
+
date = Time.new(1984, 9, 15)
|
|
86
|
+
post :create,
|
|
87
|
+
:params => @from_json.merge(:cname => host.name,
|
|
88
|
+
:policy_id => policy.id,
|
|
89
|
+
:date => date.to_i,
|
|
90
|
+
:openscap_proxy_name => @proxy.name),
|
|
91
|
+
:session => set_session_user
|
|
92
|
+
|
|
93
|
+
assert_response :success
|
|
94
|
+
|
|
95
|
+
User.current = users(:admin)
|
|
96
|
+
host_asset = ForemanOpenscap::Asset.find_by(:assetable_type => 'Host::Base', :assetable_id => host.id)
|
|
97
|
+
assert_nil host_asset, 'Host-level asset should not be created when ARF report is uploaded for host with policy from hostgroup'
|
|
98
|
+
|
|
99
|
+
report = ForemanOpenscap::ArfReport.find_by(:host_id => host.id)
|
|
100
|
+
assert report
|
|
101
|
+
assert_equal policy.id, report.policy.id
|
|
102
|
+
end
|
|
103
|
+
|
|
78
104
|
test "should not create report when no proxy params present" do
|
|
79
|
-
asset = FactoryBot.create(:asset)
|
|
80
105
|
date = Time.new(1944, 6, 6)
|
|
81
|
-
ForemanOpenscap::Helper.stubs(:
|
|
106
|
+
ForemanOpenscap::Helper.stubs(:find_host_by_name_or_uuid).returns(@host)
|
|
107
|
+
@host.stubs(:openscap_proxy).returns(nil)
|
|
82
108
|
post :create,
|
|
83
109
|
:params => @from_json.merge(:cname => @cname,
|
|
84
110
|
:policy_id => @policy.id,
|
|
@@ -86,7 +112,7 @@ class Api::V2::Compliance::ArfReportsControllerTest < ActionController::TestCase
|
|
|
86
112
|
:session => set_session_user
|
|
87
113
|
assert_response :unprocessable_entity
|
|
88
114
|
res = JSON.parse(@response.body)
|
|
89
|
-
msg = "Failed to upload Arf Report, OpenSCAP proxy name or url not found in params when uploading for #{
|
|
115
|
+
msg = "Failed to upload Arf Report, OpenSCAP proxy name or url not found in params when uploading for #{@host.name} and host is missing openscap_proxy"
|
|
90
116
|
assert_equal msg, res["errors"]
|
|
91
117
|
end
|
|
92
118
|
|
|
@@ -130,9 +156,9 @@ class Api::V2::Compliance::ArfReportsControllerTest < ActionController::TestCase
|
|
|
130
156
|
params = @from_json.with_indifferent_access.merge(:cname => @cname,
|
|
131
157
|
:policy_id => @policy.id,
|
|
132
158
|
:date => dates[0].to_i)
|
|
133
|
-
assert ForemanOpenscap::ArfReport.create_arf(@
|
|
159
|
+
assert ForemanOpenscap::ArfReport.create_arf(@host, @proxy, params)
|
|
134
160
|
|
|
135
|
-
ForemanOpenscap::Helper.stubs(:
|
|
161
|
+
ForemanOpenscap::Helper.stubs(:find_host_by_name_or_uuid).returns(@host)
|
|
136
162
|
post :create,
|
|
137
163
|
:params => @from_json.merge(:cname => @cname,
|
|
138
164
|
:policy_id => @policy.id,
|
|
@@ -146,9 +172,9 @@ class Api::V2::Compliance::ArfReportsControllerTest < ActionController::TestCase
|
|
|
146
172
|
params = @from_json.with_indifferent_access.merge(:cname => @cname,
|
|
147
173
|
:policy_id => @policy.id,
|
|
148
174
|
:date => Time.new(2017, 5, 6).to_i)
|
|
149
|
-
assert ForemanOpenscap::ArfReport.create_arf(@
|
|
175
|
+
assert ForemanOpenscap::ArfReport.create_arf(@host, @proxy, params)
|
|
150
176
|
|
|
151
|
-
ForemanOpenscap::Helper.stubs(:
|
|
177
|
+
ForemanOpenscap::Helper.stubs(:find_host_by_name_or_uuid).returns(@host)
|
|
152
178
|
changed_from_json = arf_from_json "#{ForemanOpenscap::Engine.root}/test/files/arf_report/arf_report_msg_desc_changed.json"
|
|
153
179
|
post :create,
|
|
154
180
|
:params => changed_from_json.merge(:cname => @cname,
|
|
@@ -172,9 +198,9 @@ class Api::V2::Compliance::ArfReportsControllerTest < ActionController::TestCase
|
|
|
172
198
|
params = @from_json.with_indifferent_access.merge(:cname => @cname,
|
|
173
199
|
:policy_id => @policy.id,
|
|
174
200
|
:date => Time.new(2017, 7, 6).to_i)
|
|
175
|
-
assert ForemanOpenscap::ArfReport.create_arf(@
|
|
201
|
+
assert ForemanOpenscap::ArfReport.create_arf(@host, @proxy, params)
|
|
176
202
|
|
|
177
|
-
ForemanOpenscap::Helper.stubs(:
|
|
203
|
+
ForemanOpenscap::Helper.stubs(:find_host_by_name_or_uuid).returns(@host)
|
|
178
204
|
changed_from_json = arf_from_json "#{ForemanOpenscap::Engine.root}/test/files/arf_report/arf_report_msg_value_changed.json"
|
|
179
205
|
post :create,
|
|
180
206
|
:params => changed_from_json.merge(:cname => @cname,
|
|
@@ -447,17 +473,32 @@ class Api::V2::Compliance::ArfReportsControllerTest < ActionController::TestCase
|
|
|
447
473
|
get :index, :params => { :order => "compliance_failed DESC" }, :session => set_session_user
|
|
448
474
|
assert_response :success
|
|
449
475
|
response = ActiveSupport::JSON.decode(@response.body)
|
|
450
|
-
assert_equal 7, response['results'].
|
|
476
|
+
assert_equal [7, 1, 0, 0], response['results'].map { |r| r['failed'] }
|
|
477
|
+
|
|
478
|
+
get :index, :params => { :order => "compliance_failed ASC" }, :session => set_session_user
|
|
479
|
+
assert_response :success
|
|
480
|
+
response = ActiveSupport::JSON.decode(@response.body)
|
|
481
|
+
assert_equal [0, 0, 1, 7], response['results'].map { |r| r['failed'] }
|
|
451
482
|
|
|
452
483
|
get :index, :params => { :order => "compliance_passed DESC" }, :session => set_session_user
|
|
453
484
|
assert_response :success
|
|
454
485
|
response = ActiveSupport::JSON.decode(@response.body)
|
|
455
|
-
assert_equal 15, response['results'].
|
|
486
|
+
assert_equal [15, 4, 2, 1], response['results'].map { |r| r['passed'] }
|
|
487
|
+
|
|
488
|
+
get :index, :params => { :order => "compliance_passed ASC" }, :session => set_session_user
|
|
489
|
+
assert_response :success
|
|
490
|
+
response = ActiveSupport::JSON.decode(@response.body)
|
|
491
|
+
assert_equal [1, 2, 4, 15], response['results'].map { |r| r['passed'] }
|
|
456
492
|
|
|
457
493
|
get :index, :params => { :order => "compliance_othered DESC" }, :session => set_session_user
|
|
458
494
|
assert_response :success
|
|
459
495
|
response = ActiveSupport::JSON.decode(@response.body)
|
|
460
|
-
assert_equal 9, response['results'].
|
|
496
|
+
assert_equal [9, 3, 0, 0], response['results'].map { |r| r['othered'] }
|
|
497
|
+
|
|
498
|
+
get :index, :params => { :order => "compliance_othered ASC" }, :session => set_session_user
|
|
499
|
+
assert_response :success
|
|
500
|
+
response = ActiveSupport::JSON.decode(@response.body)
|
|
501
|
+
assert_equal [0, 0, 3, 9], response['results'].map { |r| r['othered'] }
|
|
461
502
|
end
|
|
462
503
|
|
|
463
504
|
private
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_openscap
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 12.0.
|
|
4
|
+
version: 12.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- slukasik@redhat.com
|
|
@@ -296,6 +296,7 @@ files:
|
|
|
296
296
|
- db/migrate/20240313111822_drop_oval.rb
|
|
297
297
|
- db/migrate/20240426143215_remove_orphaned_asset_policies.rb
|
|
298
298
|
- db/migrate/20240617105409_remove_oval_permissions.rb
|
|
299
|
+
- db/migrate/20260218133925_drop_host_policy_assignments_shadowing_hostgroup_policy_assignments.rb
|
|
299
300
|
- db/seeds.d/75-job_templates.rb
|
|
300
301
|
- db/seeds.d/openscap_feature.rb
|
|
301
302
|
- db/seeds.d/openscap_policy_notification.rb
|
|
@@ -451,7 +452,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
451
452
|
- !ruby/object:Gem::Version
|
|
452
453
|
version: '0'
|
|
453
454
|
requirements: []
|
|
454
|
-
rubygems_version:
|
|
455
|
+
rubygems_version: 4.0.3
|
|
455
456
|
specification_version: 4
|
|
456
457
|
summary: Foreman plug-in for displaying OpenSCAP audit reports
|
|
457
458
|
test_files:
|