RHEL 9 must define default permissions for the bash shell.

STIG ID: RHEL-09-412055  |  SRG: SRG-OS-000480-GPOS-00228 |  Severity: medium |  CCI: CCI-000366 |  Vulnerability Id: V-258072 | 

Vulnerability Discussion

The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be "0". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.

Satisfies: SRG-OS-000480-GPOS-00228, SRG-OS-000480-GPOS-00227

Check

Verify the "umask" setting is configured correctly in the "/etc/bashrc" file with the following command:

Note: If the value of the "umask" parameter is set to "000" "/etc/bashrc" file, the Severity is raised to a CAT I.

$ grep umask /etc/bashrc

umask 077
umask 077

If the value for the "umask" parameter is not "077", or the "umask" parameter is missing or is commented out, this is a finding.

Fix

Configure RHEL 9 to define default permissions for all authenticated users using the bash shell.

Add or edit the lines for the "umask" parameter in the "/etc/bashrc" file to "077":

umask 077