NTP Working Group | D. Sibold |
Internet-Draft | PTB |
Intended status: Standards Track | S. Röttger |
Expires: September 22, 2016 | Google Inc |
K. Teichel | |
PTB | |
March 21, 2016 |
Using the Network Time Security Specification to Secure the Network Time Protocol
draft-ietf-ntp-using-nts-for-ntp-05
This document describes how to use the measures described in the Network Time Security (NTS) specification to secure time synchronization with servers using the Network Time Protocol (NTP).
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 September 22, 2016.
Copyright (c) 2016 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.
One of the most popular time synchronization protocols, the Network Time Protocol (NTP) [RFC5905], currently does not provide adequate intrinsic security precautions. The Network Time Security draft [I-D.ietf-ntp-network-time-security] specifies security measures which can be used to enable time synchronization protocols to verify authenticity of the time server and integrity of the time synchronization protocol packets.
This document provides detail on how to specifically use those measures to secure time synchronization between NTP clients and servers.
The objectives of the Network Time Security (NTS) specification are as follows:
The server does not keep a state of the client. NTS initially verifies the authenticity of the time server and exchanges a symmetric key, the so-called cookie and a key input value (KIV). The "access", "association", and "cookie" message exchanges described in [I-D.ietf-ntp-network-time-security], Appendix B., can be utilized for the exchange of the cookie and KIV. An implementation MUST support the use of these exchanges. It MAY additionally support the use of any alternative secure communication for this purpose, as long as it fulfills the preconditions given in [I-D.ietf-ntp-network-time-security], Section 6.1.1.
After the cookie and KIV are exchanged, the participants then use them to protect the authenticity and the integrity of subsequent unicast-type time synchronization packets. In order to do this, the server attaches a Message Authentication Code (MAC) 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. Therefore, the client can perform a validity check for this MAC on reception of a time synchronization packet.
After the client has accomplished the necessary initial time synchronization via client-server mode, the necessary broadcast parameters are communicated from the server to the client. The "broadcast parameter" message exchange described in [I-D.ietf-ntp-network-time-security], Appendix B., can be utilized for this communication. An implementation MUST support the use of this exchange. It MAY additionally support the use of any alternative secure communication for this purpose, as long as it fulfills the necessary security goals (given in [I-D.ietf-ntp-network-time-security], Section 6.2.1.).
After the client has received the necessary broadcast parameters, "broadcast time synchronization" message exchanges are utilized in combination with optional "broadcast keycheck" exchanges to protect authenticity and integrity of NTP broadcast time synchronization packets. As in the case of unicast time synchronization messages, this is also achieved by MACs.
Throughout this section, the access key, server seed, the nonces, cookies and MACs mentioned have bit lengths of B_accesskey, B_seed, B_nonce, B_cookie and B_mac, respectively. These bit lengths are defined in Appendix B [appendix_bit_lengths]. If a message requires a MAC to cover its contents, this MAC MUST be calculated according to:Section 6), and where key is the cookie for the given association.
where the application of the function MSB_<B_mac> returns only the B_mac most significant bits, where content is composed of the NTP header and all extension fields prior to the MAC-carrying extension field (see
Note for clarification that different message exchanges use different nonces. A nonce is always generated by the client for a request message, and then used by the server in its response. After this, it is not to be used again.
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 repeating the exchange of time_request and time_response messages.
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 with it up to an upper bound for its time offset in unicast mode. After that, the client performs the following steps: [I-D.ietf-ntp-network-time-security]) if the one-way key chain expires.
If any information is missing or if 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:
If the time_request message was received in the context of an NTP peer association, the server MUST look up whether it has information about the authentication and authorization status for the given hash value of the client's certificate. If it does not, it MUST NOT use the NTP message contents for adjusting its own clock.
In addition to items above, the server MAY be ready to perform the following action:
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:
The server is responsible to watch for the expiration date of the one-way key chain and generate a new key chain accordingly.
In addition to the items above, the server MAY be ready to perform the following action:
This section presents some hints about the structures of the communication packets for the different message types when one wishes to implement NTS for NTP. See document [I-D.ietf-ntp-cms-for-nts-message] for descriptions of the archetypes for CMS structures as well as for the ASN.1 structures that are referenced here.
The NTP extension field structure is defined in RFC 5905 [RFC5905] and clarified in [I-D.ietf-ntp-extension-field]. It looks as follows:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Type | Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . Value . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Padding (as needed) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
All extension fields mentioned in the rest of this section do not require an NTP MAC field. If nothing else is explicitly stated, all of those extension fields MUST have a length of at least 28 octets.
Furthermore, all extension fields mentioned in the rest of this section are notified by one of three Field Type identifiers, signaling content related to NTS:
Field Type | ASN.1 Object of NTS Message |
---|---|
TBD1 | ClientAccessData, ServerAccessData |
TBD1 | ClientAssocData, ServerAssocData |
TBD1 | ClientCookieData, ServerCookieData |
TBD1 | BroadcastParameterRequest, BroadcastParameterResponse |
TBD2 | TimeRequestSecurityData, TimeResponseSecurityData |
TBD2 | BroadcastTime |
TBD2 | ClientKeyCheckSecurityData, ServerKeyCheckSecurityData |
TBD3 | NTSMessageAuthenticationCode |
(see IANA considerations [IANA]).
The outermost structure of the extension field's Value field MUST be an ASN.1 object that is structured as follows:
NTSExtensionFieldContent := SEQUENCE { oid OBJECT IDENTIFIER, errnum OCTET STRING (SIZE(2)), content ANY DEFINED BY oid }
The field errnum represents the error code of any message. The client and server MAY ignore this field in any incoming message. The server MUST set this to zero if the response to the request was generated successfully. If it could not successfully generate a response, the field errnum MUST be set to a non-zero value. The different values of this field is defined in the Appendix C.
Whenever NTS requires a MAC for protection of a message, this MAC MUST be included in an additional extension field. This MAC-carrying extension field MUST be placed after the other NTS-related extension field, and it SHOULD be the last extension field of the message. Any MAC supplied by NTS in a MAC-carrying extension field MUST be generated over the NTP header and all extension fields prior to the MAC-carrying extension field.
Content MAY be added to an NTS-protected NTP message after the MAC provided by NTS. However, it is RECOMMENDED to not make use of this option and to apply the MAC protection of NTS to the whole of an NTP message.
The MAC-carrying extension field contains an NTSExtensionFieldContent object, whose content field is structured according to NTS-Plain. The included NTS message object is as follows:
NTSMessageAuthenticationCode := SEQUENCE { mac OCTET STRING (SIZE(16)) }
It is identified by the following object identifier:
id-ct-nts-ntsForNtpMessageAuthenticationCode OBJECT IDENTIFIER ::= TBD4
This message is realized as an NTP packet with an extension field which holds an "NTS-Plain" archetype structure. This structure consists only of an NTS message object of the type "ClientAccessData".
Like "client_access", this message is realized as an NTP packet with an extension field which holds an "NTS-Plain" archetype structure, i.e. just an NTS message object of the type "ServerAccessData". The latter holds all the data necessary for NTS.
This message is realized as an NTP packet with an extension field which holds an "NTS-Plain" archetype structure. This structure consists only of an NTS message object of the type "ClientAssocData", which holds all the data necessary for the NTS security mechanisms.
Like "client_assoc", this message is realized as an NTP packet with an extension field which holds an "NTS-Plain" archetype structure, i.e. just an NTS message object of the type "ServerAssocData". The latter holds all the data necessary for NTS.
This message type is realized as an NTP packet with an extension field which holds a CMS structure of archetype "NTS-Plain", containing in its core an NTS message object of the type "ClientCookieData". The latter holds all the data necessary for the NTS security mechanisms.
This message type is realized as an NTP packet with an extension field containing a CMS structure of archetype "NTS-Encrypted-and-Signed". The NTS message object in that structure is a "ServerCookieData" object, which holds all data required by NTS for this message type.
This message type is realized as an NTP packet with regular NTP time synchronization data. Furthermore, the packet has an extension field which contains an ASN.1 object of type "TimeRequestSecurityData" (packed in a CMS structure of archetype "NTS-Plain"). Finally, this message MUST be protected by a MAC.
This message is also realized as an NTP packet with regular NTP time synchronization data. The packet also has an extension field which contains an ASN.1 object of type "TimeResponseSecurityData". Finally, this message MUST be protected by a MAC.
This first broadcast message is realized as an NTP packet which is empty except for an extension field which contains an ASN.1 object of type "BroadcastParameterRequest" (packed in a CMS structure of archetype "NTS-Plain"). This is sufficient to transport all data specified by NTS.
This message type is realized as an NTP packet whose extension field carries the necessary CMS structure (archetype: "NTS-Signed"). The NTS message object in this case is an ASN.1 object of type "BroadcastParameterResponse".
This message's realization works via an NTP packet which carries regular NTP broadcast time data as well as an extension field, which contains an ASN.1 object of type "BroadcastTime" (packed in a CMS structure with archetype "NTS-Plain"). Finally, this message MUST be protected by a MAC.
This message is realized as an NTP packet with an extension field, which transports a CMS structure of archetype "NTS-Plain", containing an ASN.1 object of type "ClientKeyCheckSecurityData". Finally, this message MUST be protected by a MAC.
This message is also realized as an NTP packet with an extension field, which contains an ASN.1 object of type "ServerKeyCheckSecurityData" (packed in a CMS structure of archetype "NTS-Plain"). Finally, this message MUST be protected by a MAC.
Within the "NTP Extensions Field Types" registry table, add the field types:
Field Type Meaning References ---------- ------------------------------------ ---------- TBD1 NTS-Related Content [this doc] TBD2 NTS-Related Content [this doc] TBD3 NTS-Related Content [this doc]
Within the "SMI Security for S/MIME CMS Content Type (1.2.840.113549.1.9.16.1)" table, add one content type identifier:
Decimal Description References ------- -------------------------------------------- ---------- TBD4 id-ct-nts-ntsForNtpMessageAuthenticationCode [this doc]
All security considerations described in [I-D.ietf-ntp-network-time-security] have to be taken into account. The application of NTS to NTP requires the following additional considerations.
If an implementation uses alternative means to perform access, association and cookie exchange, it MUST make sure that an adversary cannot abuse the server to obtain a cookie belonging to a chosen KIV.
The certification-based authentication scheme described in [I-D.ietf-ntp-network-time-security] is not applicable to the concept of NTP pools. Therefore, NTS is unable to provide secure usage of NTP pools.
According to Clause 5.6.1 in RFC 7384 [RFC7384] the server MUST provide a means to refresh the value of its server seed from time to time. A generally valid value for the server seed lifetime cannot be given. The value depends on the required security level, the current threat situation, and the chosen MAC mechanisms.
As guidance, a value for the lifetime can be determined by stipulating a maximum number of time requests for which the exchanged cookie remains unchanged. For example, if this value is 1000 and the client sends a time request every 64 seconds, the server seed lifetime should be no longer than 64000 seconds. Corresponding considerations can be made for a minimum number of requests.
The list of the MAC algorithms supported by the server has to fulfill the following requirements:
Any NTS message providing access, association, or cookie exchange can be encapsulated in NTP an extension field which is piggybacked onto an NTP packet. NTS does not itself provide MAC protection to the NTP header of such a packet, because it only offers MAC protection to the NTP header once the cookie has been successfully exchanged.
The authors would like to thank Russ Housley, Steven Bellovin, David Mills and Kurt Roeckx for discussions and comments on the design of NTS. Also, thanks to Harlan Stenn, Danny Mayer, Richard Welty and Martin Langer for their technical review and specific text contributions to this document.
[RFC7384] | Mizrahi, T., "Security Requirements of Time Protocols in Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384, October 2014. |
+---------------+ |Access Messages| +-------+-------+ | v +---------------------+ |Association 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.
Define the following bit lengths for server seed, nonces, cookies and MACs:
Bit | Meaning |
---|---|
1 | D2 |