NTP Security Model David L Mills University of

  • Slides: 28
Download presentation
NTP Security Model David L. Mills University of Delaware http: //www. eecis. udel. edu/~mills

NTP Security Model David L. Mills University of Delaware http: //www. eecis. udel. edu/~mills mailto: mills@udel. edu Sir John Tenniel; Alice’s Adventures in Wonderland, Lewis Carroll 03 -Dec-20 1

NTP security model o NTP operates in a mixed, multi-level security environment including symmetric

NTP security model o NTP operates in a mixed, multi-level security environment including symmetric key cryptography, public key cryptography and unsecured. o NTP timestamps and related data are considered public values and never encrypted. o Time synchronization is maintained on a master-slave basis where synchronization flows from trusted servers to dependent clients possibly via intermediate servers operating at successively higher stratum levels. o A client is authentic if it can reliably verify the credentials of at least one server and that server messages have not been modified in transit. o A client is proventic if by induction each server on at least one path to a trusted server is authentic. 03 -Dec-20 2

Intruder attack scenarios o An intruder can intercept and archive packets forever, as well

Intruder attack scenarios o An intruder can intercept and archive packets forever, as well as all the public values ever generated and transmitted over the net. o An intruder can generate packets faster than the server, network or client can process them, especially if they require expensive cryptographic computations. o In a wiretap attack the intruder can intercept, modify and replay a packet. However, it cannot permanently prevent onward transmission of the original packet; that is, it cannot break the wire, only tell lies and congest it. It is generally assumed that the modified packet cannot arrive at the victim before the original packet. o In a middleman or masquerade attack the intruder is positioned between the server and client, so it can intercept, modify and replay a packet and prevent onward transmission of the original packet. It is generally assumed that the middleman does not have the server private keys or identity parameters. 03 -Dec-20 3

Security requirements o The running times for public key algorithms are relatively long and

Security requirements o The running times for public key algorithms are relatively long and highly variable, so that the synchronization function itself must not require their use for every NTP packet. o In some modes of operation it is not feasible for a server to retain state variables for every client. It is however feasible to quickly regenerate them for a client upon arrival of a packet from that client. o The lifetime of cryptographic values must be enforced, which requires a reliable system clock. However, the sources that synchronize the system clock must be cryptographically proventicated. This circular interdependence of the timekeeping and proventication functions requires special handling. 03 -Dec-20 4

Security requirements (continued) o All proventication functions must involve only public values transmitted over

Security requirements (continued) o All proventication functions must involve only public values transmitted over the net with the exception of encrypted signatures and cookies intended only to authenticate the source. Unencrypted private values must never be disclosed beyond the machine on which they were created. o Public encryption keys and certificates must be retrievable directly from servers without requiring secured channels; however, the fundamental security of identification credentials and public values bound to those credentials must be a function of certificate authorities and/or webs of trust. o Error checking must be at the enhanced paranoid level, as network terrorists may be able to craft errored packets that consume excessive cycles with needless result. 03 -Dec-20 5

NTP subnet principles o o The NTP network is a forest of hosts operating

NTP subnet principles o o The NTP network is a forest of hosts operating as servers and clients • Primary (stratum 1) servers are the forest roots. • Secondary (stratum > 1) servers join the trunks and branches of the forest. • Clients are secondary servers at the leaves of the forest. • Secondary servers normally use multiple redundant servers and diverse network paths to the same or next lower stratum level toward the roots. An NTP subnet is a subset of the NTP network. • Usually, but not necessarily, the subnet is operated by a single management entity over local networks belonging to the entity. • The set of lowest-stratum hosts represent the roots of the subnet. • The remaining subnet hosts must have at least one path to at least one of the roots. • The NTP subnet is self contained if the roots are all primary (stratum 1) servers and derivative if not. • Subnets may include branches to other subnets for primary and backup service and to create hierarchical multi-subnet structures. 03 -Dec-20 6

NTP secure group principles o A NTP secure group is a subnet using a

