5.1 Set Sticky Bit on World Writable Directories

Information

When the so-called sticky bit (set with chmod +t) is set on a directory, then only the owner
of a file may remove that file from the directory (as opposed to the usual behavior where
anybody with write access to that directory may remove the file).

Files in directories that have had the 'sticky bit' set, can only be deleted by users that have
both write permissions for the directory in which the file resides, as well as ownership of
the file or directory, or has sufficient privilege. As this prevents users from overwriting
each other's files, whether it be accidental or malicious, it is generally appropriate for most
world-writable directories (e.g., /tmp). However, consult appropriate vendor
documentation before blindly applying the sticky bit to any world writable directories
found, in order to avoid breaking any application dependencies on a given directory.

Solution

To set the sticky bit on a directory, run the following command-# chmod +t [directory name]
6 System Access, Authentication, and AuthorizationThe actions described in this section are just a few measures that can be taken at a system
level to control access to the system and its services. It is strongly advised that
organizations have a process in place to document, authorize, and validate access privileges
and to revoke authorizations when they are no longer required.

See Also

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

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-6

Plugin: Unix

Control ID: 029540a5b40955b24c4f99d4c28515b84e56537a8cf6baa08d195802fd79879f