This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2227808 - Unexpected changes of variable values in generated remediations in customized profiles
Summary: Unexpected changes of variable values in generated remediations in customized...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: scap-workbench
Version: 9.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Matěj Týč
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-31 14:48 UTC by Jan Černý
Modified: 2023-08-23 14:46 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-23 14:45:04 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-1473 0 None Migrated None 2023-08-23 14:44:59 UTC
Red Hat Issue Tracker RHELPLAN-163899 0 None None None 2023-07-31 14:50:03 UTC

Description Jan Černý 2023-07-31 14:48:56 UTC
Description of problem:

The Ansible Playbook generated from the shipped profile and Ansible Playbook generated
from customized profile differ in more values than were actually customized.

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

scap-workbench-1.2.1-13.el9.x86_64
openscap-1.3.8-1.el9.x86_64
scap-security-guide-0.1.66-1.el9_1.noarch

How reproducible:

deterministically

Steps to reproduce:

1. Run scap-workbench from the terminal.
2. On the "Open SCAP Security Guide" screen, select RHEL 9 and click on Load Content.
3. Choose "CIS RHEL 9 Benchmark for Level 2 - Server" profile in the Profile dropdown.
4. Click on "Generate Remediation Role", generate an Ansible playbook and save it to a file eg. "cis.yml".
5. Click on Customize, choose custom profile ID, change the value of var_accounts_tmout value and confirm "OK".
6. Click on "Generate Remediation Role", generate an Ansible playbook and save it to a file eg. "cis_customized.yml".
7. Run a diff of the 2 playbooks in the terminal: diff -u cis.yml cis_customized.yml

Actual results:

A lot of values differ in the generated Playbook. But only a single value was changed in the Customization Window.

8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---

[test@kvm-06-guest39 ~]$ diff -u cis.yml cis_customized.yml 
--- cis.yml	2023-07-31 10:36:00.955711462 -0400
+++ cis_customized.yml	2023-07-31 10:36:41.509035586 -0400
@@ -1,7 +1,7 @@
 ---
 ###############################################################################
 #
-# Ansible Playbook for CIS Red Hat Enterprise Linux 9 Benchmark for Level 2 - Server
+# Ansible Playbook for CIS Red Hat Enterprise Linux 9 Benchmark for Level 2 - Server [CUSTOMIZED]
 #
 # Profile Description:
 # This profile defines a baseline that aligns to the "Level 2 - Server"
@@ -10,13 +10,13 @@
 # This profile includes Center for Internet Security®
 # Red Hat Enterprise Linux 9 CIS Benchmarks™ content.
 #
-# Profile ID:  xccdf_org.ssgproject.content_profile_cis
+# Profile ID:  xccdf_org.ssgproject.content_profile_cis_customized
 # Benchmark ID:  xccdf_org.ssgproject.content_benchmark_RHEL-9
 # Benchmark Version:  0.1.66
 # XCCDF Version:  1.2
 #
 # This file was generated by OpenSCAP 1.3.8 using:
-# $ oscap xccdf generate fix --profile xccdf_org.ssgproject.content_profile_cis --fix-type ansible xccdf-file.xml
+# $ oscap xccdf generate fix --profile xccdf_org.ssgproject.content_profile_cis_customized --fix-type ansible xccdf-file.xml
 #
 # This Ansible Playbook is generated from an OpenSCAP profile without preliminary evaluation.
 # It attempts to fix every selected rule, even if the system is already compliant.
@@ -33,28 +33,28 @@
   vars:
     var_system_crypto_policy: !!str DEFAULT
     inactivity_timeout_value: !!str 900
-    var_screensaver_lock_delay: !!str 5
+    var_screensaver_lock_delay: !!str 0
     var_sudo_logfile: !!str /var/log/sudo.log
     var_sudo_timestamp_timeout: !!str 5
-    var_authselect_profile: !!str sssd
-    login_banner_text: !!str ^(Authorized[\s\n]+uses[\s\n]+only\.[\s\n]+All[\s\n]+activity[\s\n]+may[\s\n]+be[\s\n]+monitored[\s\n]+and[\s\n]+reported\.|^(?!.*(\\|fedora|rhel|sle|ubuntu)).*)$
+    var_authselect_profile: !!str minimal
+    login_banner_text: !!str ^Authorized[\s\n]+uses[\s\n]+only\.[\s\n]+All[\s\n]+activity[\s\n]+may[\s\n]+be[\s\n]+monitored[\s\n]+and[\s\n]+reported\.$
     var_password_pam_remember: !!str 5