NTP secure group principles o A NTP secure group is a subnet using a common security model, authentication protocol and identity scheme based on symmetric key or public key cryptography. o Each group host has o o • For public key cryptography, a public/private host key pair and self-signed host certificate. • Optional password-encrypted identity parameters. Each group has one or more trusted hosts that • Provide cryptographic redundancy and diversity. • Operate at the lowest stratum of the group. • For public key cryptography, the host certificate must have a trusted extension field. A trusted agent acting for the group generates the identity parameters, which are distributed to other group hosts by secure means. . 03 -Dec-20 7

Hierarchical groups and trust inheritance o o A client host authenticates a server hosts

Hierarchical groups and trust inheritance o o A client host authenticates a server hosts using its public certificate and optional identity parameters. • A certificate trail must exist from each host via intervening hosts to one or more trusted hosts at the lowest stratum of the group. The name of each trusted host is a pseudonym for the group. • The security protocol hikes the certificate trail to reveal the pseudonym which locates the identity parameters previously obtained from the trusted agent. This provides the framework for hierarchical group authentication. • The primary group includes multiple trusted primary (stratum 1) servers with primary group credentials. • A derivative group includes multiple trusted secondary servers at a higher stratum with both primary and secondary group credentials. These servers authenticate the primary group using certificate trails ending at the primary servers. • Dependent servers authenticate the derivative group using secondary group credentials and certificate trails ending at the secondary servers. 03 -Dec-20 8

NTP secure group configuration example Stratum 1 A 2 3 4 o B C

NTP secure group configuration example Stratum 1 A 2 3 4 o B C R S X D Y Alice Helen Carol Z There are three groups, primary Alice and Helen and derivative Carol. • Each member has the credentials for its group generated by a trusted authority. Alice trusts AB, Helen trusts R and Carol trusts X. • C authenticates using Alice credentials and either A or B certificate. • D authenticates using Alice credentials and certificate trails via C. • S authenticates using Helen credentials and R certificate. • Y and Z authenticate using Carol credentials and X certificate. • X authenticates either with Alice credentials and trails via C and/or Helen credentials and trails via S. Which credentials to use are determined by the security protocol and trusted host at the end of the trail. • Each trusted host must have credentials for all next downstratum trusted hosts. 03 -Dec-20 9

Identity verification - outline Certificate Subject s Issuer Group Key Group s S =

Identity verification - outline Certificate Subject s Issuer Group Key Group s S = step Alice* Alice Carol* Alice * = trusted Stratum 1 1 3 Brenda 4 Alice Denise 4 Carol 4 Alice* 2 Carol* 2 Alice* Carol* 2 1 Brenda 1 Denise 1 Brenda Alice Denise Carol 2 3 Alice 3 Stratum 2 Stratum 3 o Eileen Brenda Carol Eileen 1 Alice 3 Eileen (stratum 3) chimes both Brenda and Denise, Brenda (2) chimes Alice (1) and Denise (2) chimes Carol (1). Alice and Carol have trusted certificates; Alice trusted group keys have been securely deployed. • Step 1: Host loads self-signed subject certificate at startup. • Step 2: Autokey loads server certificate signed by next lower stratum issuer. The trail continues until a trusted certificate is found. • Step 3: Autokey loads group key and verifies server identity. • Step 4: Autokey presents self-signed certificate to server for signature. 03 -Dec-20 10

Multiple groups Certificate Subject s Issuer Group Key Group s S = step Alice*

Multiple groups Certificate Subject s Issuer Group Key Group s S = step Alice* Alice Carol* Carol * = trusted Stratum 1 1 3 Brenda 4 Alice Denise 4 Carol 4 Alice* 2 Carol* 2 Alice* Carol* 2 1 Brenda 1 Denise 1 Brenda Alice Denise Carol 2 3 Alice 3 Carol 3 Eileen Stratum 2 Stratum 3 o Eileen Brenda Carol Alice 1 Carol 3 Alice and Carol are trusted agents in different groups. • Alice group key previously deployed to Brenda and Eileen. • Carol group key previously deployed to Denise and Eileen. • Eileen hikes trail via Brenda to Alice and verifies identity with Brenda using Alice key. • Eileen hikes trail via Denise to Alice and verifies identity with Denise using Carol key. • Basic rule: each server must have all group keys for all possible hikes. 03 -Dec-20 11

