foreman_openscap 7.0.0 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_openscap/locale/cs_CZ/foreman_openscap.js +3 -3
  3. data/app/assets/javascripts/foreman_openscap/locale/de/foreman_openscap.js +3 -3
  4. data/app/assets/javascripts/foreman_openscap/locale/en/foreman_openscap.js +3 -3
  5. data/app/assets/javascripts/foreman_openscap/locale/en_GB/foreman_openscap.js +3 -3
  6. data/app/assets/javascripts/foreman_openscap/locale/es/foreman_openscap.js +3 -3
  7. data/app/assets/javascripts/foreman_openscap/locale/fr/foreman_openscap.js +3 -3
  8. data/app/assets/javascripts/foreman_openscap/locale/gl/foreman_openscap.js +3 -3
  9. data/app/assets/javascripts/foreman_openscap/locale/it/foreman_openscap.js +3 -3
  10. data/app/assets/javascripts/foreman_openscap/locale/ja/foreman_openscap.js +3 -3
  11. data/app/assets/javascripts/foreman_openscap/locale/ko/foreman_openscap.js +3 -3
  12. data/app/assets/javascripts/foreman_openscap/locale/pt_BR/foreman_openscap.js +3 -3
  13. data/app/assets/javascripts/foreman_openscap/locale/ru/foreman_openscap.js +3 -3
  14. data/app/assets/javascripts/foreman_openscap/locale/sv_SE/foreman_openscap.js +3 -3
  15. data/app/assets/javascripts/foreman_openscap/locale/zh_CN/foreman_openscap.js +3 -3
  16. data/app/assets/javascripts/foreman_openscap/locale/zh_TW/foreman_openscap.js +3 -3
  17. data/app/controllers/api/v2/compliance/arf_reports_controller.rb +2 -1
  18. data/app/controllers/policies_controller.rb +10 -5
  19. data/app/controllers/tailoring_files_controller.rb +3 -0
  20. data/app/helpers/foreman_openscap_helper.rb +11 -8
  21. data/app/helpers/policies_helper.rb +2 -0
  22. data/app/views/arf_reports/show.html.erb +0 -1
  23. data/app/views/arf_reports/welcome.html.erb +1 -1
  24. data/app/views/compliance_hosts/show.html.erb +1 -1
  25. data/app/views/policies/index.html.erb +1 -1
  26. data/app/views/policies/steps/_deployment_options_form.html.erb +1 -1
  27. data/app/views/policies/steps/_policy_attributes_form.html.erb +1 -1
  28. data/app/views/policies/steps/_schedule_form.html.erb +8 -4
  29. data/app/views/policy_dashboard/index.html.erb +1 -1
  30. data/app/views/scap_contents/index.html.erb +1 -1
  31. data/app/views/tailoring_files/index.html.erb +1 -1
  32. data/lib/foreman_openscap/version.rb +1 -1
  33. data/locale/cs_CZ/foreman_openscap.edit.po +27 -27
  34. data/locale/de/foreman_openscap.edit.po +27 -27
  35. data/locale/en/foreman_openscap.edit.po +27 -27
  36. data/locale/en_GB/foreman_openscap.edit.po +27 -27
  37. data/locale/es/foreman_openscap.edit.po +27 -27
  38. data/locale/foreman_openscap.pot +29 -29
  39. data/locale/fr/foreman_openscap.edit.po +27 -27
  40. data/locale/gl/foreman_openscap.edit.po +27 -27
  41. data/locale/it/foreman_openscap.edit.po +27 -27
  42. data/locale/ja/foreman_openscap.edit.po +27 -27
  43. data/locale/ko/foreman_openscap.edit.po +27 -27
  44. data/locale/pt_BR/foreman_openscap.edit.po +27 -27
  45. data/locale/ru/foreman_openscap.edit.po +27 -27
  46. data/locale/sv_SE/foreman_openscap.edit.po +27 -27
  47. data/locale/zh_CN/foreman_openscap.edit.po +27 -27
  48. data/locale/zh_TW/foreman_openscap.edit.po +27 -27
  49. data/package.json +0 -3
  50. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32e523ca94995efeb93913ed51fe844b7cd35f13cdd97f5d36950652ffb4be59
4
- data.tar.gz: bfbcdacdc4ea2d64b2bb93c77704795418138f3fa8214957294e58035db13277
3
+ metadata.gz: 16941921f85d0e28984ca4553bd6d691759e010361d85c594f73b1c9990472e3
4
+ data.tar.gz: '091fee372a66387cc96005e4efd52c913bcd16c64a1551168f387c21c3d647d1'
5
5
  SHA512:
