mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-03 14:03:24 +00:00
[fix]rule world writable library folder
os_world_writable_library_folder_configure issue# 445
This commit is contained in:
@@ -5,14 +5,14 @@ discussion: |
|
||||
|
||||
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.
|
||||
check: |
|
||||
/usr/bin/find /System/Volumes/Data/Library -type d -perm -2 -ls | /usr/bin/grep -v Caches | /usr/bin/grep -v /Preferences/Audio/Data | /usr/bin/wc -l | /usr/bin/xargs
|
||||
/usr/bin/find /System/Volumes/Data/Library -type d -perm -2 -ls 2>&1 | /usr/bin/grep -v Caches | /usr/bin/grep -v /Preferences/Audio/Data | /usr/bin/wc -l | /usr/bin/xargs
|
||||
result:
|
||||
integer: 0
|
||||
fix: |
|
||||
[source,bash]
|
||||
----
|
||||
IFS=$'\n'
|
||||
for libPermissions in $( /usr/bin/find /System/Volumes/Data/Library -type d -perm -2 | /usr/bin/grep -v Caches | /usr/bin/grep -v /Preferences/Audio/Data ); do
|
||||
for libPermissions in $( /usr/bin/find /System/Volumes/Data/Library -type d -perm -2 2>&1 | /usr/bin/grep -v Caches | /usr/bin/grep -v /Preferences/Audio/Data ); do
|
||||
/bin/chmod -R o-w "$libPermissions"
|
||||
done
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user