Skip to content

Commit

Permalink
2.2.1
Browse files Browse the repository at this point in the history
Setting NTP explicitly. No need for a remediation. If you want a remediation, feel free to write one!
  • Loading branch information
krispayne authored Nov 30, 2016
1 parent ba6bfdc commit 96271d8
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions ElCapitan_CIS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,20 @@ systemPreferences() {

# 2.2 Date & Time
# 2.2.1 Enable "Set time and date automatically"
# no need to remediate, just set.
# If you want to remediate first, please feel free to fork and pull
# Level 2 Not Scored, Level 1.5 Not Scored
if [[ ${CISLEVEL} = "1.5" ]]; then

if [[ "$(/usr/sbin/systemsetup -getusingnetworktime | awk '{ print $3 }')" = "On" ]]; then
ScriptLogging " NetworkTime on. Ensuring server is time.apple.com."
elif [[ "$(/usr/sbin/systemsetup -getnetworktimeserver | awk '{ print $4 }')" = "time.apple.com" ]]; then
ScriptLogging " NetworkTime is on and set to time.apple.com."
else
if [[ ! -e /etc/ntp.conf ]]; then
if [[ ! -e /etc/ntp.conf ]]; then
ScriptLogging " Create '/etc/ntp.conf'"
/usr/bin/touch /etc/ntp.conf
fi
ScriptLogging " Set NetworkTime to time.apple.com."
/usr/sbin/systemsetup -setnetworktimeserver time.apple.com
ScriptLogging " Ensure NetworkTime is on."
/usr/sbin/systemsetup -setusingnetworktime on
fi

ScriptLogging " Ensure NetworkTime is on."
/usr/sbin/systemsetup -setusingnetworktime on

ScriptLogging " Set NetworkTime to time.apple.com."
/usr/sbin/systemsetup -setnetworktimeserver time.apple.com
fi

# 2.2.2 Ensure time set is within appropriate limits
Expand Down

0 comments on commit 96271d8

Please sign in to comment.