Authentication scheme A (Diffie-Hellman) o o o Scheme is based on Diffie-Hellman key agreement

Authentication scheme A (Diffie-Hellman) o o o Scheme is based on Diffie-Hellman key agreement and conventional symmetric cryptosystem. • Certificated public values for server are provided by X. 509 infrastructure. • Private session keys are distributed out-of-band in advance or derived using certificated Diffie-Hellman agreement (Station-Station protocol) • The message digest is computed and verified using the session key Advantages • Requires no protocol modifications. • Conforms to current IPSEC security models (Photuris, etc. ). • Can be adapted to multicasting in small groups. Disadvantages • Server requires separate state variables for each client. • Does not scale to large subnets with many clients and few servers. • Not practical for multicasting in large groups. 03 -Dec-20 12

Authentication scheme B (Kent) o o o Scheme is based on RSA public key

Authentication scheme B (Kent) o o o Scheme is based on RSA public key signature, Diffie-Hellman key agreement and MD 5 one-way hash function. • Certificated public values for server are provided by X. 509 infrastructure. • Server computes session key as MD 5 hash of source and destination addresses, key identifier and cookie as hash of private value. • On request, server encrypts cookie using provided client public key. Server sends this and RSA signature to client. Client verifies and stores for later. • The message digest is computed and verified using the session key. Advantages • Requires no protocol modifications. • Server needs no persistent state variables for clients. Disadvantages • Not practical for multicasting. 03 -Dec-20 13

Authentication scheme C (RSA) o o o Scheme is based on RSA public key

Authentication scheme C (RSA) o o o Scheme is based on RSA public key signature • Certificated public values are provided by X. 509 infrastructure. • Server computes MD 5 message digest and encrypts with RSA private key. This value is included in the message authentication code (MAC). • Clients decrypt MAC and compare with computed message digest. • Servers either • Estimate encryption delay and compensate timestamp or • Include timestamp in following message. Advantages • Best among all schemes for multicast security with man-in-middle attacks. • Requires no client-specific state at server. Disadvantages • Requires protocol changes; not backwards compatible. • Requires significant processing time for each message. • Unpredictable running time degrades timestamp accuracy. 03 -Dec-20 14

Authentication scheme D (S-Key) o o o Scheme is based on public key (RSA)

Authentication scheme D (S-Key) o o o Scheme is based on public key (RSA) encryption and S-Key scheme • Certificated public values are provided by X. 509 infrastructure. • Server generates session key list, where each key is a one-way hash of the previous key, then computes the RSA signature of the final session key • Server uses keys in reverse order and generates a new list when the current one is exhausted; clients verify the hash of the current key equals the previous key • On request, a server returns the final session key; clients use this if many messages are lost • The message digest is computed and verified using the current key Advantages • Requires few protocol changes; backwards compatible • Requires only one additional hash Disadvantages • Vulnerable to certain man-in-the-middle attacks • Lost packets require clients to perform repeated hashes 03 -Dec-20 15

NTP security model Server/Peer Client/Peer Autokey Protocol Autokey Sequence Message Digest On-Wire Protocol

NTP security model Server/Peer Client/Peer Autokey Protocol Autokey Sequence Message Digest On-Wire Protocol

Autokey Source IP Address Dest. IP Address Key ID 4 octets MD 5 or

Autokey Source IP Address Dest. IP Address Key ID 4 octets MD 5 or SHA Hash Cookie 4 octets Digest Key 16 or 20 octets Key ID 4 octets

Autokey sequence Key ID 7 S(3) = 7 S(5) = 3 S(1) = 5

Autokey sequence Key ID 7 S(3) = 7 S(5) = 3 S(1) = 5 S(11) = 1 T 1 Key ID 7 T 2 Key ID 3 T 3 Key ID 5 T 4 Key ID 1 T 5 Key ID 11 Autokey Values Initial Key ID = 7 Initial Key Count = 4 Signature

Extension field ER VN Code Length Association ID Timestamp Filestamp Value Length Value Signature