6
- metadata.gz: b8b01c48d281d7c971838cc4ee217beb8d17e453f7878befa26e43542f27241b51a89cdb13e4c62e2411c56d4b9eb8a46cb433b22b69b6c58893d4ad602d3339
7
- data.tar.gz: 520bdecd037730e7925f55ab3e5cd0f11ebb694663c6a1190ac13c815fbcb3e74829f7f05f12363585bb7ba28e9bff7f678d2c8e9449314715a30e509b9d64ea
6
+ metadata.gz: a655fefe13951aa0716620f8ea16bec4c3e1c0977a2b8b959b4c65440f396da48cc2b0179903d60cc8647672727de2a906bd74f3857eaa68f04c8d7205c82b80
7
+ data.tar.gz: 1be53b5c854a5b3ef1edf6134337d742a4458b247306ff57ffce373525474f5c4503fa713b11c2e178d891b34355cdd518ffc7f5975ae5390071ab277a5e408d
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  ""
433
433
  ],
434
- "documentation": [
435
- ""
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  ""
439
436
  ],
@@ -919,6 +916,9 @@
919
916
  "Please make sure you understand them by reading our": [
920
917
  ""
921
918
  ],
919
+ "documentation": [
920
+ ""
921
+ ],
922
922
  "Choose day in month": [
923
923
  ""
924
924
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  "Host ist gelöscht"
433
433
  ],
434
- "documentation": [
435
- "Dokumentation"
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  "Vorhandenen SCAP-Inhalt auswählen"
439
436
  ],
@@ -919,6 +916,9 @@
919
916
  "Please make sure you understand them by reading our": [
920
917
  "Bitte stellen Sie sicher, dass Sie sie verstanden haben, indem Sie unsere lesen "
921
918
  ],
919
+ "documentation": [
920
+ "Dokumentation"
921
+ ],
922
922
  "Choose day in month": [
923
923
  "Wähle einen Tag im Monat"
924
924
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  ""
433
433
  ],
434
- "documentation": [
435
- ""
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  ""
439
436
  ],
@@ -919,6 +916,9 @@
919
916
  "Please make sure you understand them by reading our": [
920
917
  ""
921
918
  ],
919
+ "documentation": [
920
+ ""
921
+ ],
922
922
  "Choose day in month": [
923
923
  ""
924
924
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  ""
433
433
  ],
434
- "documentation": [
435
- ""
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  ""
439
436
  ],
@@ -919,6 +916,9 @@
919
916
  "Please make sure you understand them by reading our": [
920
917
  ""
921
918
  ],
919
+ "documentation": [
920
+ ""
921
+ ],
922
922
  "Choose day in month": [
923
923
  ""
924
924
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  "Se eliminó el host."
433
433
  ],
434
- "documentation": [
435
- "documentación"
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  "Elegir contenido de SCAP existente"
439
436
  ],
@@ -921,6 +918,9 @@
921
918
  "Please make sure you understand them by reading our": [
922
919
  "Asegúrese de entenderlas leyendo nuestro"
923
920
  ],
921
+ "documentation": [
922
+ "documentación"
923
+ ],
924
924
  "Choose day in month": [
925
925
  "Elegir día del mes"
926
926
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  "L'hôte est supprimé"
433
433
  ],
434
- "documentation": [
435
- "documentation"
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  "Sélectionner un contenu SCAP existant"
439
436
  ],
@@ -921,6 +918,9 @@
921
918
  "Please make sure you understand them by reading our": [
922
919
  "Assurez-vous de les comprendre en lisant notre"
923
920
  ],
921
+ "documentation": [
922
+ "documentation"
923
+ ],
924
924
  "Choose day in month": [
925
925
  "Choisir un jour du mois"
926
926
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  ""
433
433
  ],
434
- "documentation": [
435
- ""
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  ""
439
436
  ],
@@ -919,6 +916,9 @@
919
916
  "Please make sure you understand them by reading our": [
920
917
  ""
921
918
  ],
919
+ "documentation": [
920
+ ""
921
+ ],
922
922
  "Choose day in month": [
923
923
  ""
924
924
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  ""
433
433
  ],
434
- "documentation": [
435
- ""
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  ""
439
436
  ],
@@ -919,6 +916,9 @@
919
916
  "Please make sure you understand them by reading our": [
920
917
  ""
921
918
  ],
919
+ "documentation": [
920
+ ""
921
+ ],
922
922
  "Choose day in month": [
923
923
  ""
924
924
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  "ホストが削除されました"
433
433
  ],
