os_world_writable_library_folder_configure Ensure No World Writable Files Exist in the Library Folder
NIST macOS Security Compliance Project Sequoia Guidance, Revision 4.0 (be5491f)
All changes in this version
All changes in this version
Title
Ensure No World Writable Files Exist in the Library Folder
Control
/usr/bin/find /Library -type d -perm -002 ! -perm -1000 ! -xattrname com.apple.rootless 2>/dev/null | /usr/bin/wc -l | /usr/bin/xargs
Discussion
Folders in /System/Volumes/Data/Library _MUST_ not be world-writable.
NOTE: Some vendors are known to create world-writable folders to the System Library folder. You may need to add more exclusions to this check and fix to match your environment.
Fix
[source,bash]
----
IFS=$'\n'
for libPermissions in $(/usr/bin/find /Library -type d -perm -002 ! -perm -1000 ! -xattrname com.apple.rootless 2>/dev/null); do
/bin/chmod -R o-w "$libPermissions"
done
----