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 1878119

Summary: Actual permissions/ownership of files owned by gdm package diverge from RPM records.
Product: Red Hat Enterprise Linux 8 Reporter: Milan Lysonek <mlysonek>
Component: gdmAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED ERRATA QA Contact: Michal Odehnal <modehnal>
Severity: low Docs Contact:
Priority: medium    
Version: 8.3CC: ggasparb, hdegoede, matyc, mhaicman, thistlesl1234, tpelka, wsato
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gdm-40.0-19.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1976233 1999586 2209266 (view as bug list) Environment:
Last Closed: 2022-05-10 13:34:39 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:
Bug Depends On:    
Bug Blocks: 1976233, 1999586, 2209266    
Attachments:
Description Flags
E8 profile scan performed after installation none

Description Milan Lysonek 2020-09-11 11:16:00 UTC
Created attachment 1714552 [details]
E8 profile scan performed after installation

Description of problem:

The following rules fail to pass when doing fresh installation of RHEL8.3 using Server with GUI package group:
xccdf_org.ssgproject.content_rule_rpm_verify_permissions
xccdf_org.ssgproject.content_rule_rpm_verify_ownership

Version-Release number of selected component (if applicable):
scap-security-guide-0.1.50-14.el8

How reproducible:
In most cases (~80% probability) rpm_verify_permissions fails, rpm_verify_ownership occasionally fails, and sometimes both passes.

Steps to Reproduce:
1. Start installation
2. Select Server with GUI package group
3. Select PCI DSS, E8, or HIPAA profile
4. After installation scan machine running (replace the E8 profile with the profile selected at the beginning of the installation):
   $ oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_e8 --report e8_report.html /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml

Actual results:
Rules fail:
xccdf_org.ssgproject.content_rule_rpm_verify_permissions
xccdf_org.ssgproject.content_rule_rpm_verify_ownership

Expected results:
Rules pass.

Additional info:
The failures are caused by /var/log/gdm file from gdm package.

Comment 1 Marek Haicman 2020-09-16 11:48:13 UTC
Milane, can you expand a bit on the details of failure? What does it mean? What is the real state of the gdm file and what is the expected state? I have a feeling we had a bug like this already. It's not something we can really fix on our side, unless we implement some kind of additional whitelisting for these rpm_verify rules.

So as you provide more detailed report of the situation, we can move the issue to gdm :)

Comment 2 Milan Lysonek 2020-09-16 14:04:03 UTC
Sure.

rpm_verify_permissions (rpm_verify_ownership) rule from security-guide-component is a rule that checks file access (ownership) permissions of installed software packages. For the check, the RPM package management system is used. If a file, that is a part of a installed software package, has incorrect permissions, then result from the rule is fail and it is possible to see which files caused the failure. In this case, failure is caused by /var/log/gdm folder.

The /var/log/gdm folder access and ownership permissions on running system are different that permissions that are expected from the RPM package manager. The fact can be found with following command:
[root@localhost ~]# rpm -Va gdm
.M....G..    /var/log/gdm
[root@localhost ~]# 

M stands for Mode differs (includes permissions and file type)
G stands for Group ownership differs


The command above shows divergences. The permissions can be reset to the permissions expected from the RPM package manager, see following commands:
[root@localhost ~]# ls -la /var/log/gdm                                                                                                                                                                                                      
total 4
drwx--x--x.  2 root gdm     6 Sep  1 22:57 .
drwxr-xr-x. 18 root root 4096 Sep 10 17:48 ..
[root@localhost ~]# rpm --setugids gdm
[root@localhost ~]# rpm --setperms gdm
[root@localhost ~]# ls -la /var/log/gdm
total 4
drwxr-xr-x.  2 root root    6 Sep  1 22:57 .
drwxr-xr-x. 18 root root 4096 Sep 10 17:48 ..
[root@localhost ~]#

There are two fact you can observe:
1) The /var/log/gdm group ownership was gdm but rpm resets it to root group.
2) The /var/log/gdm access permissions were drwx--x--x. but rpm resets them to drwxr-xr-x.

After restart, the permissions are set back to permissions that are considered as incorrect by rpm:
[root@localhost ~]# ls -la /var/log/gdm
total 4
drwx--x--x.  2 root gdm     6 Sep  1 22:57 .
drwxr-xr-x. 18 root root 4096 Sep 10 17:48 ..



I hope, it is more clear now. However, I would like to raise a few questions:
1) Should permissions of the /var/log folder be checker in scap-security-guide? The folder contains log files and their checksum/size can change. If the folder should not be checked, then the component of this bug is set correctly.
2) Should the /var/log/gdm folder be part of the gdm package? Are any of the permissions of /var/log/gdm mentioned above unexpected? If the folder should have different permissions or it should not be included in the package, then the bug can be moved to gdm.

Comment 4 Matěj Týč 2020-10-02 10:14:59 UTC
To answer Milan's questions, permssions of the /var/log/gdm folder are highly relevant from the security standpoint, and any discrepancy in this regard has to be investigated and potentially waived by people who do the security hardening. Therefore, that discrepancy should be removed, as it hinders security evaluations.

Comment 9 errata-xmlrpc 2022-05-10 13:34:39 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 (gdm 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.

https://access.redhat.com/errata/RHBA-2022:1771