434
- "documentation": [
435
- "ドキュメント"
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  "既存の SCAP コンテンツを選択"
439
436
  ],
@@ -917,6 +914,9 @@
917
914
  "Please make sure you understand them by reading our": [
918
915
  "理解するために読んでください。"
919
916
  ],
917
+ "documentation": [
918
+ "ドキュメント"
919
+ ],
920
920
  "Choose day in month": [
921
921
  "月の日付を選択"
922
922
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  "호스트가 삭제되었습니다."
433
433
  ],
434
- "documentation": [
435
- ""
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  "기존 SCAP 컨텐츠 선택"
439
436
  ],
@@ -919,6 +916,9 @@
919
916
  "Please make sure you understand them by reading our": [
920
917
  ""
921
918
  ],
919
+ "documentation": [
920
+ ""
921
+ ],
922
922
  "Choose day in month": [
923
923
  ""
924
924
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  "Host removido"
433
433
  ],
434
- "documentation": [
435
- "documentação"
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  "Escolha um conteúdo SCAP existente"
439
436
  ],
@@ -921,6 +918,9 @@
921
918
  "Please make sure you understand them by reading our": [
922
919
  "Por favor, certifique-se de compreendê-los lendo nosso"
923
920
  ],
921
+ "documentation": [
922
+ "documentação"
923
+ ],
924
924
  "Choose day in month": [
925
925
  "Escolher dia no mês"
926
926
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  "Узел удален"
433
433
  ],
434
- "documentation": [
435
- "документация"
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  "Выберите существующее описание SCAP"
439
436
  ],
@@ -919,6 +916,9 @@
919
916
  "Please make sure you understand them by reading our": [
920
917
  ""
921
918
  ],
919
+ "documentation": [
920
+ "документация"
921
+ ],
922
922
  "Choose day in month": [
923
923
  ""
924
924
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  ""
433
433
  ],
434
- "documentation": [
435
- ""
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  ""
439
436
  ],
@@ -919,6 +916,9 @@
919
916
  "Please make sure you understand them by reading our": [
920
917
  ""
921
918
  ],
919
+ "documentation": [
920
+ ""
921
+ ],
922
922
  "Choose day in month": [
923
923
  ""
924
924
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  "主机被删除"
433
433
  ],
434
- "documentation": [
435
- "文档"
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  "选择现有的SCAP内容"
439
436
  ],
@@ -917,6 +914,9 @@
917
914
  "Please make sure you understand them by reading our": [
918
915
  "请通过阅读我们的手册确保您了解它们"
919
916
  ],
917
+ "documentation": [
918
+ "文档"
919
+ ],
920
920
  "Choose day in month": [
921
921
  "选择月中的一天"
922
922
  ],
@@ -431,9 +431,6 @@
431
431
  "Host is deleted": [
432
432
  "已刪除主機"
433
433
  ],
434
- "documentation": [
435
- ""
436
- ],
437
434
  "Choose existing SCAP Content": [
438
435
  "選擇現有的 SCAP 內容"
439
436
  ],
@@ -919,6 +916,9 @@
919
916
  "Please make sure you understand them by reading our": [
920
917
  ""
921
918
  ],
919
+ "documentation": [
920
+ ""
921
+ ],
922
922
  "Choose day in month": [
923
923
  ""
924
924
  ],
@@ -124,7 +124,8 @@ module Api
124
124
  end
125
125
 
126
126
  def handle_download_error(error)
127
- render_error 'standard_error', :status => :internal_error, :locals => { :exception => error }
127
+ render_error :custom_error, :status => :unprocessable_entity,
128
+ :locals => { :message => _("Downloading the report failed: #{error.message}") }
128
129
  end
129
130
 
130
131
  def upload_fail(msg)
@@ -117,13 +117,18 @@ class PoliciesController < ApplicationController
117
117
  @tailoring_file = ForemanOpenscap::TailoringFile.find(params[:tailoring_file_id]) if params[:tailoring_file_id].present?
118
118
  end
119
119
 
120
+ def multiple_with_filter?
121
+ params.key?(:search)
122
+ end
123
+
120
124
  def find_multiple
121
- # Lets search by name or id and make sure one of them exists first
122
- if params[:host_ids].present?
123
- @hosts = Host.where("id IN (?)", params[:host_ids])
125
+ if params.key?(:host_names) || params.key?(:host_ids) || multiple_with_filter?
126
+ @hosts = Host.search_for(params[:search]) if multiple_with_filter?
127
+ @hosts ||= Host.merge(Host.where(id: params[:host_ids]).or(Host.where(name: params[:host_names])))
124
128
  if @hosts.empty?
