Security Controls

AUTH-9328 - Default umask

Description

The umask defines what default file permissions will be applied on a file or directory. Usually servers can have a more strict umask like 027, where desktops may be less strict (022).

Group

Authentication

How to solve

Files and directories are created with a default set of permissions. These depend on the parent directory and the umask value. This umask value contains three or four numbers and gives the system a hint on how to create new objects on the file system. For example using the umask 027 will be translated into 750 for directories or 640 for files. This means that the owner can read and write, with additional execution rights for directories. This latter part means that you are allowed to traverse the directory. The group will get read permissions for files, and again execution rights for directories. The other won't get any access to the file.

Using the right umask helps with limiting who can access created files. This is especially important for systems with multiple users. This is also the case when loose file permissions can result in unauthorized information disclosure, like a web server.

Additional resources


Linux and Unix System Hardening

This information is provided as part of the Lynis community project. It is related to Lynis control AUTH-9328. All information should be considered as-is, without guarantees. Any advice or snippets should be tested before implementing in production environments.

Lynis

Lynis is a technical security audit tool for systems running Linux, UNIX, *BSD, and macOS. It is open source software and free to use. The project has an active community, and can also be found on GitHub.

Lynis Enterprise

Need more advanced features, like vulnerability scanning, or reporting installed software packages? Lynis Enterprise will collect more data and present it with an easy to use web interface.

Gain additional benefits: automating security audits, reporting, and the implementation of related security measures.

Lynis Enterprise includes
  • Centralized management
  • Prioritized plans
  • Reporting
  • Dashboards
  • Integration (API)
  • Improvement snippets for tools like Ansible, Chef, Cfengine and Puppet

Take the Tour