Tuesday, June 27, 2017

Setting NTP Server for AWS EC2 instance in User Data

In a previous post I mentioned using a WatchGuard Firebox Cloud as an NTP server.

Here's some sample code.

Our Firebox CloudFormation template provides IP addresses as outputs:

https://github.com/tradichel/PacketCaptureAWS/blob/master/code/resources/firebox-network/firebox.yaml

This python code connects to the Firebox to to enable the NTP server on the Firebox via a lambda function and a key in a secure S3 bucket.

Finally, this sample web server shows how pass in the Firebox IP and change the NTP configuration file. Of course you would probably want multiple NTP servers for redundancy.