diff options
authorColin Percival <cperciva@FreeBSD.org>2017-12-05 09:22:14 +0000
committerColin Percival <cperciva@FreeBSD.org>2017-12-05 09:22:14 +0000
commit4a93691064e364f74a1b7af00054bb6b81a3aaed (patch)
parent4ba35bc4dbbc2b69c7afc2b86c011d450ca81fc7 (diff)
Make EC2 instances use Amazon's NTP service for time synchronization.
Since Amazon provides NTP servers within their network, this should be far superior to using the default NTP pools; and since the service is provided by Amazon there's very little risk in enabling it by default. (If someone is able to compromise Amazon's NTP servers and exploit them to attack EC2 instances, they would almost certainly be able to compromise EC2 instances even without ntpd running...) MFC after: 1 week Relnotes: EC2 instances now keep their clocks synchronized using the Amazon Time Sync Service (aka. NTP).
Notes: svn path=/head/; revision=326565
1 files changed, 6 insertions, 1 deletions
diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf
index e712395da481..8cfb3da97d85 100644
--- a/release/tools/ec2.conf
+++ b/release/tools/ec2.conf
@@ -9,7 +9,7 @@
export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient amazon-ssm-agent"
# Set to a list of third-party software to enable in rc.conf(5).
-export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_ephemeralswap ec2_loghostkey firstboot_freebsd_update firstboot_pkgs"
+export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_ephemeralswap ec2_loghostkey firstboot_freebsd_update firstboot_pkgs ntpd"
# Build with a 3 GB UFS partition; the growfs rc.d script will expand
# the partition to fill the root disk after the EC2 instance is launched.
@@ -87,6 +87,11 @@ vm_extra_pre_umount() {
's/^#ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/' \
+ # Use the NTP service provided by Amazon
+ sed -i '' -e 's/^pool/#pool/' \
+ -e 's/^#server.*/server iburst/' \
+ ${DESTDIR}/etc/ntp.conf
# The first time the AMI boots, the installed "first boot" scripts
# should be allowed to run:
# * ec2_configinit (download and process EC2 user-data)