Skip to content

RHEL7 - exclude the user 'nfsnobody' from accounts_users_home_files_*#8393

Merged
Mab879 merged 1 commit intoComplianceAsCode:stabilization-v0.1.61from
yuumasato:accounts_users_home_files_and_nobody
Mar 22, 2022
Merged

RHEL7 - exclude the user 'nfsnobody' from accounts_users_home_files_*#8393
Mab879 merged 1 commit intoComplianceAsCode:stabilization-v0.1.61from
yuumasato:accounts_users_home_files_and_nobody

Conversation

@yuumasato
Copy link
Copy Markdown
Member

@yuumasato yuumasato commented Mar 21, 2022

Description:

  • Adds a filter to exclude the user nfsnobody on RHEL7 systems.

Rationale:

Interesting reference: https://fedoraproject.org/wiki/Changes/RenameNobodyUser

@yuumasato yuumasato added the bugfix Fixes to reported bugs. label Mar 21, 2022
@yuumasato yuumasato added this to the 0.1.61 milestone Mar 21, 2022
@yuumasato yuumasato requested a review from mildas March 21, 2022 19:01
@github-actions
Copy link
Copy Markdown

Start a new ephemeral environment with changes proposed in this pull request:

Open in Gitpod

@Mab879 Mab879 self-assigned this Mar 21, 2022
@Mab879
Copy link
Copy Markdown
Member

Mab879 commented Mar 21, 2022

I'm getting SSGTS failures on a local VM as well.

RHEL7

ERROR - Script lenient_permission.fail.sh using profile (all) found issue:
ERROR - Rule evaluation resulted in pass, instead of expected fail during initial stage 
ERROR - The initial scan failed for rule 'xccdf_org.ssgproject.content_rule_accounts_users_home_files_permissions'.
ERROR - Script lenient_permission_hidden_files.fail.sh using profile (all) found issue:
ERROR - Rule evaluation resulted in pass, instead of expected fail during initial stage 
ERROR - The initial scan failed for rule 'xccdf_org.ssgproject.content_rule_accounts_users_home_files_permissions'.

RHEL8

ERROR - Script lenient_permission.fail.sh using profile (all) found issue:
ERROR - Rule evaluation resulted in pass, instead of expected fail during initial stage 
ERROR - The initial scan failed for rule 'xccdf_org.ssgproject.content_rule_accounts_users_home_files_permissions'.
ERROR - Script lenient_permission_hidden_files.fail.sh using profile (all) found issue:
ERROR - Rule evaluation resulted in pass, instead of expected fail during initial stage 
ERROR - The initial scan failed for rule 'xccdf_org.ssgproject.content_rule_accounts_users_home_files_permissions'.

RHEL9

Rule is excluded via prodtype.

Do we need to change the UID of nobody to 99 on RHEL7?

[root@ci-vm-10-0-137-114 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.9 (Maipo)
[root@ci-vm-10-0-137-114 ~]# getent passwd nobody
nobody:x:99:99:Nobody:/:/sbin/nologin

Although we already exclude the user with username 'nobody', in some
systems (at least RHEL7) the user 'nobody' has uid 99, and the user
'nfsnobody' has uid 65534.

This patch excludes the user with name nfsnobody from the check on
RHEL7 systems.
@yuumasato yuumasato force-pushed the accounts_users_home_files_and_nobody branch from 1718711 to c45916e Compare March 21, 2022 22:44
@yuumasato
Copy link
Copy Markdown
Member Author

I have changed my approach to filter out the nfsnobody on RHEL7.

Do we need to change the UID of nobody to 99 on RHEL7?

[root@ci-vm-10-0-137-114 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.9 (Maipo)
[root@ci-vm-10-0-137-114 ~]# getent passwd nobody
nobody:x:99:99:Nobody:/:/sbin/nologin

I think the previous approach with default nobody UID and GIDs was not good.
In RHEL7 the value 65534 was actually incorrect, as it is the UID/GID for nfsnobody.

@yuumasato yuumasato changed the title Exclude the user with uid or gid equivalent to nobody RHEL7 - exclude the user 'nfsnobody' from accounts_users_home_files_* Mar 22, 2022
@Mab879 Mab879 merged commit 457ba78 into ComplianceAsCode:stabilization-v0.1.61 Mar 22, 2022
@yuumasato yuumasato deleted the accounts_users_home_files_and_nobody branch March 22, 2022 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes to reported bugs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RHEL 7 - accounts_users_home_files_* rules check /var/lib/nfs/ directory

2 participants