SV-269210r1050092_rule
V-269210
SRG-OS-000480-GPOS-00230
ALMA-09-014760
CAT II
10
Change the group owner of a local interactive user's home directory to the group found in "/etc/passwd". To change the group owner of a local interactive user's home directory, use the following command:
Note: The example will be for the user "test", who has a home directory of "/home/test", and has a primary group of "test".
$ chgrp test /home/test
Verify the assigned home directory of all local interactive users is group-owned by that user's primary GID with the following command:
Note: This may miss local interactive users that have been assigned a privileged UID. Evidence of interactive use may be obtained from a number of log files containing system logon information. The returned directory "/home/test" is used as an example.
$ stat --format="%n: GID=%g (%G), UID=%u (%U), MODE=%0.4a" $(awk -F: '($3>=1000)&&($7 !~ /nologin/){print $6}' /etc/passwd)
/home/test: GID=1001 (test), UID=1001 (test), MODE=0700
Check the user's primary group with the following command:
$ grep $(grep -E '^test:' /etc/passwd | awk -F: '{print $4}') /etc/group
test:x:1001:
If the user home directory referenced in "/etc/passwd" is not group-owned by that user's primary GID (1001 in the above example) this is a finding.
V-269210
False
ALMA-09-014760
Verify the assigned home directory of all local interactive users is group-owned by that user's primary GID with the following command:
Note: This may miss local interactive users that have been assigned a privileged UID. Evidence of interactive use may be obtained from a number of log files containing system logon information. The returned directory "/home/test" is used as an example.
$ stat --format="%n: GID=%g (%G), UID=%u (%U), MODE=%0.4a" $(awk -F: '($3>=1000)&&($7 !~ /nologin/){print $6}' /etc/passwd)
/home/test: GID=1001 (test), UID=1001 (test), MODE=0700
Check the user's primary group with the following command:
$ grep $(grep -E '^test:' /etc/passwd | awk -F: '{print $4}') /etc/group
test:x:1001:
If the user home directory referenced in "/etc/passwd" is not group-owned by that user's primary GID (1001 in the above example) this is a finding.
M
5664