125
- error _('No hosts were found.')
126
- redirect_to(hosts_path) && (return false)
129
+ error _('No hosts were found with that id, name or query filter')
130
+ redirect_to(hosts_path)
131
+ return false
127
132
  end
128
133
  else
129
134
  error _('No hosts selected')
@@ -24,6 +24,9 @@ class TailoringFilesController < ApplicationController
24
24
  else
25
25
  process_error
26
26
  end
27
+ rescue RestClient::Exception => e
28
+ @tailoring_file.errors.add(:scap_file, :invalid, message: e.http_body)
29
+ process_error
27
30
  end
28
31
 
29
32
  def edit
@@ -1,12 +1,8 @@
1
1
  require 'foreman_openscap/version'
2
2
 
3
3
  module ForemanOpenscapHelper
4
- def scap_doc_link(section = '', text = _('documentation'))
5
- link_to(
6
- text,
7
- scap_doc_url(section),
8
- :rel => 'external noopener noreferrer', :target => '_blank'
9
- )
4
+ def scap_doc_button(section)
5
+ documentation_button(section, root_url: scap_doc_url)
10
6
  end
11
7
 
12
8
  def scap_doc_url(section = '')
@@ -15,10 +11,17 @@ module ForemanOpenscapHelper
15
11
  documentation_url(section, root_url: scap_root_url)
16
12
  end
17
13
 
14
+ private
15
+
16
+ def doc_flavor
17
+ ForemanOpenscap.with_katello? ? 'katello' : 'foreman-el'
18
+ end
19
+
18
20
  def scap_root_url
19
21
  @scap_root_url ||= begin
20
- version = ForemanOpenscap::VERSION.split('.')[0..-2].join('.')
21
- "https://theforeman.org/plugins/foreman_openscap/#{version}/index.html"
22
+ version = SETTINGS[:version]
23
+ version = version.tag == 'develop' ? 'nightly' : version.short
24
+ "https://docs.theforeman.org/#{version}/Managing_Security_Compliance/index-#{doc_flavor}.html#"
22
25
  end
23
26
  end
24
27
  end
@@ -55,11 +55,13 @@ module PoliciesHelper
55
55
  select_f form, :scap_content_id, scap_contents, :id, :title,
56
56
  { :include_blank => _("Choose existing SCAP Content") },
57
57
  { :label => _("SCAP Content"),
58
+ :required => true,
58
59
  :onchange => 'scap_content_selected(this);',
59
60
  :'data-url' => method_path('scap_content_selected') }
60
61
  else
61
62
  select_f form, :scap_content_id, scap_contents, :id, :title,
62
63
  { :label => _("SCAP Content"),
64
+ :required => true,
63
65
  :onchange => 'scap_content_selected(this);',
64
66
  :'data-url' => method_path('scap_content_selected') }
65
67
  end
@@ -1,4 +1,3 @@
1
- <% javascript 'charts' %>
2
1
  <% javascript 'foreman_openscap/reports' %>
3
2
  <% stylesheet 'foreman_openscap/reports' %>
4
3
 
@@ -9,6 +9,6 @@
9
9
  <%= _("You don't seem to have any ARF report. ARF report is a summary of a single scan occurrence on a particular host for a given Compliance Policy.") %></br>
10
10
  </p>
11
11
  <div class="blank-slate-pf-main-action">
12
- <%= link_to _('Documentation'), documentation_url("4.4ARFReports", :root_url => "https://www.theforeman.org/plugins/foreman_openscap/0.8/index.html#"), :rel => 'external', :class => 'btn btn-primary btn-lg' %>
12
+ <%= link_to _('Documentation'), scap_doc_url("Monitoring_Compliance_security-compliance"), :rel => 'external', :class => 'btn btn-primary btn-lg' %>
13
13
  </div>
14
14
  </div>
@@ -1,4 +1,4 @@
1
- <% javascript 'charts', 'foreman_openscap/scap_hosts_show' %>
1
+ <% javascript 'foreman_openscap/scap_hosts_show' %>
2
2
  <% stylesheet 'foreman_openscap/scap_breakdown_chart' %>
3
3
 
