Bug 2026718 - XCCDF Profile in Tailoring File selecting the first id not the selected id
Summary: XCCDF Profile in Tailoring File selecting the first id not the selected id
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: SCAP Plugin
Version: 6.10.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.11.0
Assignee: satellite6-bugs
QA Contact: addubey
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-25 15:24 UTC by Aldrey Souza
Modified: 2022-07-05 14:30 UTC (History)
6 users (show)

Fixed In Version: foreman_openscap 5.1.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:30:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Tailoring profile file: ssg-rhel7-ds-xccdf-tailoring.xml (2.48 KB, application/xml)
2021-11-25 15:24 UTC, Aldrey Souza
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 33972 0 Immediate Closed tailoring_file_profile_selector 2021-11-26 07:53:43 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:30:55 UTC

Description Aldrey Souza 2021-11-25 15:24:50 UTC
Created attachment 1843598 [details]
Tailoring profile file: ssg-rhel7-ds-xccdf-tailoring.xml

Description of problem:
 When you 'Edit' the Policy and select the 'XCCDF Profile in Tailoring File' it allows saving. But if you 'Edit' again it selects the first id, not the selected id.

Version-Release number of selected component (if applicable):


How reproducible:
 1. Create a Tailoring Files
 2. Create a new Policy
 3. Edit the Policy and select a different tailoring profile
 4. Check the selected tailoring profile again
 


Steps to Reproduce:
1. Create a Tailoring Files
 -> Satellite WebUI
 -> Hosts
 -> Compliance
 -> Tailoring Files
 -> Upload New Tailoring file
 -> Upload the file attached 'ssg-rhel7-ds-xccdf-tailoring.xml'

2. Create a new Policy
 -> Satellite WebUI
 -> Hosts
 -> Compliance
 -> Policies
 -> New Compliance Policy
 -> Deployment Options - Select: Ansible
 -> Policy Attributes - Name: policy_test
 -> SCAP Content:
     SCAP Content: Red Hat rhel7 default content
     XCCDF Profile: Default XCCDF profile
     Tailoring File: ssg-rhel7-ds-xccdf-tailoring
     XCCDF Profile in Tailoring File: CIS Red Hat Enterprise Linux 7 Benchmark for Level 1 - Minimal [CUSTOMIZED]
 -> Schedule (any period):
    Period: Weekly
    Weekday: Sunday
  -> Submit

  * In 'Effective Profile', we can see: CIS Red Hat Enterprise Linux 7 Benchmark for Level 1 - Minimal [CUSTOMIZED]  

3. Edit the policy 'policy_test'
  -> SCAP Content:
     SCAP Content: Red Hat rhel7 default content
     XCCDF Profile: Default XCCDF profile
     Tailoring File: ssg-rhel7-ds-xccdf-tailoring
     XCCDF Profile in Tailoring File: CIS Red Hat Enterprise Linux 7 Benchmark for Level 1 - WebServer [CUSTOMIZED]   <-- Changed to WebServer (before Minimal)

  * After the change, we can see in 'Effective Profile': CIS Red Hat Enterprise Linux 7 Benchmark for Level 1 - WebServer [CUSTOMIZED]  

4. Edit the policy 'policy_test'
  -> SCAP Content:
     SCAP Content: Red Hat rhel7 default content
     XCCDF Profile: Default XCCDF profile
     Tailoring File: ssg-rhel7-ds-xccdf-tailoring
     XCCDF Profile in Tailoring File: CIS Red Hat Enterprise Linux 7 Benchmark for Level 1 - Minimal [CUSTOMIZED]   <-- Showing Minimal and should select WebServer


 
Actual results:
 By default, it selects the first tailoring profile id, not the selected profile.

Expected results:
 See the selected tailoring profile

Additional info:
 Possible patch attached 'tailoring_profile_selected.patch'.

 To apply it:
 # patch -p0 /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_openscap-4.3.3/app/helpers/policies_helper.rb < tailoring_profile_selected.patch

Comment 1 Aldrey Souza 2021-11-25 15:25:35 UTC
Created attachment 1843599 [details]
Possible patch: tailoring_profile_selected.patch

Comment 2 Ondřej Pražák 2021-11-26 07:53:42 UTC
Connecting redmine issue https://projects.theforeman.org/issues/33972 from this bug

Comment 3 Bryan Kearney 2021-11-26 12:05:33 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/33972 has been resolved.

Comment 5 addubey 2022-02-02 13:37:56 UTC
FailedQA.

Version Tested: Satellite 7.0.0 Snap 7.0

Steps followed: 

 1. Create Tailoring Files
 2. Create a new Policy
 3. Edit the Policy and select a different tailoring profile
 4. Check the selected tailoring profile again

Observation: Not able to see the selected tailoring file.


Tested with below:

 XCCDF Profile in Tailoring File: CIS Red Hat Enterprise Linux 7 Benchmark for Level 1 - Minimal [CUSTOMIZED]
 XCCDF Profile in Tailoring File: CIS Red Hat Enterprise Linux 7 Benchmark for Level 1 - WebServer [CUSTOMIZED]

Comment 6 Ron Lavi 2022-02-07 13:25:31 UTC
Thanks, we just realized that the version of foreman_openscap with the fix didn't make it to the snap,
I released foreman_openscap.1 to address that

Comment 7 addubey 2022-02-22 07:55:37 UTC
Verified.


Tested on: Satellite-7.0.0 Snap 10.0


Steps followed:

 1. Create Tailoring Files
 2. Create a new Policy
 3. Edit the Policy and select a different tailoring profile
 4. Check the selected tailoring profile again

Observation: Able to see the correct selected tailoring file.

Comment 10 errata-xmlrpc 2022-07-05 14:30:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498


Note You need to log in before you can comment on or make changes to this bug.