NTP Working Group | D. Sibold |
Internet-Draft | PTB |
Intended status: Standards Track | S. Röttger |
Expires: January 5, 2015 | |
K. Teichel | |
PTB | |
July 04, 2014 |
Network Time Security
draft-ietf-ntp-network-time-security-04.txt
This document describes the Network Time Security (NTS) protocol that enables secure authentication of time servers using Network Time Protocol (NTP) or Precision Time Protocol (PTP). Its design considers the special requirements of precise timekeeping, which are described in Security Requirements of Time Protocols in Packet Switched Networks [I-D.ietf-tictoc-security-requirements].
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on January 5, 2015.
Copyright (c) 2014 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
Time synchronization protocols are increasingly utilized to synchronize clocks in networked infrastructures. The reliable performance of such infrastructures can be degraded seriously by successful attacks against the time synchronization protocol. Therefore, time synchronization protocols applied in critical infrastructures have to provide security measures to defeat possible adversaries. Consequently, the widespread Network Time Protocol (NTP) [RFC5905] was supplemented by the autokey protocol [RFC5906] which shall ensure authenticity of the NTP server and integrity of the protocol packets. Unfortunately, the autokey protocol exhibits various severe security vulnerabilities as revealed in a thorough analysis of the protocol [Roettger]. For the Precision Time Protocol (PTP), Annex K of the standard document IEEE 1588 [IEEE1588] defines an informative security protocol that is still in experimental state.
Because of autokey's security vulnerabilities and the absence of a standardized security protocol for PTP, these protocols cannot be applied in environments in which compliance requirements demand authenticity and integrity protection. This document specifies a security protocol which ensures authenticity of the time server via a Public Key Infrastructure (PKI) and integrity of the time synchronization protocol packets and which therefore enables the usage of NTP and PTP in such environments.
The protocol is specified with the prerequisite in mind that precise timekeeping can only be accomplished with stateless time synchronization communication, which excludes the utilization of standard security protocols like IPsec or TLS for time synchronization messages. This prerequisite corresponds with the requirement that a security mechanism for timekeeping must be designed in such a way that it does not degrade the quality of the time transfer [I-D.ietf-tictoc-security-requirements].
Note:
A profound analysis of security threats and requirements for NTP and PTP can be found in the "Security Requirements of Time Protocols in Packet Switched Networks" [I-D.ietf-tictoc-security-requirements].
The objectives of the NTS specification are as follows:
NTS applies X.509 certificates to verify the authenticity of the time server and to exchange a symmetric key, the so-called cookie. This cookie is then used to protect authenticity and integrity of the subsequent time synchronization packets by means of a Message Authentication Code (MAC), which is attached to each time synchronization packet. The calculation of the MAC includes the whole time synchronization packet and the cookie which is shared between client and server. It is calculated according to:[I-D.ietf-tictoc-security-requirements]. See Section 8 for details on the seed refresh and Section 7.1.1 for the client's reaction to it.
with the server seed as key, where H is a hash function, and where the function MSB_128 cuts off the 128 most significant bits of the result of the HMAC function. The server seed is a 128 bit random value of the server, which has to be kept secret. The cookie never changes as long as the server seed stays the same, but the server seed has to be refreshed periodically in order to provide key freshness as required in
The server does not keep a state of the client. Therefore it has to recalculate the cookie each time it receives a request from the client. To this end, the client has to attach the hash value of its certificate to each request (see Section 6.4).
Just as in the case of the client server mode and symmetric mode, authenticity and integrity of the NTP packets are ensured by a MAC, which is attached to the NTP packet by the sender. The verification of the authenticity is based on the TESLA protocol, in particular on its "Not Re-using Keys" scheme, see section 3.7.2 of [RFC4082]. TESLA is based on a one-way chain of keys, where each key is the output of a one-way function applied on the previous key in the chain. The last element of the chain is shared securely with all clients. The server splits time into intervals of uniform duration and assigns each key to an interval in reverse order, starting with the penultimate. At each time interval, the server sends an NTP broadcast packet appended by a MAC, calculated using the corresponding key, and the key of the previous disclosure interval. The client verifies the MAC by buffering the packet until the disclosure of the key in its associated disclosure interval. In order to be able to verify the validity of the key, the client has to be loosely time synchronized to the server. This has to be accomplished during the initial client server exchange between broadcast client and server. For a more detailed description of the TESLA protocol see Appendix D.
Note that this section currently describes the realization of the message format of NTS only for its utilization for NTP, in which the NTS specific data are enclosed in extension fields on top of NTP packets. A specification of NTS messages for PTP would have to be developed accordingly.
The steps described in Section 6.1 - Section 6.4 belong to the unicast mode, while Section 6.5 and Section 6.6 explain the steps involved in the broadcast mode of NTS.
In this message exchange, the hash and signature algorithms that are used throughout the protocol are negotiated.
The protocol sequence starts with the client sending an association message, called client_assoc. This message contains
For NTP, this message is realized as a packet with an extension field of type "association", which contains all this data.
This message is sent by the server upon receipt of client_assoc. It contains
In the case of NTP, the data is enclosed in a packet's extension field, also of type "association".
In this message exchange, the client receives the certification chain up to a trusted anchor. With the established certification chain the client is able to verify the server's signatures and, hence, authenticity of future NTS messages from the server is ensured.
Discussion:
This message is sent by the client, after it successfully verified the content of the received server_assoc message (see Section 7.1.1). It contains
In the case of NTP, the data is enclosed in a packet's extension field of type "certificate request".
This message is sent by the server, upon receipt of a client_cert message, if the version number and choice of methods communicated in that message are actually supported by the server. It contains
This message is realized for NTP as a packet with extension field of type "certificate" which holds all of the data listed above.
During this message exchange, the server transmits a secret cookie to the client securely. The cookie will be used for integrity protection during unicast time synchronization.
This message is sent by the client, upon successful authentication of the server. In this message, the client requests a cookie from the server. The message contains
For NTP, an extension field of type "cookie request" holds the listed data.
This message is sent by the server, upon receipt of a client_cook message. The server generates the hash of the client's certificate, as conveyed during client_cook, in order to calculate the cookie according to Section 5.1. This message contains a concatenated datum, which is encrypted with the client's public key, according to the encryption algorithm transmitted in the client_cook message. The concatenated datum contains
This signature MUST be calculated according to the transmitted signature algorithm from the client_cook message.
In the case of NTP, this is a packet with an extension field of type "cookie transmit".
In this message exchange, the usual time synchronization process is executed, with the addition of integrity protection for all messages that the server sends. This message can be repeatedly exchanged as often as the client desires and as long as the integrity of the server's time responses is verified successfully.
This message is sent by the client when it requests time exchange. It contains
In the case of NTP the data is enclosed in the packet's extension field of type "time request".
This message is sent by the server, after it received a time_request message. Prior to this the server MUST recalculate the client's cookie by using the hash of the client's certificate and the transmitted hash algorithm. The message contains
In the case of NTP, this is a packet with the necessary time synchronization data and a new extension field of type "time response". This packet has an appended MAC that is generated over the time synchronization data and the extension field, with the cookie as the key.
In this message exchange, the client receives the necessary information to execute the TESLA protocol in a secured broadcast association. The client can only initiate a secure broadcast association after a successful unicast run, see Section 7.1.2.
See Appendix D for more details on TESLA.
This message is sent by the client in order to establish a secured time broadcast association with the server. It contains
For NTP, this message is realized as a packet with an extension field of type "broadcast request".
This message is sent by the server upon receipt of a client_bpar message during the broadcast loop of the server. It contains
It is realized for NTP as a packet with an extension field of type "broadcast parameters", which contains all the given data.
Via this message, the server keeps sending broadcast time synchronization messages to all participating clients.
This message is sent by the server over the course of its broadcast schedule. It is part of any broadcast association. It contains
For NTP, this message is realized as an NTP broadcast packet with the time broadcast data and with an extension field of type "broadcast message", which contains the rest of the listed data. The NTP packet is then appended by a MAC verifying its contents.
For a unicast run, the client performs the following steps: Figure 1.
If one of the checks fails, the client MUST abort the run.
If one of those checks fails, the client MUST abort the run.
If at least one of the first three checks fails (i.e. if the version number does not match, if the client has never used the nonce transmitted in the time_response message or if it has used the nonce with initial time synchronization data different from that in the response), then the client MUST ignore this time_response message. If the MAC is invalid, the client MUST do one of the following: abort the run or go back to step 5 (because the cookie might have changed due to a server seed refresh). If both checks are successful, the client SHOULD continue time synchronization by going back to step 7.
The client's behavior in unicast mode is also expressed in
To establish a secure broadcast association with a broadcast server, the client MUST initially authenticate the broadcast server and securely synchronize its time to it up to an upper bound for its time offset in unicast mode. After that, the client performs the following steps: Section 6.5.1 if the one-way key chain expires.
If any information is missing or the server's signature cannot be verified, the client MUST abort the broadcast run. If all checks are successful, the client MUST remember all the broadcast parameters received for later checks.
See RFC 4082
[RFC4082] for a detailed description of the packet verification process.The client MUST restart the broadcast sequence with a client_bpar message
The client's behavior in broadcast mode can also be seen in Figure 2.
To support unicast mode, the server MUST be ready to perform the following actions: Section 8.1).
The server MUST refresh its server seed periodically (see
A broadcast server MUST also support unicast mode, in order to provide the initial time synchronization which is a precondition for any broadcast association. To support NTS broadcast, the server MUST additionally be ready to perform the following actions:
It is also the server's responsibility to watch for the expiration date of the one-way key chain and generate a new key chain accordingly.
The server has to calculate a random seed which has to be kept secret. The server MUST generate a seed for each supported hash algorithm, see Section 9.1.
According to the requirements in [I-D.ietf-tictoc-security-requirements] the server MUST refresh each server seed periodically. As a consequence, the cookie memorized by the client becomes obsolete. In this case the client cannot verify the MAC attachted to subsequent time response messages and has to respond accordingly by re-initiating the protocol with a cookie request (Section 6.3).
Hash algorithms are used at different points: calculation of the cookie and the MAC, and hashing of the client's certificate. Client and server negotiate a hash algorithm H during the association message exchange (Section 6.1) at the beginning of a unicast run. The selected algorithm H is used for all hashing processes in that run.
In broadcast mode, hash algorithms are used as pseudo random functions to construct the one-way key chain. Here, the utilized hash algorithm is communicated by the server and non-negotiable.
The list of the hash algorithms supported by the server has to fulfill the following requirements:
Note
For the calculation of the MAC, client and server are using a Keyed-Hash Message Authentication Code (HMAC) approach [RFC2104]. The HMAC is generated with the hash algorithm specified by the client (see Section 9.1).
The client has to verify the validity of the certificates during the certification message exchange (Section 6.2). Since it generally has no reliable time during this initial communication phase, it is impossible to verify the period of validity of the certificates. Therefore, the client MUST use one of the following approaches:
According to Section 8.1, it is the client's responsibility to initiate a new association with the server after the server's certificate expires. To this end the client reads the expiration date of the certificate during the certificate message exchange (Section 6.2). Besides, certificates may also be revoked prior to the normal expiration date. To increase security the client MAY verify the state of the server's certificate via OCSP periodically.
The certification based authentication scheme described in Section 6 is not applicable to the concept of NTP pools. Therefore, NTS is not able to provide secure usage of NTP pools.
TESLA authentication buffers packets for delayed authentication. This makes the protocol vulnerable to flooding attacks, causing the client to buffer excessive numbers of packets. To add stronger DoS protection to the protocol, client and server use the "Not Re-using Keys" scheme of TESLA as pointed out in section 3.7.2 of RFC 4082 [RFC4082]. In this scheme the server never uses a key for the MAC generation more than once. Therefore the client can discard any packet that contains a disclosed key it knows already, thus preventing memory flooding attacks.
Note, an alternative approach to enhance TESLA's resistance against DoS attacks involves the addition of a group MAC to each packet. This requires the exchange of an additional shared key common to the whole group. This adds additional complexity to the protocol and hence is currently not considered in this document.
In a packet delay attack, an adversary with the ability to act as a MITM delays time synchronization packets between client and server asymmetrically [I-D.ietf-tictoc-security-requirements]. This prevents the client to measure the network delay, and hence its time offset to the server, accurately [Mizrahi]. The delay attack does not modifiy the content of the exchanged synchronization packets. Therefore cryptographic means are not feasible to mitigate this attack. However, serveral non-cryptographic precautions can be taken in order to detect this attack.
The authors would like to thank Steven Bellovin, David Mills and Kurt Roeckx for discussions and comments on the design of NTS. Also, thanks to Harlan Stenn for his technical review and specific text contributions to this document.
[I-D.ietf-tictoc-security-requirements] | Mizrahi, T., "Security Requirements of Time Protocols in Packet Switched Networks", Internet-Draft draft-ietf-tictoc-security-requirements-10, July 2014. |
[I-D.shpiner-multi-path-synchronization] | Shpiner, A., Tse, R., Schelp, C. and T. Mizrahi, "Multi-Path Time Synchronization", Internet-Draft draft-shpiner-multi-path-synchronization-03, February 2014. |
[Mizrahi] | Mizrahi, T., "A game theoretic analysis of delay attacks against time synchronization protocols", in Proceedings of Precision Clock Synchronization for Measurement Control and Communication, ISPCS 2012, pp. 1-6, September 2012. |
[RFC4086] | Eastlake, D., Schiller, J. and S. Crocker, "Randomness Requirements for Security", BCP 106, RFC 4086, June 2005. |
[Roettger] | Röttger, S., "Analysis of the NTP Autokey Procedures", February 2012. |
[Shpiner] | Shpiner, A., Revah, Y. and T. Mizrahi, "Multi-path Time Protocols", in Proceedings of Precision Clock Synchronization for Measurement Control and Communication, ISPCS 2013, pp. 1-6, September 2013. |
+---------------------+ |Association Messages | +----------+----------+ | v +---------------------+ |Certificate Messages | +----------+----------+ | +------------------------------>o | | | v | +---------------+ | |Cookie Messages| | +-------+-------+ | | | o<------------------------------+ | | | | v | | +-------------------+ | | |Time Sync. Messages| | | +---------+---------+ | | | | | v | | +-----+ | | |Check| | | +--+--+ | | | | | /------------------+------------------\ | | v v v | | .-----------. .-------------. .-------. | | ( MAC Failure ) ( Nonce Failure ) ( Success ) | | '-----+-----' '------+------' '---+---' | | | | | | | v v v | | +-------------+ +-------------+ +--------------+ | | |Discard Data | |Discard Data | |Sync. Process | | | +-------------+ +------+------+ +------+-------+ | | | | | | | | | v | +-----------+ +------------------>o-----------+
Figure 1: The client's behavior in NTS unicast mode.
+-----------------------------+ |Broadcast Parameter Messages | +--------------+--------------+ | o<--------------------------+ | | v | +-----------------------------+ | |Broadcast Time Sync. Message | | +--------------+--------------+ | | | +-------------------------------------->o | | | | | v | | +-------------------+ | | |Key and Auth. Check| | | +---------+---------+ | | | | | /----------------*----------------\ | | v v | | .---------. .---------. | | ( Verified ) ( Falsified ) | | '----+----' '----+----' | | | | | | v v | | +-------------+ +-------+ | | |Store Message| |Discard| | | +------+------+ +---+---+ | | | | | | v +---------o | +---------------+ | | |Check Previous | | | +-------+-------+ | | | | | /--------*--------\ | | v v | | .---------. .---------. | | ( Verified ) ( Falsified ) | | '----+----' '----+----' | | | | | | v v | | +-------------+ +-----------------+ | | |Sync. Process| |Discard Previous | | | +------+------+ +--------+--------+ | | | | | +-----------+ +-----------------------------------+
Figure 2: The client's behaviour in NTS broadcast mode.
In Section 6, some new extension fields for NTP packets are introduced. They are listed here again, for reference.
name | used in |
---|---|
"association" | client_assoc |
server_assoc | |
"certificate request" | client_cert |
"certificate" | server_cert |
"cookie request" | client_cook |
"cookie transmit" | server_cook |
"time request" | time_request |
"time response" | time_response |
"broadcast request" | client_bpar |
"broadcast parameters" | server_bpar |
"broadcast message" | server_broad |
The following table compares the NTS specifications against the TICTOC security requirements [I-D.ietf-tictoc-security-requirements].
Section | Requirement from I-D tictoc security-requirements-05 | Requirement level | NTS |
---|---|---|---|
5.1.1 | Authentication of Servers | MUST | OK |
5.1.1 | Authorization of Servers | MUST | OK |
5.1.2 | Recursive Authentication of Servers (Stratum 1) | MUST | OK |
5.1.2 | Recursive Authorization of Servers (Stratum 1) | MUST | OK |
5.1.3 | Authentication and Authorization of Slaves | MAY | - |
5.2 | Integrity protection. | MUST | OK |
5.4 | Protection against DoS attacks | SHOULD | OK |
5.5 | Replay protection | MUST | OK |
5.6 | Key freshness. | MUST | OK |
Security association. | SHOULD | OK | |
Unicast and multicast associations. | SHOULD | OK | |
5.7 | Performance: no degradation in quality of time transfer. | MUST | OK |
Performance: lightweight computation | SHOULD | OK | |
Performance: storage, bandwidth | SHOULD | OK | |
5.7 | Confidentiality protection | MAY | NO |
5.9 | Protection against Packet Delay and Interception Attacks | SHOULD | NA*) |
5.10 | Secure mode | MUST | - |
Hybrid mode | SHOULD | - |
*) See discussion in section Section 11.5.
For the broadcast mode, NTS adopts the TESLA protocol, which is based on a one-way key chain. This appendix provides details on the generation and usage of the one-way key chain collected and assembled from [RFC4082]. Note that NTS is using the "not re-using keys" scheme of TESLA as described in section 3.7.2. of [RFC4082].
Server setup:
The server SHOULD calculate d according to
where ceil gives the smallest integer greater than or equal to its argument.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Generation of Keys F F F F K_0 <-------- K_1 <-------- ... <-------- K_{n-1} <-------- K_n | | | | | | | | | F' | F' | F' | F' | | | | v v v v K'_0 K'_1 ... K'_{n-1} K'_n [______________|____ ____|_________________|__________] I_1 ... I_{n-1} I_n Course of Time/Usage of Keys - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
A Schematic explanation on the TESLA protocol's one-way key chain
A client needs the following information in order to participate in a TESLA broadcast.
Note that if D_t is greater than (d - 1) * L, then some authentic packets might be discarded. If D_t is greater than d * L, then all authentic packets will be discarded. In the latter case, the client should not participate in the broadcast, since there will be no benefit in doing so.
During each time interval I_i, the server sends one authenticated broadcast packet P_i. This packet consists of:
When a client receives a packet P_i as described above, it first checks that it has not received a packet with associated index i before. This is done to avoid replay/flooding attacks. A packet that fails this test is discarded.
Next, the client checks that, according to the disclosure schedule and with respect to the upper bound D_t determined above, the server cannot have disclosed the key K_i yet. Specifically, it needs to check that the server's clock cannot read a time that is in time interval I_{i+d} or later. Since it works under the assumption that the server's clock is not more than D_t "ahead" of the client's clock, the client can calculate an upper bound t_i for the server's clock at the time when P_i arrived by
where R is the client's clock at the arrival of P_i. This implies that at the time of arrival of P_i, the server could have been in interval I_x at most, with[RFC4082]). If falsified, it is discarded.
where floor gives the greatest integer less than or equal to its argument. The client now needs to verify that
is valid (see also section 3.5 of
Next the client verifies that a newly disclosed key K_{i-d} belongs to the one-way key chain. To this end it verifies identity with some earlier disclosed key by recursively applies the one-way function F to K_{i-d} (see Clause 3.5 in RFC 4082, item 3).
If a packet P_i passes all tests listed above, it is stored for later authentication. Also, if at this time there is a package with index i-d already buffered, then the client uses the disclosed key K_{i-d} to derive K'_{i-d} and uses that to check the MAC included in package P_{i-d}. On success, it regards M_{i-d} as authenticated.
At various points of the protocol, the generation of random numbers is required. The employed methods of generation need to be cryptographically secure. See [RFC4086] for guidelines concerning this topic.