Original Release Date: 3/30/2017
Time synchronization is not something many people may consider to be a critical component of a properly functioning enterprise; however, it is vital for managing, securing, debugging, and investigating security incidents on a network. Desynchronized timekeeping across distributed servers in a corporate network can cause serious headaches for IT staff trying to diagnose network issues or investigators trying to get to the bottom of a data breach.
Without accurate timestamps on log files, log aggregation and security information and event management (SIEM) tools are unable to accurately correlate log files for proactive alerting and post-incident forensic analysis. Proper time correlation is necessary for authentication systems, determining network usage, file system updates, diagnosing problems affecting multiple devices and components, billing and other transactional services, and networks holding personal health information (PHI) – the Health Insurance Portability and Accountability Act (HIPAA) security rules require accurate timestamping.
This post covers the basics of time synchronization, some considerations for what can go wrong, and some recommendations to avoid pitfalls or external threats of poorly configured timekeeping.
NTP
Typically, network administrators implement the Network Time Protocol (NTP) to synchronize timekeeping across a set of distributed time servers and clients. NTP runs over the User Datagram Protocol (UDP) using port 123. The NTP network of servers typically obtains its time from highly accurate atomic clocks or GPS clocks linked to time servers. These specialized servers directly communicate with NTP servers using Coordinated Universal Time (UTC)—adjusted by adding leap seconds to match the rotation of the earth—and relies on local hosts to account for time zone changes. NTP is used to distribute this time across internal networks. The NTP client requests the time from the NTP server and the client then calculates the link delay and local offset to adjust its time to match the server’s clock. Several of these exchanges occurs within the first five to ten minutes after configuration to initially synchronize its clock and, typically, the client then updates its clock every few minutes thereafter.
Considerations
The distributed nature and use of multiple time servers provides NTP with some security; however, it is not secure by default and administrators should use an access list-based restriction scheme and an encryption authentication mechanism. NTP is susceptible to both man-in-the-middle (MitM) and distributed denial-of-service (DDoS) attacks. Previous versions of NTP have also been vulnerable to stack-based buffer overflow exploits. Additionally, NTP message spoofing could be used to adjust the time on client computers.
As with all software, administrators must continue to update to the latest version of NTP in order to limit a potential attackers’ ability to exploit known vulnerabilities. Earlier this month, the Network Time Foundation’s NTP Project released NTP version 4.2.8p10 to address multiple vulnerabilities in NTP Daemon (ntpd) that could allow a remote attacker to cause a denial-of-service (DoS) condition. A successful DoS attack on an NTP server could desynchronize timekeeping and result in secondary and tertiary effects that impact network performance.
On February 11, 2016, a security researcher posted a YouTube video that demonstrated how time synchronization issues can affect the everyday user; he found that manually setting the date of an iPhone or iPad back to January 1, 1970 would “brick” the device, rendering it useless. This occurred because Apple’s iPads and other devices consistently check various NTP servers around the globe to sync their internal date and time clocks. Brian Krebs later reported on his blog that two other researchers, Patrick Kelley and Matt Harrigan, discovered that if an attacker builds a hostile WiFi network to compel the device to download date and time updates from a malicious NTP time server, they could force the device to reset their clocks to January 1, 1970.
Time Synchronization Options
Organizations have the option to procure their own dedicated network time server, which protects against inherent security risks from obtaining time from internet time servers. If a time server is installed within the network firewall, risks from the outside are greatly minimized and the timing accuracy increases. Various products allow for time synchronization with non-network external clocks like GPS satellites, CDMA cell phone networks, and government radio signals, such as WWVB. At a minimum, organizations should review their network’s time synchronization configuration and determine if utilizing NTP or synchronizing with a non-network external clock is best for their network in terms of cost, reliability, and security.
Close Public NTP and Secure Port 123
Ideally, NTP is configured in a client-server model where the server contacts the NTP source to sync time.
Administrators should configure their system to ensure the NTP server acts as a client only. Additionally, to prevent NTP server floods, it is recommended to shut down the NTP daemon and block inbound traffic from port 123, the NTP default. Technical details on the commands used to configure these recommendations can be found here.
NTP DDoS Mitigation
The following are some measures to put in place to ensure that your NTP servers are not used to attack others, and to minimize the impact of NTP DDoS attacks against your network:
If you are the target of an NTP amplification DDoS attack:
More resources on properly configuring and maintaining of NTP servers: