2.17 Set Sticky Bit on All World-Writable Directories

Information

Setting the sticky bit on world writable directories prevents users from deleting or renaming files in that directory that are not owned by them. This feature prevents the ability to delete or rename files in world writable directories (such as /tmp) that are owned by another user.

Solution

# df --local -P | awk {'if (NR!=1) print $6'} | xargs -I '{}' find '{}' -xdev -type d -perm -0002 2>/dev/null | xargs chmod a+t

See Also

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

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-6

Plugin: Unix

Control ID: bb18d6ec8b242f7e1760237ff381947e1bd504e0369d3eae9e03c94597e41096