4
4
  <%= breadcrumbs(:resource_url => api_hosts_path,
@@ -3,7 +3,7 @@
3
3
 
4
4
  <% title_actions(
5
5
  display_link_if_authorized(_("New Compliance Policy"), hash_for_new_policy_path, :class => "btn btn-primary"),
6
- documentation_button('#4.2Creatingpolicywizard', :root_url => scap_doc_url)
6
+ scap_doc_button('Managing_Compliance_Policies_security-compliance')
7
7
  ) %>
8
8
 
9
9
  <%= render :partial => 'list' %>
@@ -4,7 +4,7 @@
4
4
  <div class="alert alert-info" id="scap-deployment-options-info-banner">
5
5
  <span class="pficon pficon-info"></span>
6
6
  <strong><%= _('There are significant differences in deployment options.') %></strong>
7
- <%= _('Please make sure you understand them by reading our') %> <%=scap_doc_link('#2.3Policydeploymentoptions') %>.
7
+ <%= _('Please make sure you understand them by reading our') %> <%= link_to(_('documentation'), scap_doc_url('deploying-compliance-policies_security-compliance'), :rel => 'external noopener noreferrer', :target => '_blank') %>.
8
8
  </div>
9
9
 
10
10
  <%= deploy_by_radios f, @policy %>
@@ -1,5 +1,5 @@
1
1
  <div class="tab-pane <%= show_partial_wizard(step) %>" id="create-policy">
2
2
  <%= wizard_header @policy.step_index, *translate_steps(@policy) %>
3
- <%= text_f(f, :name) %>
3
+ <%= text_f(f, :name, :required => true) %>
4
4
  <%= text_f(f, :description, :size => "col-md-8" ) %>
5
5
  </div>
@@ -4,8 +4,12 @@
4
4
  <%= wizard_header @policy.step_index, *@policy.steps %>
5
5
  <%= select_f(f, :period, %w[Weekly Monthly Custom], :downcase, :to_s,
6
6
  { :include_blank => _('Choose period') },
7
- { :onchange => 'period_selected(this)' }) %>
8
- <%= select_f(f, :weekday, days_of_week_hash, :first, :last, :include_blank => _('Choose weekday')) %>
9
- <%= select_f(f, :day_of_month, (1..31).to_a, :to_i, :to_s, :help_inline => _('Number of a day in month, note that not all months have same count of days'), :include_blank => _('Choose day in month')) %>
10
- <%= text_f(f, :cron_line, :help_inline => _('You can specify custom cron line, e.g. "0 3 * * *", separate each of 5 values by space')) %>
7
+ { :onchange => 'period_selected(this)', :required => true }) %>
8
+ <%= select_f(f, :weekday, days_of_week_hash, :first, :last,
9
+ { :include_blank => _('Choose weekday') },
10
+ { :required => true }) %>
11
+ <%= select_f(f, :day_of_month, (1..31).to_a, :to_i, :to_s,
12
+ { :include_blank => _('Choose day in month') },
13
+ { :help_inline => _('Number of a day in month, note that not all months have same count of days'), :required => true }) %>
14
+ <%= text_f(f, :cron_line, :help_inline => _('You can specify custom cron line, e.g. "0 3 * * *", separate each of 5 values by space'), :required => true) %>
11
15
  </div>
@@ -1,4 +1,4 @@
1
- <% javascript 'charts', 'foreman_openscap/policy_dashboard' %>
1
+ <% javascript 'foreman_openscap/policy_dashboard' %>
2
2
 
3
3
  <% title _("Compliance policy: %s") % @policy.name %>
4
4
 
@@ -1,6 +1,6 @@
1
1
  <% title _("SCAP Contents") %>
2
2
 
3
3
  <% title_actions(display_link_if_authorized(_("Upload New SCAP Content"), hash_for_new_scap_content_path, :class => 'btn btn-primary'),
4
- documentation_button('#4.1CreatingSCAPcontent', :root_url => scap_doc_url)) %>
4
+ scap_doc_button('Configuring_SCAP_Contents_security-compliance')) %>
5
5
 
6
6
  <%= render :partial => 'list' %>
@@ -1,4 +1,4 @@
1
1
  <% title _("Tailoring Files") %>
2
2
  <% title_actions(display_link_if_authorized(_("Upload New Tailoring file"), hash_for_new_tailoring_file_path, :class => 'btn btn-primary'),
3
- documentation_button('#4.5Tailoringfiles(foreman_openscap>=0.6.5)', :root_url => scap_doc_url)) %>
3
+ scap_doc_button('tailoring-xccdf-profiles_security-compliance')) %>
4
4
  <%= render :partial => 'list' %>
@@ -1,3 +1,3 @@
1
1
  module ForemanOpenscap
2
- VERSION = "7.0.0".freeze
2
+ VERSION = "7.1.0".freeze
3
3
  end