Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1768512

Summary: rule package_tmux_installed remediation breaks rule no_tmux_in_shells
Product: Red Hat Enterprise Linux 8 Reporter: Vojtech Polasek <vpolasek>
Component: scap-security-guideAssignee: Watson Yuuma Sato <wsato>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.2CC: ggasparb, mhaicman
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-15 13:03:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vojtech Polasek 2019-11-04 16:03:22 UTC
Description of problem:

The problem happens when an user tries to scan and remediate a system with OSPP pprofile if Tmux package is not installed. There is a rule package_tmux_installed which checks for the Tmux package and if it is not presents, it installs it. During this phase the line 
/bin/tmux
is added into the /etc/shells.
Then there is a rule no_tmux_in_shells which checks for presence of a line containing tmux in /etc/shells.
What happens:
1. system is scanned. package_tmux_installed fails. no_tmux_in_shells passes.
2. remediation phase is performed. Remediation for package_tmux_installed is performed, effectively adding it into /etc/shells.
3. System is again scanned. package_tmux_installed passes but no_tmux_in_shells fails this time.


Version-Release number of selected component (if applicable):
scap-security-guide-0.1.46-2.el8.noarch


How reproducible:
always



Steps to Reproduce:
1. Install a rhel8 system, make sure that the package Tmux is not installed. Install openscap-scanner and scap-security-guide.
2. run
`oscap xccdf eval --remediate --profile=ospp /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml`
This scans and remediates the OSPP profile.

3. Now run
`oscap xccdf eval --profile=ospp --rule=xccdf_org.ssgproject.content_rule_no_tmux_in_shells /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml`
This only scans the system.



Actual results:

After step 2:
... snip ...
Title
	Prevent user from disabling the screen lock
Rule
	xccdf_org.ssgproject.content_rule_no_tmux_in_shells
Ident
	CCE-82361-7
Result
	pass
... snip ...
Title
	Install the tmux Package
Rule
	xccdf_org.ssgproject.content_rule_package_tmux_installed
Ident
	CCE-80644-8
Result
	fail
... snip ...
 --- Starting Remediation ---
... snip ...
Title
	Install the tmux Package
Rule
	xccdf_org.ssgproject.content_rule_package_tmux_installed
Ident
	CCE-80644-8
Result
	fixed

after step 3:
Title   Prevent user from disabling the screen lock
Rule    xccdf_org.ssgproject.content_rule_no_tmux_in_shells
Ident   CCE-82361-7
Result  fail



Expected results:

after step 3:
Title   Prevent user from disabling the screen lock
Rule    xccdf_org.ssgproject.content_rule_no_tmux_in_shells
Ident   CCE-82361-7
Result  pass

Additional info:

Comment 1 Matus Marhefka 2019-11-15 13:03:14 UTC
This issue is already reported in the https://bugzilla.redhat.com/show_bug.cgi?id=1750755

*** This bug has been marked as a duplicate of bug 1750755 ***