Extension field ER VN Code Length Association ID Timestamp Filestamp Value Length Value Signature Length Signature

# ntpkey_MD 5 key_deacon. udel. edu. 3466889781 # Wed Nov 11 00: 56: 21

# ntpkey_MD 5 key_deacon. udel. edu. 3466889781 # Wed Nov 11 00: 56: 21 2009 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 MD 5 Ce. R(+`9 LRc. Y; 4 a. O=? G 0 A # MD 5 key MD 7|v 5. o}0 Gg[&; ? ? CVIg. F # MD 5 key MD 5 -Sc'>9; @Ya. Er. I&6 X+7 vm # MD 5 key MD 5 f!. v. B@^Yj}? 7 Gm<B. : QQ # MD 5 key MD 5 7^'i$ng/Aohz. F 9 rn+n(i # MD 5 key MD 5 s'/`N 0=Q? C(f 74 QCV+5< # MD 5 key MD 5 XE*Aq 2 ra? P|1 AP<F 3 x # MD 5 key MD 5 v^S}jq. B`o. R!g. G!: %__n. M # MD 5 key MD 5 c. BV 6 -RBL&M[s. Pdu. B]=>d # MD 5 key MD 5 2 late 4 Me # MD 5 key SHA 1 098 ff 18 eea 4 abff 26 e 81722 c 72 faf 7 c 345833119 # SHA 1 key SHA 1 da 0261 d 0451785086 ff 327751713 aa 225 a 871 f 25 # SHA 1 key SHA 1 61 d 624 c 9420 c 07 fb 70 d 1078 a 065 e 706 c 031746 ed # SHA 1 key SHA 1 e 158 bf 9972701 bbb 343 ec 3 f 147 b 09 c 97 c 5227151 # SHA 1 key SHA b 17 b 9072 e 97 dc 0221 ca 8 c 65 d 1522752669 bee 286 # SHA key MD 2 73 a 92 cee 3 b 9576 a 66 ab 3 dbb 267 cd 31 d 220 dbbfb 7 # MD 2 key MD 4 4 d 57 a 90937544983 c 44 c 83 adbefb 91 e 3 d 880008 e # MD 4 key MD 5 e 8955 d 03918 ac 337 a 7 cd 826 b 824 c 49 ce 0 fa 024 c 0 # MD 5 key MDC 2 24 e 914 b 67 aee 4 e 6 c 8387 ae 1 ef 37 d 987 cde 1 cf 1 be # MDC 2 key RIPEMD 160 a 8 defc 6 d 2 b 9 a 773 a 3 f 94553 e 94 e 452526 edc 3514 # RIPEMD 160 key

NTP symmetric key cryptography o o NTP symmetric key cryptography is based on keyed

NTP symmetric key cryptography o o NTP symmetric key cryptography is based on keyed MD 5 message digests. • A message authentication code (MAC) is computed as the MD 5 digest of the message concatenated with the group key. • The computed MAC follows the message in the transmitted packet. • The receiver computes the MAC in the same way and verifies it matches the MAC in the packet. The group key consists of a 32 -bit key ID and a 128 -bit MD 5 key. • Each group has a different key distinguished by the key ID included in the MAC. • Keys are created by the group trusted host and distributed by secure means. • Keys have indefinite lifetime, but can be activated and deactivated by configuration or remotely. 03 -Dec-20 21

NTP public key cryptography o NTP and security protocol work independently for each client,

NTP public key cryptography o NTP and security protocol work independently for each client, with tentative outcomes confirmed only after both succeed. o Public keys and certificates are obtained and verified relatively infrequently using X. 509 certificates and certificate trails. o Session keys are derived from public keys using fast algorithms. o Each NTP message is individually authenticated using session key and message digest (keyed MD 5). o A proventic trail is a sequence of NTP servers each synchronized and cryptographically verified to the next lower stratum server and ending on one or more trusted primary time servers. o Proventic trails are constructed by induction from the primary servers to secondary servers at increasing stratum levels. o When server time and at least one proventic trail are verified, the peer is admitted to the population used to synchronize the system clock. 03 -Dec-20 22

NTP Autokey o o NTP public key cryptography is based on the Internet security