-    var_password_pam_remember_control_flag: !!str requisite,required
+    var_password_pam_remember_control_flag: !!str requisite
     var_accounts_passwords_pam_faillock_deny: !!str 3
-    var_accounts_passwords_pam_faillock_unlock_time: !!str 900
-    var_password_pam_minclass: !!str 4
-    var_password_pam_minlen: !!str 14
+    var_accounts_passwords_pam_faillock_unlock_time: !!str 0
+    var_password_pam_minclass: !!str 3
+    var_password_pam_minlen: !!str 15
     var_password_pam_retry: !!str 3
-    var_account_disable_post_pw_expiration: !!str 30
-    var_accounts_maximum_age_login_defs: !!str 365
-    var_accounts_minimum_age_login_defs: !!str 1
+    var_account_disable_post_pw_expiration: !!str 35
+    var_accounts_maximum_age_login_defs: !!str 60
+    var_accounts_minimum_age_login_defs: !!str 7
     var_accounts_password_warn_age_login_defs: !!str 7
-    var_accounts_tmout: !!str 900
+    var_accounts_tmout: !!str 1800
     var_accounts_user_umask: !!str 027
     var_auditd_action_mail_acct: !!str root
-    var_auditd_admin_space_left_action: !!str halt
+    var_auditd_admin_space_left_action: !!str single
     var_auditd_max_log_file: !!str 6
-    var_auditd_max_log_file_action: !!str keep_logs
+    var_auditd_max_log_file_action: !!str rotate
     var_auditd_space_left_action: !!str email
     sysctl_net_ipv6_conf_all_accept_ra_value: !!str 0
     sysctl_net_ipv6_conf_all_accept_redirects_value: !!str 0
@@ -79,13 +79,13 @@
     var_selinux_policy_name: !!str targeted
     var_selinux_state: !!str enforcing
     var_postfix_inet_interfaces: !!str loopback-only
-    var_multiple_time_servers: !!str 0.rhel.pool.ntp.org,1.rhel.pool.ntp.org,2.rhel.pool.ntp.org,3.rhel.pool.ntp.org
+    var_multiple_time_servers: !!str 0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org,3.pool.ntp.org
     var_sshd_set_keepalive: !!str 0
-    sshd_idle_timeout_value: !!str 900
+    sshd_idle_timeout_value: !!str 300
     var_sshd_set_login_grace_time: !!str 60
     sshd_max_auth_tries_value: !!str 4
     var_sshd_max_sessions: !!str 10
-    var_sshd_set_maxstartups: !!str 10:30:60
+    var_sshd_set_maxstartups: !!str 10:30:100
   tasks:
     - name: Ensure aide is installed
       package:

8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---


Expected results:

The Playbooks will differ only in the variable value that has been changed in the Customization UI and other values stay the same.

Additional info:

This bug is also reproducible on Fedora 38 with these RPM versions:
scap-workbench-1.2.1-12.fc37.x86_64
openscap-1.3.8-1.fc38.x86_64
scap-security-guide-0.1.68-1.fc38.noarch

Comment 1 Jan Černý 2023-08-01 10:48:27 UTC
Next to RHEL 9.3 and Fedora 38, I have successfully reproduced this bug also on RHEL 9.2, RHEL 8.8, RHEL 8.4. I have used these versions of packages:

RHEL 9.2:
scap-workbench-1.2.1-13.el9.x86_64
scap-security-guide-0.1.66-1.el9_1.noarch
openscap-1.3.7-1.el9.x86_64

RHEL 8.8:
scap-workbench-1.2.0-8.el8.x86_64
scap-security-guide-0.1.66-2.el8.noarch
openscap-1.3.7-1.el8.x86_64

RHEL 8.4:
scap-workbench-1.2.0-8.el8.x86_64
scap-security-guide-0.1.54-5.el8.noarch
openscap-1.3.4-5.el8.x86_64

Therefore I think that this bug is a longstanding problem.

Comment 2 Jan Černý 2023-08-03 14:02:19 UTC
The bug can be worked around by generating the Playbooks on the command line using the `oscap` tool instead of SCAP Workbench.
First, save the tailoring file to a file and then run:
oscap xccdf generate fix --fix-type ansible --profile cis_customized --tailoring-file tailoring.xml /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml > custom.yml

Comment 3 RHEL Program Management 2023-08-17 14:26:34 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 4 RHEL Program Management 2023-08-23 14:45:04 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.


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