7.3 Set Default umask for users

Information

The default umask(1) determines the permissions of files created by users. The user
creating the file has the discretion of making their files and directories readable by others
via the chmod(1) command. Users who wish to allow their files and directories to be
readable by others by default may choose a different default umask by inserting the umask
command into the standard shell configuration files (.profile, .cshrc, etc.) in their home
directories.

Setting a very secure default value for umask ensures that users make a conscious choice
about their file permissions. A default umask setting of 077 causes files and directories
created by users to not be readable by any other user on the system. A umask of 027 would
allow files and directories readable by users in the same Unix group, while a umask of 022
would make files readable by every user on the system.

Solution

Perform the following to implement the recommended state-# cd /etc/default
# awk '/#UMASK=/ { $1 = 'UMASK=027' }
{ print }' login > login.CIS
# mv login.CIS login

See Also

https://workbench.cisecurity.org/files/616

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-3(4)(d)

Plugin: Unix

Control ID: ebc02f50ed72edb9438ee5b14e1aa91bc8014429ef8c7ec55ddc8e8f3279105b