Bug 2064696

Summary: The /etc/tmux.conf file created has root 600 permissions, which delays the user login
Product: Red Hat Enterprise Linux 8 Reporter: Welterlen Benoit <bwelterl>
Component: scap-security-guideAssignee: Vojtech Polasek <vpolasek>
Status: CLOSED ERRATA QA Contact: Milan Lysonek <mlysonek>
Severity: medium Docs Contact: Jan Fiala <jafiala>
Priority: unspecified    
Version: 8.5CC: ggasparb, jafiala, jcerny, matyc, mburket, mhaicman, mlysonek, vpolasek, wsato
Target Milestone: rcKeywords: AutoVerified, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: scap-security-guide-0.1.63-1.el8 Doc Type: Bug Fix
Doc Text:
.OpenSCAP remediation sets correct permissions for `/etc/tmux.conf` Previously, when remediating the SCAP rule `configure_tmux_lock_after_time`, the `/etc/tmux.conf` file was created with permissions respecting umask (600). This caused `/etc/tmux.conf` to be unreadable by regular users. If a regular user logged in, they received an error message and had to wait for several minutes before a timeout ran out and they were logged in. With this update, the remediation of rule `configure_tmux_lock_after_time` sets specific permissions of `/etc/tmux.conf` to 644. As a result, regular users no longer encounter the error message or login delay.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-08 09:39:56 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:

Description Welterlen Benoit 2022-03-16 11:15:08 UTC
Description of problem:
When applying the ansible or bash remediation for rule:


The file /etc/tmux.conf has permissions 600 for root user because of a previous rule.

- From ansible doc:
If mode is not specified and the destination filesystem object does not exist, the default umask on the system will be used when setting the mode for the newly created filesystem object.

- And we can see in the same STIG guide (http://static.open-scap.org/ssg-guides/ssg-rhel8-guide-stig.html#!) that umask must be set to 077:
Ensure that Users Have Sensible Umask Values   Group contains 5 rules
Group   Ensure that Users Have Sensible Umask Values   Group contains 5 rules http://static.open-scap.org/ssg-guides/ssg-rhel8-guide-stig.html#xccdf_org.ssgproject.content_group_user_umask

Then all normal user will have a message "/etc/tmux.conf: Permission denied" and 'stuck' for 2.5 minutes when login.

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

How reproducible:

Steps to Reproduce:
1. apply stig ansible role https://github.com/RedHatOfficial/ansible-role-rhel8-stig
2. login with non root user

Actual results:
- /etc/tmux.conf with wrong permissions
- Message "/etc/tmux.conf: Permission denied" with delay to have the prompt

Expected results:
- right permissions and no delay to login

Additional info:

Comment 7 Jan Černý 2022-07-01 10:45:34 UTC
PR has been opened in upstream https://github.com/ComplianceAsCode/content/pull/9080

Comment 8 Jan Černý 2022-07-18 14:30:16 UTC
The PR https://github.com/ComplianceAsCode/content/pull/9080 has been merged upstream.

Comment 18 errata-xmlrpc 2022-11-08 09:39:56 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 (scap-security-guide bug fix and enhancement update), and where to find the updated
files, follow the link below.

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