idnits 2.17.1 draft-ietf-ntp-using-nts-for-ntp-12.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (July 01, 2018) is 2119 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '0' on line 312 -- Looks like a reference, but probably isn't: '1' on line 312 ** Downref: Normative reference to an Informational RFC: RFC 5297 ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) ** Obsolete normative reference: RFC 7507 (Obsoleted by RFC 8996) == Outdated reference: A later version (-04) exists of draft-ietf-ntp-data-minimization-00 -- Obsolete informational reference (is this intentional?): RFC 5077 (Obsoleted by RFC 8446) Summary: 3 errors (**), 0 flaws (~~), 2 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 NTP Working Group D. Franke 3 Internet-Draft 4 Intended status: Standards Track D. Sibold 5 Expires: January 2, 2019 K. Teichel 6 PTB 7 July 01, 2018 9 Network Time Security for the Network Time Protocol 10 draft-ietf-ntp-using-nts-for-ntp-12 12 Abstract 14 This memo specifies Network Time Security (NTS), a mechanism for 15 using Transport Layer Security (TLS) and Authenticated Encryption 16 with Associated Data (AEAD) to provide cryptographic security for the 17 Network Time Protocol. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on January 2, 2019. 36 Copyright Notice 38 Copyright (c) 2018 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (https://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 54 1.1. Objectives . . . . . . . . . . . . . . . . . . . . . . . 3 55 1.2. Protocol overview . . . . . . . . . . . . . . . . . . . . 4 56 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 5 57 3. TLS profile for Network Time Security . . . . . . . . . . . . 5 58 4. The NTS Key Establishment protocol . . . . . . . . . . . . . 6 59 4.1. NTS-KE Record Types . . . . . . . . . . . . . . . . . . . 8 60 4.1.1. End of Message . . . . . . . . . . . . . . . . . . . 8 61 4.1.2. NTS Next Protocol Negotiation . . . . . . . . . . . . 9 62 4.1.3. Error . . . . . . . . . . . . . . . . . . . . . . . . 9 63 4.1.4. Warning . . . . . . . . . . . . . . . . . . . . . . . 10 64 4.1.5. AEAD Algorithm Negotiation . . . . . . . . . . . . . 10 65 4.1.6. New Cookie for NTPv4 . . . . . . . . . . . . . . . . 11 66 4.2. Key Extraction (generally) . . . . . . . . . . . . . . . 11 67 5. NTS Extension Fields for NTPv4 . . . . . . . . . . . . . . . 11 68 5.1. Key Extraction (for NTPv4) . . . . . . . . . . . . . . . 11 69 5.2. Packet structure overview . . . . . . . . . . . . . . . . 12 70 5.3. The Unique Identifier extension field . . . . . . . . . . 12 71 5.4. The NTS Cookie extension field . . . . . . . . . . . . . 13 72 5.5. The NTS Cookie Placeholder extension field . . . . . . . 13 73 5.6. The NTS Authenticator and Encrypted Extension Fields 74 extension field . . . . . . . . . . . . . . . . . . . . . 13 75 6. Protocol details . . . . . . . . . . . . . . . . . . . . . . 15 76 7. Suggested format for NTS cookies . . . . . . . . . . . . . . 18 77 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 78 9. Implementation Status . . . . . . . . . . . . . . . . . . . . 24 79 9.1. Implementation PoC 1 . . . . . . . . . . . . . . . . . . 24 80 9.1.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 24 81 9.1.2. Licensing . . . . . . . . . . . . . . . . . . . . . . 24 82 9.1.3. Contact Information . . . . . . . . . . . . . . . . . 25 83 9.1.4. Last Update . . . . . . . . . . . . . . . . . . . . . 25 84 9.2. Implementation PoC 2 . . . . . . . . . . . . . . . . . . 25 85 9.2.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 25 86 9.2.2. Licensing . . . . . . . . . . . . . . . . . . . . . . 25 87 9.2.3. Contact Information . . . . . . . . . . . . . . . . . 25 88 9.2.4. Last Update . . . . . . . . . . . . . . . . . . . . . 25 89 9.3. Interoperability . . . . . . . . . . . . . . . . . . . . 25 90 10. Security considerations . . . . . . . . . . . . . . . . . . . 26 91 10.1. Avoiding DDoS amplification . . . . . . . . . . . . . . 26 92 10.2. Initial verification of server certificates . . . . . . 26 93 10.3. Usage of NTP pools . . . . . . . . . . . . . . . . . . . 27 94 10.4. Delay attacks . . . . . . . . . . . . . . . . . . . . . 27 95 10.5. Random number generation . . . . . . . . . . . . . . . . 28 97 11. Privacy Considerations . . . . . . . . . . . . . . . . . . . 28 98 11.1. Unlinkability . . . . . . . . . . . . . . . . . . . . . 28 99 11.2. Confidentiality . . . . . . . . . . . . . . . . . . . . 29 100 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 29 101 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 29 102 13.1. Normative References . . . . . . . . . . . . . . . . . . 29 103 13.2. Informative References . . . . . . . . . . . . . . . . . 31 104 Appendix A. Terms and Abbreviations . . . . . . . . . . . . . . 32 105 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32 107 1. Introduction 109 This memo specifies Network Time Security (NTS), a cryptographic 110 security mechanism for network time synchronization. A complete 111 specification is provided for application of NTS to the client-server 112 mode of the Network Time Protocol (NTP) [RFC5905]. 114 1.1. Objectives 116 The objectives of NTS are as follows: 118 o Identity: Through the use of the X.509 PKI, implementations may 119 cryptographically establish the identity of the parties they are 120 communicating with. 122 o Authentication: Implementations may cryptographically verify that 123 any time synchronization packets are authentic, i.e., that they 124 were produced by an identified party and have not been modified in 125 transit. 127 o Confidentiality: Although basic time synchronization data is 128 considered non-confidential and sent in the clear, NTS includes 129 support for encrypting NTP extension fields. 131 o Replay prevention: Client implementations may detect when a 132 received time synchronization packet is a replay of a previous 133 packet. 135 o Request-response consistency: Client implementations may verify 136 that a time synchronization packet received from a server was sent 137 in response to a particular request from the client. 139 o Unlinkability: For mobile clients, NTS will not leak any 140 information additional to NTP which would permit a passive 141 adversary to determine that two packets sent over different 142 networks came from the same client. 144 o Non-amplification: Implementations (especially server 145 implementations) may avoid acting as DDoS amplifiers by never 146 responding to a request with a packet larger than the request 147 packet. 149 o Scalability: Server implementations may serve large numbers of 150 clients without having to retain any client-specific state. 152 1.2. Protocol overview 154 The Network Time Protocol includes many different operating modes to 155 support various network topologies. In addition to its best-known 156 and most-widely-used client-server mode, it also includes modes for 157 synchronization between symmetric peers, a control mode for server 158 monitoring and administration and a broadcast mode. These various 159 modes have differing and partly contradictory requirements for 160 security and performance. Symmetric and control modes demand mutual 161 authentication and mutual replay protection, and for certain message 162 types control mode may require confidentiality as well as 163 authentication. Client-server mode places more stringent 164 requirements on resource utilization than other modes, because 165 servers may have vast number of clients and be unable to afford to 166 maintain per-client state. However, client-server mode also has more 167 relaxed security needs, because only the client requires replay 168 protection: it is harmless for stateless servers to process replayed 169 packets. The security demands of symmetric and control modes, on the 170 other hand, are in conflict with the resource-utilization demands of 171 client-server mode: any scheme which provides replay protection 172 inherently involves maintaining some state to keep track of what 173 messages have already been seen. 175 This memo specifies NTS exclusively for the client-server mode of 176 NTP. To this end, NTS is structured as a suite of two protocols: 178 The "NTS Extension Fields for NTPv4" are a collection of NTP 179 extension fields for cryptographically securing NTPv4 using 180 previously-established key material. They are suitable for 181 securing client-server mode because the server can implement them 182 without retaining per-client state, but on the other hand are 183 suitable *only* for client-server mode because only the client, 184 and not the server, is protected from replay. 186 The "NTS Key Establishment" protocol (NTS-KE) is a mechanism for 187 establishing key material for use with the NTS Extension Fields 188 for NTPv4. It uses TLS to exchange keys and negotiate some 189 additional protocol options, but then quickly closes the TLS 190 channel and permits the server to discard all associated state. 192 The typical protocol flow is as follows. The client connects to the 193 server on the NTS TCP port and the two parties perform a TLS 194 handshake. Via the TLS channel, the parties negotiate some 195 additional protocol parameters and the server sends the client a 196 supply of cookies. The parties use TLS key export [RFC5705] to 197 extract key material which will be used in the next phase of the 198 protocol. This negotiation takes only a single round trip, after 199 which the server closes the connection and discards all associated 200 state. At this point the NTS-KE phase of the protocol is complete. 202 Time synchronization proceeds over the NTP UDP port. The client 203 sends the server an NTP client packet which includes several 204 extension fields. Included among these fields are a cookie 205 (previously provided by the server), and an authentication tag, 206 computed using key material extracted from the NTS-KE handshake. The 207 server uses the cookie to recover this key material (previously 208 discarded to avoid maintaining state) and sends back an authenticated 209 response. The response includes a fresh, encrypted cookie which the 210 client then sends back in the clear with its next request. (This 211 constant refreshing of cookies is necessary in order to achieve NTS's 212 unlinkability goal.) 214 2. Requirements Language 216 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 217 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 218 document are to be interpreted as described in RFC 2119 [RFC2119]. 220 3. TLS profile for Network Time Security 222 Network Time Security makes use of TLS for NTS key establishment. 224 Since securing time protocols is (as of 2017) a novel application of 225 TLS, no backward-compatibility concerns exist to justify using 226 obsolete, insecure, or otherwise broken TLS features or versions. We 227 therefore put forward the following requirements and guidelines, 228 roughly representing 2017's best practices. 230 Implementations MUST NOT negotiate TLS versions earlier than 1.2. 232 Implementations willing to negotiate more than one possible version 233 of TLS SHOULD NOT respond to handshake failures by retrying with a 234 downgraded protocol version. If they do, they MUST implement 235 [RFC7507]. 237 TLS clients MUST NOT offer, and TLS servers MUST NOT select, RC4 238 cipher suites. [RFC7465] 239 TLS 1.2 clients SHOULD offer, and TLS servers SHOULD accept, the TLS 240 Renegotiation Indication Extension [RFC5746]. Regardless, they MUST 241 NOT initiate or permit insecure renegotiation. 243 TLS 1.2 clients SHOULD offer, and TLS 1.2 servers SHOULD accept, the 244 TLS Session Hash and Extended Master Secret Extension [RFC7627]. 246 Use of the Application-Layer Protocol Negotiation Extension [RFC7301] 247 is integral to NTS and support for it is REQUIRED for 248 interoperability. 250 4. The NTS Key Establishment protocol 252 The NTS key establishment protocol is conducted via TCP port 253 [[TBD1]]. The two endpoints carry out a TLS handshake in conformance 254 with Section 3, with the client offering (via an ALPN [RFC7301] 255 extension), and the server accepting, an application-layer protocol 256 of "ntske/1". Immediately following a successful handshake, the 257 client SHALL send a single request (as Application Data encapsulated 258 in the TLS-protected channel), then the server SHALL send a single 259 response followed by a TLS "Close notify" alert and then discard the 260 channel state. 262 The client's request and the server's response each SHALL consist of 263 a sequence of records formatted according to Figure 1. The sequence 264 SHALL be terminated by a "End of Message" record, which has a Record 265 Type of zero and a zero-length body. Furthermore, requests and non- 266 error responses each SHALL include exactly one NTS Next Protocol 267 Negotiation record. 269 Clients and servers MAY enforce length limits on requests and 270 responses, however servers MUST accept requests of at least 1024 271 octets, and clients SHOULD accept responses of at least 65536 octets. 273 0 1 2 3 274 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 275 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 276 |C| Record Type | Body Length | 277 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 278 | | 279 . . 280 . Record Body . 281 . . 282 | | 283 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 285 Figure 1 287 The requirement that all NTS-KE messages be terminated by an End of 288 Message record makes them self-delimiting. 290 The fields of an NTS-KE record are defined as follows: 292 C (Critical Bit): Determines the disposition of unrecognized 293 Record Types. Implementations which receive a record with an 294 unrecognized Record Type MUST ignore the record if the Critical 295 Bit is 0, and MUST treat it as an error if the Critical Bit is 1. 297 Record Type: A 15-bit integer in network byte order. The 298 semantics of record types 0-5 are specified in this memo; 299 additional type numbers SHALL be tracked through the IANA Network 300 Time Security Key Establishment Record Types registry. 302 Body Length: The length of the Record Body field, in octets, as a 303 16-bit integer in network byte order. Record bodies MAY have any 304 representable length and need not be aligned to a word boundary. 306 Record Body: The syntax and semantics of this field SHALL be 307 determined by the Record Type. 309 For clarity regarding bit-endianness: the Critical Bit is the most- 310 significant bit of the first octet. In C, given a network buffer 311 `unsigned char b[]` containing an NTS-KE record, the critical bit is 312 `b[0] >> 7` while the record type is `((b[0] & 0x7f) << 8) + b[1]`. 314 Figure 2 provides a schematic overview of the key exchange. It 315 displays the protocol steps to be performed by the NTS client and 316 server and record types to be exchanged. 318 +---------------------------------------+ 319 | - verify client request message | 320 | - extract TLS key material | 321 | - generate KE response message | 322 | - included Record Types: | 323 | - NTS Next Protocol Negotiation | 324 | - AEAD Alg. Negotiation | 325 | - New Cookie for NTPv4 | 326 | - | 327 | - End of Message | 328 +-----------------+---------------------+ 329 | 330 | 331 Server -----------+---------------+-----+-----------------------> 332 ^ \ 333 / \ 334 / TLS application \ 335 / data \ 336 / \ 337 / V 338 Client -----+---------------------------------+----------------> 339 | | 340 | | 341 | | 342 +-----------+----------------------+ +------+-----------------+ 343 |- generate KE request message | |- verify server response| 344 | - include Record Types: | | message | 345 | o NTS Next Protocol Negotiation | |- extract cookie(s) | 346 | o AEAD Alg. Negotiation | | | 347 | o End of Message | | | 348 +----------------------------------+ +------------------------+ 350 Figure 2: NTS Key Exchange messages 352 4.1. NTS-KE Record Types 354 The following NTS-KE Record Types are defined. 356 4.1.1. End of Message 358 The End of Message record has a Record Type number of 0 and an zero- 359 length body. It MUST occur exactly once as the final record of every 360 NTS-KE request and response. The Critical Bit MUST be set. 362 4.1.2. NTS Next Protocol Negotiation 364 The NTS Next Protocol Negotiation record has a Record Type of 1. It 365 MUST occur exactly once in every NTS-KE request and response. Its 366 body consists of a sequence of 16-bit unsigned integers in network 367 byte order. Each integer represents a Protocol ID from the IANA 368 Network Time Security Next Protocols registry. The Critical Bit MUST 369 be set. 371 The Protocol IDs listed in the client's NTS Next Protocol Negotiation 372 record denote those protocols which the client wishes to speak using 373 the key material established through this NTS-KE session. The 374 Protocol IDs listed in the server's response MUST comprise a subset 375 of those listed in the request, and denote those protocols which the 376 server is willing and able to speak using the key material 377 established through this NTS-KE session. The client MAY proceed with 378 one or more of them. The request MUST list at least one protocol, 379 but the response MAY be empty. 381 4.1.3. Error 383 The Error record has a Record Type number of 2. Its body is exactly 384 two octets long, consisting of an unsigned 16-bit integer in network 385 byte order, denoting an error code. The Critical Bit MUST be set. 387 Clients MUST NOT include Error records in their request. If clients 388 receive a server response which includes an Error record, they MUST 389 discard any negotiated key material and MUST NOT proceed to the Next 390 Protocol. 392 The following error codes are defined. 394 Error code 0 means "Unrecognized Critical Record". The server 395 MUST respond with this error code if the request included a record 396 which the server did not understand and which had its Critical Bit 397 set. The client SHOULD NOT retry its request without 398 modification. 400 Error code 1 means "Bad Request". The server MUST respond with 401 this error if, upon the expiration of an implementation-defined 402 timeout, it has not yet received a complete and syntactically 403 well-formed request from the client. This error is likely to be 404 the result of a dropped packet, so the client SHOULD start over 405 with a new TLS handshake and retry its request. 407 4.1.4. Warning 409 The Warning record has a Record Type number of 3. Its body is 410 exactly two octets long, consisting of an unsigned 16-bit integer in 411 network byte order, denoting a warning code. The Critical Bit MUST 412 be set. 414 Clients MUST NOT include Warning records in their request. If 415 clients receive a server response which includes a Warning record, 416 they MAY discard any negotiated key material and abort without 417 proceeding to the Next Protocol. Unrecognized warning codes MUST be 418 treated as errors. 420 This memo defines no warning codes. 422 4.1.5. AEAD Algorithm Negotiation 424 The AEAD Algorithm Negotiation record has a Record Type number of 4. 425 Its body consists of a sequence of unsigned 16-bit integers in 426 network byte order, denoting Numeric Identifiers from the IANA AEAD 427 registry [RFC5116]. The Critical Bit MAY be set. 429 If the NTS Next Protocol Negotiation record offers Protocol ID 0 (for 430 NTPv4), then this record MUST be included exactly once. Other 431 protocols MAY require it as well. 433 When included in a request, this record denotes which AEAD algorithms 434 the client is willing to use to secure the Next Protocol, in 435 decreasing preference order. When included in a response, this 436 record denotes which algorithm the server chooses to use, or is empty 437 if the server supports none of the algorithms offered. In requests, 438 the list MUST include at least one algorithm. In responses, it MUST 439 include at most one. Honoring the client's preference order is 440 OPTIONAL: servers may select among any of the client's offered 441 choices, even if they are able to support some other algorithm which 442 the client prefers more. 444 Server implementations of NTS extension fields for NTPv4 (Section 5) 445 MUST support AEAD_AES_SIV_CMAC_256 [RFC5297] (Numeric Identifier 15). 446 That is, if the client includes AEAD_AES_SIV_CMAC_256 in its AEAD 447 Algorithm Negotiation record, and the server accepts Protocol ID 0 448 (NTPv4) in its NTS Next Protocol Negotiation record, then the 449 server's AEAD Algorithm Negotiation record MUST NOT be empty. 451 4.1.6. New Cookie for NTPv4 453 The New Cookie for NTPv4 record has a Record Type number of 5. The 454 contents of its body SHALL be implementation-defined and clients MUST 455 NOT attempt to interpret them. See Section 7 for a suggested 456 construction. 458 Clients MUST NOT send records of this type. Servers MUST send at 459 least one record of this type, and SHOULD send eight of them, if they 460 accept Protocol ID 0 (NTPv4) as a Next Protocol. The Critical Bit 461 SHOULD NOT be set. 463 4.2. Key Extraction (generally) 465 Following a successful run of the NTS-KE protocol, key material SHALL 466 be extracted according to RFC 5705 [RFC5705]. Inputs to the exporter 467 function are to be constructed in a manner specific to the negotiated 468 Next Protocol. However, all protocols which utilize NTS-KE MUST 469 conform to the following two rules: 471 The disambiguating label string MUST be "EXPORTER-network-time- 472 security/1". 474 The per-association context value MUST be provided, and MUST begin 475 with the two-octet Protocol ID which was negotiated as a Next 476 Protocol. 478 5. NTS Extension Fields for NTPv4 480 5.1. Key Extraction (for NTPv4) 482 Following a successful run of the NTS-KE protocol wherein Protocol ID 483 0 (NTPv4) is selected as a Next Protocol, two AEAD keys SHALL be 484 extracted: a client-to-server (C2S) key and a server-to-client (S2C) 485 key. These keys SHALL be computed according to RFC 5705 [RFC5705], 486 using the following inputs. 488 The disambiguating label string SHALL be "EXPORTER-network-time- 489 security/1". 491 The per-association context value SHALL consist of the following 492 five octets: 494 The first two octets SHALL be zero (the Protocol ID for NTPv4). 496 The next two octets SHALL be the Numeric Identifier of the 497 negotiated AEAD Algorithm, in network byte order. 499 The final octet SHALL be 0x00 for the C2S key and 0x01 for the 500 S2C key. 502 Implementations wishing to derive additional keys for private or 503 experimental use MUST NOT do so by extending the above-specified 504 syntax for per-association context values. Instead, they SHOULD use 505 their own disambiguating label string. Note that RFC 5705 provides 506 that disambiguating label strings beginning with "EXPERIMENTAL" MAY 507 be used without IANA registration. 509 5.2. Packet structure overview 511 In general, an NTS-protected NTPv4 packet consists of: 513 The usual 48-octet NTP header, which is authenticated but not 514 encrypted. 516 Some extension fields which are authenticated but not encrypted. 518 An extension field which contains AEAD output (i.e., an 519 authentication tag and possible ciphertext). The corresponding 520 plaintext, if non-empty, consists of some extension fields which 521 benefit from both encryption and authentication. 523 Possibly, some additional extension fields which are neither 524 encrypted nor authenticated. These are discarded by the receiver. 526 Always included among the authenticated or authenticated-and- 527 encrypted extension fields are a cookie extension field and a unique- 528 identifier extension field. The purpose of the cookie extension 529 field is to enable the server to offload storage of session state 530 onto the client. The purpose of the unique-identifier extension 531 field is to protect the client from replay attacks. 533 5.3. The Unique Identifier extension field 535 The Unique Identifier extension field has a Field Type of [[TBD2]]. 536 When the extension field is included in a client packet (mode 3), its 537 body SHALL consist of a string of octets generated uniformly at 538 random. The string MUST be at least 32 octets long. When the 539 extension field is included in a server packet (mode 4), its body 540 SHALL contain the same octet string as was provided in the client 541 packet to which the server is responding. Its use in modes other 542 than client-server is not defined. 544 The Unique Identifier extension field provides the client with a 545 cryptographically strong means of detecting replayed packets. It MAY 546 also be used standalone, without NTS, in which case it provides the 547 client with a means of detecting spoofed packets from off-path 548 attackers. Historically, NTP's origin timestamp field has played 549 both these roles, but for cryptographic purposes this is suboptimal 550 because it is only 64 bits long and, depending on implementation 551 details, most of those bits may be predictable. In contrast, the 552 Unique Identifier extension field enables a degree of 553 unpredictability and collision-resistance more consistent with 554 cryptographic best practice. 556 5.4. The NTS Cookie extension field 558 The NTS Cookie extension field has a Field Type of [[TBD3]]. Its 559 purpose is to carry information which enables the server to recompute 560 keys and other session state without having to store any per-client 561 state. The contents of its body SHALL be implementation-defined and 562 clients MUST NOT attempt to interpret them. See Section 7 for a 563 suggested construction. The NTS Cookie extension field MUST NOT be 564 included in NTP packets whose mode is other than 3 (client) or 4 565 (server). 567 5.5. The NTS Cookie Placeholder extension field 569 The NTS Cookie Placeholder extension field has a Field Type of 570 [[TBD4]]. When this extension field is included in a client packet 571 (mode 3), it communicates to the server that the client wishes it to 572 send additional cookies in its response. This extension field MUST 573 NOT be included in NTP packets whose mode is other than 3. 575 Whenever an NTS Cookie Placeholder extension field is present, it 576 MUST be accompanied by an NTS Cookie extension field, and the body 577 length of the NTS Cookie Placeholder extension field MUST be the same 578 as the body length of the NTS Cookie extension field. (This length 579 requirement serves to ensure that the response will not be larger 580 than the request, in order to improve timekeeping precision and 581 prevent DDoS amplification). The contents of the NTS Cookie 582 Placeholder extension field's body are undefined and, aside from 583 checking its length, MUST be ignored by the server. 585 5.6. The NTS Authenticator and Encrypted Extension Fields extension 586 field 588 The NTS Authenticator and Encrypted Extension Fields extension field 589 is the central cryptographic element of an NTS-protected NTP packet. 590 Its Field Type is [[TBD5]] and the format of its body SHALL be as 591 follows: 593 Nonce length: Two octets in network byte order, giving the length 594 of the Nonce field and interpreted as an unsigned integer. 596 Nonce: A nonce as required by the negotiated AEAD Algorithm. 598 Ciphertext: The output of the negotiated AEAD Algorithm. The 599 structure of this field is determined by the negotiated algorithm, 600 but it typically contains an authentication tag in addition to the 601 actual ciphertext. 603 Padding: several octets of padding, with every octet set to the 604 number of padding octets included, e.g., "01", "02 02", or "03 03 605 03". Constraints on the number of padding octets included are 606 enumerated below. 608 The Ciphertext field SHALL be formed by providing the following 609 inputs to the negotiated AEAD Algorithm: 611 K: For packets sent from the client to the server, the C2S key 612 SHALL be used. For packets sent from the server to the client, 613 the S2C key SHALL be used. 615 A: The associated data SHALL consist of the portion of the NTP 616 packet beginning from the start of the NTP header and ending at 617 the end of the last extension field which precedes the NTS 618 Authenticator and Encrypted Extension Fields extension field. 620 P: The plaintext SHALL consist of all (if any) NTP extension 621 fields to be encrypted. The format of any such fields SHALL be in 622 accordance with RFC 7822 [RFC7822], and if multiple extension 623 fields are present they SHALL be joined by concatenation. 625 N: The nonce SHALL be formed however required by the negotiated 626 AEAD Algorithm. 628 The number of padding octets included SHALL conform to the following 629 constraints: 631 The number MUST be at least 1, so that the final octet of the 632 extension field always gives the padding length. 634 The number MUST NOT be greater than 255, since high numbers are 635 unrepresentable in a single octet 637 The number MUST result in an extension field length which is legal 638 per [RFC7822]. That is, the number of padding octets must be 639 chosen so that the total length of the extension field (including 640 the Field Type and Length subfields) is a multiple of 4 greater 641 than or equal to 16, and greater than or equal to 28 if the 642 extension field is the last one in the packet. 644 For mode 3 (client) packets only, the number MUST be at least 645 MAX(MIN(N_MAX, 16) - N_len, 0) + 4, where `N_len` represents the 646 actual length of the nonce and N_MAX is, per [RFC5116], the 647 maximum permitted nonce length for the AEAD algorithm in use. 648 This constraint ensures that servers can always use an adequately 649 long nonce without causing the size of their response packet to 650 exceed the size of the request packet. Servers SHOULD enforce 651 this constraint by dropping client packets that do not conform to 652 it. Clients MUST NOT enforce it since it is not binding on mode 4 653 (server) packets to begin with. 655 The NTS Authenticator and Encrypted Extension Fields extension field 656 MUST NOT be included in NTP packets whose mode is other than 3 657 (client) or 4 (server). 659 6. Protocol details 661 A client sending an NTS-protected request SHALL include the following 662 extension fields as displayed in Figure 3: 664 Exactly one Unique Identifier extension field, which MUST be 665 authenticated, MUST NOT be encrypted, and whose contents MUST NOT 666 duplicate those of any previous request. 668 Exactly one NTS Cookie extension field, which MUST be 669 authenticated and MUST NOT be encrypted. The cookie MUST be one 670 which the server previously provided the client; it may have been 671 provided during the NTS-KE handshake or in response to a previous 672 NTS-protected NTP request. To protect client's privacy, the same 673 cookie SHOULD NOT be included in multiple requests. If the client 674 does not have any cookies that it has not already sent, it SHOULD 675 re-run the NTS-KE protocol before continuing. 677 Exactly one NTS Authenticator and Encrypted Extension Fields 678 extension field, generated using an AEAD Algorithm and C2S key 679 established through NTS-KE. 681 The client MAY include one or more NTS Cookie Placeholder extension 682 field, which MUST be authenticated and MAY be encrypted. The number 683 of NTS Cookie Placeholder extension fields that the client includes 684 SHOULD be such that if the client includes N placeholders and the 685 server sends back N+1 cookies, the number of unused cookies stored by 686 the client will come to eight. When both the client and server 687 adhere to all cookie-management guidance provided in this memo, the 688 number of placeholder extension fields will equal the number of 689 dropped packets since the last successful volley. 691 The client MAY include additional (non-NTS-related) extension fields, 692 which MAY appear prior to the NTS Authenticator and Encrypted 693 Extension Fields extension fields (therefore authenticated but not 694 encrypted), within it (therefore encrypted and authenticated), or 695 after it (therefore neither encrypted nor authenticated). In 696 general, however, the server MUST discard any unauthenticated 697 extension fields and process the packet as though they were not 698 present. Servers MAY implement exceptions to this requirement for 699 particular extension fields if their specification explicitly 700 provides for such. 702 Upon receiving an NTS-protected request, the server SHALL (through 703 some implementation-defined mechanism) use the cookie to recover the 704 AEAD Algorithm, C2S key, and S2C key associated with the request, and 705 then use the C2S key to authenticate the packet and decrypt the 706 ciphertext. If the cookie is valid and authentication and decryption 707 succeed, then the server SHALL include the following extension fields 708 in its response: 710 Exactly one Unique Identifier extension field, which MUST be 711 authenticated, MUST NOT be encrypted, and whose contents SHALL 712 echo those provided by the client. 714 Exactly one NTS Authenticator and Encrypted Extension Fields 715 extension field, generated using the AEAD algorithm and S2C key 716 recovered from the cookie provided by the client. 718 One or more NTS Cookie extension fields, which MUST be encrypted 719 and authenticated. The number of NTS Cookie extension fields 720 included SHOULD be equal to, and MUST NOT exceed, one plus the 721 number of valid NTS Cookie Placeholder extension fields included 722 in the request. 724 We emphasize the contrast that NTS Cookie extension fields MUST NOT 725 be encrypted when sent from client to server, but MUST be encrypted 726 from sent from server to client. The former is necessary in order 727 for the server to be able to recover the C2S and S2C keys, while the 728 latter is necessary to satisfy the unlinkability goals discussed in 729 Section 11.1. We emphasize also that " encrypted" means encapsulated 730 within the the NTS Authenticator and Encrypted Extensions extension 731 field. While the body of a NTS Cookie extension field will generally 732 consist of some sort of AEAD output (regardless of whether the 733 recommendations of Section 7 are precisely followed), this is not 734 sufficient to make the extension field "encrypted". 736 The server MAY include additional (non-NTS-related) extension fields, 737 which MAY appear prior to the NTS Authenticator and Encrypted 738 Extension Fields extension field (therefore authenticated but not 739 encrypted), within it (therefore encrypted and authenticated), or 740 after it (therefore neither encrypted nor authenticated). In 741 general, however, the client MUST discard any unauthenticated 742 extension fields and process the packet as though they were not 743 present. Clients MAY implement exceptions to this requirement for 744 particular extension fields if their specification explicitly 745 provides for such. 747 If the server is unable to validate the cookie or authenticate the 748 request, it SHOULD respond with a Kiss-o'-Death packet (see RFC 5905, 749 Section 7.4) [RFC5905]) with kiss code "NTSN" (meaning "NTS NAK"). 750 Such a response MUST include exactly one Unique Identifier extension 751 field whose contents SHALL echo those provided by the client. It 752 MUST NOT include any NTS Cookie or NTS Authenticator and Encrypted 753 Extension Fields extension fields. 755 Upon receiving an NTS-protected response, the client MUST verify that 756 the Unique Identifier matches that of an outstanding request, and 757 that the packet is authentic under the S2C key associated with that 758 request. If either of these checks fails, the packet MUST be 759 discarded without further processing. 761 Upon receiving an NTS NAK, the client MUST verify that the Unique 762 Identifier matches that of an outstanding request. If this check 763 fails, the packet MUST be discarded without further processing. If 764 this check passes, the client SHOULD wait until the next poll for a 765 valid NTS-protected response and if none is received, discard all 766 cookies and AEAD keys associated with the server which sent the NAK 767 and initiate a fresh NTS-KE handshake. 769 +---------------------------------------+ 770 | - verify time request message | 771 | - generate time response message | 772 | - included NTPv4 extension fields | 773 | o Unique Identifier EF | 774 | o NTS Authentication and | 775 | Encrypted Extension Fields EF | 776 | - NTS Cookie EF | 777 | - | 778 | - transmit time request packet | 779 +-----------------+---------------------+ 780 | 781 | 782 Server -------- --+---------------+-----+-----------------------> 783 ^ \ 784 / \ 785 time request / \ time response 786 (mode 3) / \ (mode 4) 787 / \ 788 / V 789 Client -----+---------------------------------+----------------> 790 | | 791 | | 792 | | 793 +-----------+----------------------+ +------+-----------------+ 794 |- generate time request message | |- verify time response | 795 | - include NTPv4 Extension fields | | message | 796 | o Unique Identifier EF | |- extract cookie(s) | 797 | o NTS Cookie EF | |- time synchronization | 798 | o | | processing | 799 | | +------------------------+ 800 |- generate AEAD tag of NTP message| 801 |- add NTS Authentication and | 802 | Encrypted Extension Fields EF | 803 |- transmit time request packet | 804 +----------------------------------+ 806 Figure 3: NTS Time Synchronization Message 808 7. Suggested format for NTS cookies 810 This section is non-normative. It gives a suggested way for servers 811 to construct NTS cookies. All normative requirements are stated in 812 Section 4.1.6 and Section 5.4. 814 The role of cookies in NTS is closely analogous to that of session 815 cookies in TLS. Accordingly, the thematic resemblance of this 816 section to RFC 5077 [RFC5077] is deliberate, and the reader should 817 likewise take heed of its security considerations. 819 Servers should select an AEAD algorithm which they will use to 820 encrypt and authenticate cookies. The chosen algorithm should be one 821 such as AEAD_AES_SIV_CMAC_256 [RFC5297] which resists accidental 822 nonce reuse, and it need not be the same as the one that was 823 negotiated with the client. Servers should randomly generate and 824 store a master AEAD key `K`. Servers should additionally choose a 825 non-secret, unique value `I` as key-identifier for `K`. 827 Servers should periodically (e.g., once daily) generate a new pair 828 (I,K) and immediately switch to using these values for all newly- 829 generated cookies. Immediately following each such key rotation, 830 servers should securely erase any keys generated two or more rotation 831 periods prior. Servers should continue to accept any cookie 832 generated using keys that they have not yet erased, even if those 833 keys are no longer current. Erasing old keys provides for forward 834 secrecy, limiting the scope of what old information can be stolen if 835 a master key is somehow compromised. Holding on to a limited number 836 of old keys allows clients to seamlessly transition from one 837 generation to the next without having to perform a new NTS-KE 838 handshake. 840 The need to keep keys synchronized across load-balanced clusters can 841 make automatic key rotation challenging. However, the task can be 842 accomplished without the need for central key-management 843 infrastructure by using a ratchet, i.e., making each new key a 844 deterministic, cryptographically pseudo-random function of its 845 predecessor. A recommended concrete implementation of this approach 846 is to use HKDF [RFC5869] to derive new keys, using the key's 847 predecessor as Input Keying Material and its key identifier as a 848 salt. 850 To form a cookie, servers should first form a plaintext `P` 851 consisting of the following fields: 853 The AEAD algorithm negotiated during NTS-KE 855 The S2C key 857 The C2S key 859 Servers should then generate a nonce `N` uniformly at random, and 860 form AEAD output `C` by encrypting `P` under key `K` with nonce `N` 861 and no associated data. 863 The cookie should consist of the tuple `(I,N,C)`. 865 To verify and decrypt a cookie provided by the client, first parse it 866 into its components `I`, `N`, and `C`. Use `I` to look up its 867 decryption key `K`. If the key whose identifier is `I` has been 868 erased or never existed, decryption fails; reply with an NTS NAK. 869 Otherwise, attempt to decrypt and verify ciphertext `C` using key `K` 870 and nonce `N` with no associated data. If decryption or verification 871 fails, reply with an NTS NAK. Otherwise, parse out the contents of 872 the resulting plaintext `P` to obtain the negotiated AEAD algorithm, 873 S2C key, and C2S key. 875 8. IANA Considerations 877 IANA is requested to allocate two entries, identical except for the 878 Transport Protocol, in the Service Name and Transport Protocol Port 879 Number Registry as follows: 881 Service Name: nts 883 Transport Protocol: tcp, udp 885 Assignee: IESG 887 Contact: IETF Chair 889 Description: Network Time Security 891 Reference: [[this memo]] 893 Port Number: [[TBD1]], selected by IANA from the user port range 895 IANA is requested to allocate the following entry in the Application- 896 Layer Protocol Negotation (ALPN) Protocol IDs registry: 898 Protocol: Network Time Security Key Establishment, version 1 900 Identification Sequence: 901 0x6E 0x74 0x73 0x6B 0x65 0x2F 0x31 ("ntske/1") 903 Reference: [[this memo]] 905 IANA is requested to allocate the following entry in the TLS Exporter 906 Label Registry: 908 +----------------------------------+---------+---------------+------+ 909 | Value | DTLS-OK | Reference | Note | 910 +----------------------------------+---------+---------------+------+ 911 | EXPORTER-network-time-security/1 | Y | [[this memo]] | | 912 +----------------------------------+---------+---------------+------+ 913 IANA is requested to allocate the following entry in the registry of 914 NTP Kiss-o'-Death codes: 916 +------+---------+ 917 | Code | Meaning | 918 +------+---------+ 919 | NTSN | NTS NAK | 920 +------+---------+ 922 IANA is requested to allocate the following entries in the NTP 923 Extensions Field Types registry: 925 +-----------+-----------------------------------------+-------------+ 926 | Field | Meaning | Reference | 927 | Type | | | 928 +-----------+-----------------------------------------+-------------+ 929 | [[TBD2]] | Unique Identifier | [[this | 930 | | | memo]] | 931 | [[TBD3]] | NTS Cookie | [[this | 932 | | | memo]] | 933 | [[TBD4]] | NTS Cookie Placeholder | [[this | 934 | | | memo]] | 935 | [[TBD5]] | NTS Authenticator and Encrypted | [[this | 936 | | Extension Fields | memo]] | 937 +-----------+-----------------------------------------+-------------+ 939 IANA is requested to create a new registry entitled "Network Time 940 Security Key Establishment Record Types". Entries SHALL have the 941 following fields: 943 Type Number (REQUIRED): An integer in the range 0-32767 inclusive. 945 Description (REQUIRED): A short text description of the purpose of 946 the field. 948 Set Critical Bit (REQUIRED): One of "MUST", "SHOULD", "MAY", 949 "SHOULD NOT", or "MUST NOT". 951 Reference (REQUIRED): A reference to a document specifying the 952 semantics of the record. 954 The policy for allocation of new entries in this registry SHALL vary 955 by the Type Number, as follows: 957 0-1023: IETF Review 959 1024-16383: Specification Required 960 16384-32767: Private and Experimental Use 962 Applications for new entries SHALL specify the contents of the 963 Description, Set Critical Bit and Reference fields and which of the 964 above ranges the Type Number should be allocated from. Applicants 965 MAY request a specific Type Number, and such requests MAY be granted 966 at the registrar's discretion. 968 The initial contents of this registry SHALL be as follows: 970 +-------------+-----------------------------+----------+------------+ 971 | Field | Description | Critical | Reference | 972 | Number | | | | 973 +-------------+-----------------------------+----------+------------+ 974 | 0 | End of message | MUST | [[this | 975 | | | | memo]] | 976 | 1 | NTS next protocol | MUST | [[this | 977 | | negotiation | | memo]] | 978 | 2 | Error | MUST | [[this | 979 | | | | memo]] | 980 | 3 | Warning | MUST | [[this | 981 | | | | memo]] | 982 | 4 | AEAD algorithm negotiation | MAY | [[this | 983 | | | | memo]] | 984 | 5 | New cookie for NTPv4 | SHOULD | [[this | 985 | | | NOT | memo]] | 986 | 16384-32767 | Reserved for Private & | MAY | [[this | 987 | | Experimental Use | | memo]] | 988 +-------------+-----------------------------+----------+------------+ 990 IANA is requested to create a new registry entitled "Network Time 991 Security Next Protocols". Entries SHALL have the following fields: 993 Protocol ID (REQUIRED): An integer in the range 0-65535 inclusive, 994 functioning as an identifier. 996 Protocol Name (REQUIRED): A short text string naming the protocol 997 being identified. 999 Reference (RECOMMENDED): A reference to a relevant specification 1000 document. If no relevant document exists, a point-of-contact for 1001 questions regarding the entry SHOULD be listed here in lieu. 1003 Applications for new entries in this registry SHALL specify all 1004 desired fields, and SHALL be granted upon approval by a Designated 1005 Expert. Protocol IDs 32768-65535 SHALL be reserved for Private or 1006 Experimental Use, and SHALL NOT be registered. 1008 The initial contents of this registry SHALL be as follows: 1010 +-------------+-------------------------------+---------------------+ 1011 | Protocol ID | Human-Readable Name | Reference | 1012 +-------------+-------------------------------+---------------------+ 1013 | 0 | Network Time Protocol version | [[this memo]] | 1014 | | 4 (NTPv4) | | 1015 | 32768-65535 | Reserved for Private or | Reserved by [[this | 1016 | | Experimental Use | memo]] | 1017 +-------------+-------------------------------+---------------------+ 1019 IANA is requested to create two new registries entitled "Network Time 1020 Security Error Codes" and "Network Time Security Warning Codes". 1021 Entries in each SHALL have the following fields: 1023 Number (REQUIRED): An integer in the range 0-65535 inclusive. 1025 Description (REQUIRED): A short text description of the condition. 1027 Reference (REQUIRED): A reference to a relevant specification 1028 document. 1030 The policy for allocation of new entries in these registries SHALL 1031 vary by their Number, as follows: 1033 0-1023: IETF Review 1035 1024-32767: Specification Required 1037 32768-65535: Private and Experimental Use 1039 The initial contents of the Network Time Security Error Codes 1040 Registry SHALL be as follows: 1042 +--------+---------------------------------+---------------+ 1043 | Number | Description | Reference | 1044 +--------+---------------------------------+---------------+ 1045 | 0 | Unrecognized Critical Extension | [[this memo]] | 1046 | 1 | Bad Request | [[this memo]] | 1047 +--------+---------------------------------+---------------+ 1049 The Network Time Security Warning Codes Registry SHALL initially be 1050 empty. 1052 9. Implementation Status 1054 This section records the status of known implementations of the 1055 protocol defined by this specification at the time of posting of this 1056 Internet-Draft, and is based on a proposal described in RFC 7942. 1057 The description of implementations in this section is intended to 1058 assist the IETF in its decision processes in progressing drafts to 1059 RFCs. Please note that the listing of any individual implementation 1060 here does not imply endorsement by the IETF. Furthermore, no effort 1061 has been spent to verify the information presented here that was 1062 supplied by IETF contributors. This is not intended as, and must not 1063 be construed to be, a catalog of available implementations or their 1064 features. Readers are advised to note that other implementations may 1065 exist. 1067 According to RFC 7942, "this will allow reviewers and working groups 1068 to assign due consideration to documents that have the benefit of 1069 running code, which may serve as evidence of valuable experimentation 1070 and feedback that have made the implemented protocols more mature. 1071 It is up to the individual working groups to use this information as 1072 they see fit". 1074 9.1. Implementation PoC 1 1076 Organization: Ostfalia University of Applied Science 1078 Implementor: Martin Langer 1080 Maturity: Proof-of-Concept Prototype 1082 This implementation was used to verify consistency and to ensure 1083 completeness of this specification. It also demonstrate 1084 interoperability with NTP's client-server mode messages. 1086 9.1.1. Coverage 1088 This implementation covers the complete specification. 1090 9.1.2. Licensing 1092 The code is released under a Apache License 2.0 license. 1094 The source code is available at: https://gitlab.com/MLanger/nts/ 1096 9.1.3. Contact Information 1098 Contact Martin Langer: mart.langer@ostfalia.de 1100 9.1.4. Last Update 1102 The implementation was updated 3rd May 2018. 1104 9.2. Implementation PoC 2 1106 Organization: tbd 1108 Implementor: Daniel Fox Franke 1110 Maturity: Proof-of-Concept Prototype 1112 This implementation was used to verify consistency and to ensure 1113 completeness of this specification. 1115 9.2.1. Coverage 1117 This implementation provides the client and the server for the 1118 initial TLS handshake and NTS key exchange. It provides the the 1119 client part of the NTS protected NTP messages. 1121 9.2.2. Licensing 1123 Public domain. 1125 The source code is available at: https://github.com/dfoxfranke/nts- 1126 hackathon 1128 9.2.3. Contact Information 1130 Contact Daniel Fox Franke: dfoxfranke@gmail.com 1132 9.2.4. Last Update 1134 The implementation was updated 16th March 2018. 1136 9.3. Interoperability 1138 The Interoperability tests distinguished between NTS key exchange and 1139 NTS time exchange messages. For the NTS key exchange, 1140 interoperability between the two implementations has been verified 1141 successfully. Interoperability of NTS time exchange messages has 1142 been verified successfully for the case that PoC 1 represents the 1143 server and PoC 2 the client. 1145 These tests successfully demonstrate that there are at least two 1146 running implementations of this draft which are able to interoperate. 1148 10. Security considerations 1150 10.1. Avoiding DDoS amplification 1152 Certain non-standard and/or deprecated features of the Network Time 1153 Protocol enable clients to send a request to a server which causes 1154 the server to send a response much larger than the request. Servers 1155 which enable these features can be abused in order to amplify traffic 1156 volume in distributed denial-of-service (DDoS) attacks by sending 1157 them a request with a spoofed source IP. In recent years, attacks of 1158 this nature have become an endemic nuisance. 1160 NTS is designed to avoid contributing any further to this problem by 1161 ensuring that NTS-related extension fields included in server 1162 responses will be the same size as the NTS-related extension fields 1163 sent by the client. In particular, this is why the client is 1164 required to send a separate and appropriately padded-out NTS Cookie 1165 Placeholder extension field for every cookie it wants to get back, 1166 rather than being permitted simply to specify a desired quantity. 1168 Due to the [RFC7822] requirement that extensions be padded and 1169 aligned to four-octet boundaries, response size may still in some 1170 cases exceed request size by up to three octets. This is 1171 sufficiently inconsequential that we have declined to address it. 1173 10.2. Initial verification of server certificates 1175 NTS's security goals are undermined if the client fails to verify 1176 that the X.509 certificate chain presented by the server is valid and 1177 rooted in a trusted certificate authority. [RFC5280] and [RFC6125] 1178 specify how such verification is to be performed in general. 1179 However, the expectation that the client does not yet have a 1180 correctly-set system clock at the time of certificate verification 1181 presents difficulties with verifying that the certificate is within 1182 its validity period, i.e., that the current time lies between the 1183 times specified in the certificate's notBefore and notAfter fields, 1184 and it may be operationally necessary in some cases for a client to 1185 accept a certificate which appears to be expired or not yet valid. 1186 While there is no perfect solution to this problem, there are several 1187 mitigations the client can implement to make it more difficult for an 1188 adversary to successfully present an expired certificate: 1190 Check whether the system time is in fact unreliable. If the 1191 system clock has previously been synchronized since last boot, 1192 then on operating systems which implement a kernel-based phase- 1193 locked-loop API, a call to ntp_gettime() should show a maximum 1194 error less than NTP_PHASE_MAX. In this case, the clock SHOULD be 1195 considered reliable and certificates can be strictly validated. 1197 Allow the system administrator to specify that certificates should 1198 *always* be strictly validated. Such a configuration is 1199 appropriate on systems which have a battery-backed clock and which 1200 can reasonably prompt the user to manually set an approximately- 1201 correct time if it appears to be needed. 1203 Once the clock has been synchronized, periodically write the 1204 current system time to persistent storage. Do not accept any 1205 certificate whose notAfter field is earlier than the last recorded 1206 time. 1208 Do not process time packets from servers if the time computed from 1209 them falls outside the validity period of the server's 1210 certificate. 1212 Use multiple time sources. The ability to pass off an expired 1213 certificate is only useful to an adversary who has compromised the 1214 corresponding private key. If the adversary has compromised only 1215 a minority of servers, NTP's selection algorithm ([RFC5905] 1216 section 11.2.1) will protect the client from accepting bad time 1217 from the adversary-controlled servers. 1219 10.3. Usage of NTP pools 1221 Additional standardization work and infrastructure development is 1222 necessary before NTS can be used with public NTP server pools. 1223 First, a scheme will need to be specified for determining what 1224 constitutes an acceptable certificate for a pool server, such as 1225 establishing a value required to be contained in its Extended Key 1226 Usage attribute, and how to determine, given the DNS name of a pool, 1227 what Subject Alternative Name to expect in the certificates of its 1228 members. Implementing any such specification will necessitate 1229 infrastructure work: pool organizers will need to act as certificate 1230 authorities, regularly monitor the behavior of servers to which 1231 certificates have been issued, and promptly revoke the certificate of 1232 any server found to be serving incorrect time. 1234 10.4. Delay attacks 1236 In a packet delay attack, an adversary with the ability to act as a 1237 man-in-the-middle delays time synchronization packets between client 1238 and server asymmetrically [RFC7384]. Since NTP's formula for 1239 computing time offset relies on the assumption that network latency 1240 is roughly symmetrical, this leads to the client to compute an 1241 inaccurate value [Mizrahi]. The delay attack does not reorder or 1242 modify the content of the exchanged synchronization packets. 1243 Therefore, cryptographic means do not provide a feasible way to 1244 mitigate this attack. However, the maximum error that an adversary 1245 can introduce is bounded by half of the round trip delay. 1247 [RFC5905] specifies a parameter called MAXDIST which denotes the 1248 maximum round-trip latency (including not only the immediate round 1249 trip between client and server but the whole distance back to the 1250 reference clock as reported in the Root Delay field) that a client 1251 will tolerate before concluding that the server is unsuitable for 1252 synchronization. The standard value for MAXDIST is one second, 1253 although some implementations use larger values. Whatever value a 1254 client chooses, the maximum error which can be introduced by a delay 1255 attack is MAXDIST/2. 1257 Usage of multiple time sources, or multiple network paths to a given 1258 time source [Shpiner], may also serve to mitigate delay attacks if 1259 the adversary is in control of only some of the paths. 1261 10.5. Random number generation 1263 At various points in NTS, the generation of cryptographically secure 1264 random numbers is required. Whenever this draft specifies the use of 1265 random numbers, then cryptographically secure random number 1266 generation MUST be used. See [RFC4086] for guidelines concerning 1267 this topic. 1269 11. Privacy Considerations 1271 11.1. Unlinkability 1273 Unlinkability prevents a device from being tracked when it changes 1274 network addresses (e.g. because said device moved between different 1275 networks). In other words, unlinkability thwarts an attacker that 1276 seeks to link a new network address used by a device with a network 1277 address that it was formerly using, because of recognizable data that 1278 the device persistently sends as part of an NTS-secured NTP 1279 association. This is the justification for continually supplying the 1280 client with fresh cookies, so that a cookie never represents 1281 recognizable data in the sense outlined above. 1283 NTS's unlinkability objective is merely to not leak any additional 1284 data that could be used to link a device's network address. NTS does 1285 not rectify legacy linkability issues that are already present in 1286 NTP. Thus, a client that requires unlinkability must also minimize 1287 information transmitted in a client query (mode 3) packet as 1288 described in the draft [I-D.ietf-ntp-data-minimization]. 1290 The unlinkability objective only holds for time synchronization 1291 traffic, as opposed to key exchange traffic. This implies that it 1292 cannot be guaranteed for devices that function not only as time 1293 clients, but also as time servers (because the latter can be 1294 externally triggered to send authentication data). 1296 It should also be noted that it could be possible to link devices 1297 that operate as time servers from their time synchronization traffic, 1298 using information exposed in (mode 4) server response packets (e.g. 1299 reference ID, reference time, stratum, poll). Also, devices that 1300 respond to NTP control queries could be linked using the information 1301 revealed by control queries. 1303 11.2. Confidentiality 1305 NTS does not protect the confidentiality of information in NTP's 1306 header fields. When clients implement 1307 [I-D.ietf-ntp-data-minimization], client packet headers do not 1308 contain any information which the client could conceivably wish to 1309 keep secret: one field is random, and all others are fixed. 1310 Information in server packet headers is likewise public: the origin 1311 timestamp is copied from the client's (random) transmit timestamp, 1312 and all other fields are set the same regardless of the identity of 1313 the client making the request. 1315 Future extension fields could hypothetically contain sensitive 1316 information, in which case NTS provides a mechanism for encrypting 1317 them. 1319 12. Acknowledgements 1321 The authors would like to thank Richard Barnes, Steven Bellovin, 1322 Scott Fluhrer, Sharon Goldberg, Russ Housley, Martin Langer, Miroslav 1323 Lichvar, Aanchal Malhotra, Dave Mills, Danny Mayer, Karen O'Donoghue, 1324 Eric K. Rescorla, Stephen Roettger, Kurt Roeckx, Kyle Rose, Rich 1325 Salz, Brian Sniffen, Susan Sons, Douglas Stebila, Harlan Stenn, 1326 Martin Thomson, and Richard Welty for contributions to this document 1327 and comments on the design of NTS. 1329 13. References 1331 13.1. Normative References 1333 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1334 Requirement Levels", BCP 14, RFC 2119, 1335 DOI 10.17487/RFC2119, March 1997, 1336 . 1338 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 1339 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 1340 . 1342 [RFC5297] Harkins, D., "Synthetic Initialization Vector (SIV) 1343 Authenticated Encryption Using the Advanced Encryption 1344 Standard (AES)", RFC 5297, DOI 10.17487/RFC5297, October 1345 2008, . 1347 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 1348 Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, 1349 March 2010, . 1351 [RFC5746] Rescorla, E., Ray, M., Dispensa, S., and N. Oskov, 1352 "Transport Layer Security (TLS) Renegotiation Indication 1353 Extension", RFC 5746, DOI 10.17487/RFC5746, February 2010, 1354 . 1356 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 1357 "Network Time Protocol Version 4: Protocol and Algorithms 1358 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 1359 . 1361 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 1362 Verification of Domain-Based Application Service Identity 1363 within Internet Public Key Infrastructure Using X.509 1364 (PKIX) Certificates in the Context of Transport Layer 1365 Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March 1366 2011, . 1368 [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, 1369 "Transport Layer Security (TLS) Application-Layer Protocol 1370 Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, 1371 July 2014, . 1373 [RFC7465] Popov, A., "Prohibiting RC4 Cipher Suites", RFC 7465, 1374 DOI 10.17487/RFC7465, February 2015, 1375 . 1377 [RFC7507] Moeller, B. and A. Langley, "TLS Fallback Signaling Cipher 1378 Suite Value (SCSV) for Preventing Protocol Downgrade 1379 Attacks", RFC 7507, DOI 10.17487/RFC7507, April 2015, 1380 . 1382 [RFC7627] Bhargavan, K., Ed., Delignat-Lavaud, A., Pironti, A., 1383 Langley, A., and M. Ray, "Transport Layer Security (TLS) 1384 Session Hash and Extended Master Secret Extension", 1385 RFC 7627, DOI 10.17487/RFC7627, September 2015, 1386 . 1388 [RFC7822] Mizrahi, T. and D. Mayer, "Network Time Protocol Version 4 1389 (NTPv4) Extension Fields", RFC 7822, DOI 10.17487/RFC7822, 1390 March 2016, . 1392 13.2. Informative References 1394 [I-D.ietf-ntp-data-minimization] 1395 Franke, D. and A. Malhotra, "NTP Client Data 1396 Minimization", draft-ietf-ntp-data-minimization-00 (work 1397 in progress), May 2017. 1399 [Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks 1400 against time synchronization protocols", in Proceedings 1401 of Precision Clock Synchronization for Measurement Control 1402 and Communication, ISPCS 2012, pp. 1-6, September 2012. 1404 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 1405 "Randomness Requirements for Security", BCP 106, RFC 4086, 1406 DOI 10.17487/RFC4086, June 2005, 1407 . 1409 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 1410 "Transport Layer Security (TLS) Session Resumption without 1411 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 1412 January 2008, . 1414 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1415 Housley, R., and W. Polk, "Internet X.509 Public Key 1416 Infrastructure Certificate and Certificate Revocation List 1417 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 1418 . 1420 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 1421 Key Derivation Function (HKDF)", RFC 5869, 1422 DOI 10.17487/RFC5869, May 2010, 1423 . 1425 [RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in 1426 Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384, 1427 October 2014, . 1429 [Shpiner] "Multi-path Time Protocols", in Proceedings of IEEE 1430 International Symposium on Precision Clock Synchronization 1431 for Measurement, Control and Communication (ISPCS), 1432 September 2013. 1434 Appendix A. Terms and Abbreviations 1436 AEAD Authenticated Encryption with Associated Data [RFC5116] 1438 DDoS Distributed Denial of Service 1440 NTP Network Time Protocol [RFC5905] 1442 NTS Network Time Security 1444 TLS Transport Layer Security 1446 Authors' Addresses 1448 Daniel Fox Franke 1450 Email: dfoxfranke@gmail.com 1451 URI: https://www.dfranke.us 1453 Dieter Sibold 1454 Physikalisch-Technische Bundesanstalt 1455 Bundesallee 100 1456 Braunschweig D-38116 1457 Germany 1459 Phone: +49-(0)531-592-8420 1460 Fax: +49-531-592-698420 1461 Email: dieter.sibold@ptb.de 1463 Kristof Teichel 1464 Physikalisch-Technische Bundesanstalt 1465 Bundesallee 100 1466 Braunschweig D-38116 1467 Germany 1469 Phone: +49-(0)531-592-4471 1470 Email: kristof.teichel@ptb.de