system_settings_softwareupdate_current Ensure Software Update is Updated and Current
NIST macOS Security Compliance Project Sequoia Guidance, Revision 4.0 (be5491f)
All changes in this version
All changes in this version
Title
Ensure Software Update is Updated and Current
Control
softwareupdate_date_epoch=$(/bin/date -j -f "%Y-%m-%d" "$(/usr/bin/defaults read /Library/Preferences/com.apple.SoftwareUpdate.plist LastFullSuccessfulDate | /usr/bin/awk '{print $1}')" "+%s")
thirty_days_epoch=$(/bin/date -v -30d "+%s")
if [[ $softwareupdate_date_epoch -lt $thirty_days_epoch ]]; then
/bin/echo "0"
else
/bin/echo "1"
fi
Discussion
Make sure Software Update is updated and current.
NOTE: Automatic fix can cause unplanned restarts and may lose work.
Fix
[source,bash]
----
/usr/sbin/softwareupdate -i -a
----
NOTE - This will apply to the whole system