macOS
TMA-MACOS-2.6.1.1
Ensure Location Services Is Enabled
低等級 2自動化macos
說明
macOS uses location information gathered through local Wi-Fi networks to enable applications to supply relevant information to users. With the operating system verifying the location, users do not need to change the time or the time zone. The computer will change them based on the user's location.
檢查方式
稽核方法: Shell 指令
shell
n=$(/bin/launchctl list 2>/dev/null | /usr/bin/grep -c com.apple.locationd)
e=$(/usr/bin/sudo -u _locationd /usr/bin/osascript -l JavaScript <<'EOS'
$.NSUserDefaults.alloc.initWithSuiteName('com.apple.locationd').objectForKey('LocationServicesEnabled').js
EOS
) || exit 1
if [ "${n:-0}" -ge 1 ] && [ "$e" = true ]; then echo compliant; else echo "locationd=$n LocationServicesEnabled=${e:-unset}"; fi- 預期輸出
compliant
修補方式
修補方法: 操作指南或基礎設施修補檔
Terminal: sudo /bin/launchctl load -w /System/Library/LaunchDaemons/com.apple.locationd.plist ; sudo /usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd LocationServicesEnabled -bool true ; sudo /usr/bin/killall locationd. GUI: System Settings > Privacy & Security > Location Services > Set Location Services to enabled.
屬性
- 作業系統
- macos-26
- 標籤
- macossystem-settings
- 參考資料
- CIS Apple macOS 26 Tahoe Benchmark v1.1.0 - 2.6.1.1 Ensure Location Services Is Enabled
檢查此主機
請在您有權稽核的機器上執行此指令。掃描為唯讀操作。
shell
tmaegis scan --target macos --level 2