NTP Autokey o o NTP public key cryptography is based on the Internet security infrastructure and Public Key Infrastructure (PKI) principles. • Each group host generates a RSA or DSA public/private key pair and selfsigned X 509 v 3 certificate. • The trusted group host certificate is explicitly designated as trusted using a X 509 v 3 extension field. • A certificate trail is established dynamically where a client convinces the next lower stratum server to sign its certificate, which is then available to its own dependent clients. • A special purpose security protocol called Autokey verifies and instantiates cryptographic values as required. • At initialization Autokey recursively obtains certificates until terminating with the trusted certificate which authenticates the path. In order to protect against middleman attacks, an optional cryptographic identity scheme can be used. 03 -Dec-20 23

Identification exchange Client Compute nonce 1 and send Verify hash response and signature o

Identification exchange Client Compute nonce 1 and send Verify hash response and signature o Server Challenge Request Challenge Response Compute nonce 2 and response Send response and signature This is a challenge-response scheme • Client Alice and server Bob share a common set of parameters and a private group key b. • Alice rolls random nonce r and sends to Bob. • Bob rolls random nonce k, computes a one-way function f(r, k, b) and sends to Alice. • Alice computes some function g(f, b) to verify that Bob knows b. o The signature prevents message modification and binds the response to Bob’s private key. o An interceptor can see the challenge and response, but cannot determine k or b or how to construct a response acceptable to Alice. 03 -Dec-20 24

Identity schemes o Private certificate (PC) scheme • o Trusted certificate (TC) scheme (default)

Identity schemes o Private certificate (PC) scheme • o Trusted certificate (TC) scheme (default) • o The certificate trail is validated to a self signed certificate marked trusted. The identity exchange is not used. This scheme is vulnerable to a middleman masquerade. Schnorr (IFF) scheme • o Trusted agent generates a certificate marked private and transmits it by secure means to all group members. The certificate is never divulged outside the group and never presented for signature. Trusted agent generates the IFF parameters and transmits them by secure means to all group members. The IFF identity exchange is used to verify group credentials. Guillou-Quisquater (GQ) scheme • Trusted agent generates the GQ parameters and transmits them by secure means to all group members. Each member generates a GQ private/public key pair and certificates with the public key in an extension field. The GQ identity exchange is used to verify group credentials. 03 -Dec-20 25

Identity schemes (continued) o Mu-Varadharajan (MV) scheme • This scheme is intended for servers

Identity schemes (continued) o Mu-Varadharajan (MV) scheme • This scheme is intended for servers with untrusted dependent clients and where the ultimate trust rests with a trusted agent. The trusted agent generates parameters and private encryption keys for the server group and private decryption keys for the client group. The MV identity exchange is used to verify server credentials. 03 -Dec-20 26

Future plans o Deploy, test and evaluate NTP Version 4 daemon in testbeds, then

Future plans o Deploy, test and evaluate NTP Version 4 daemon in testbeds, then at friendly sites in the US, Europe and Asia o Revise the NTP formal specification and launch on standards track o Participate in deployment strategies with NIST, USNO, others o Prosecute standards agendae in IETF, ANSI, ITU, POSIX o Develop scenarios for other applications such as web caching, DNS servers and other multicast services 03 -Dec-20 27

Further information o o Network Time Protocol (NTP): http: //www. ntp. org/ • Current

Further information o o Network Time Protocol (NTP): http: //www. ntp. org/ • Current NTP Version 3 and 4 software and documentation • FAQ and links to other sources and interesting places David L. Mills: http: //www. eecis. udel. edu/~mills • Papers, reports and memoranda in Post. Script and PDF formats • Briefings in HTML, Post. Script, Power. Point and PDF formats • Collaboration resources hardware, software and documentation • Songs, photo galleries and after-dinner speech scripts FTP server ftp. udel. edu (pub/ntp directory) • Current NTP Version 3 and 4 software and documentation repository • Collaboration resources repository Related project descriptions and briefings • See “Current Research Project Descriptions and Briefings” at http: //www. eecis. udel. edu/~mills/status. htm 03 -Dec-20 28