From: Harlan Stenn The restriction facility was implemented in conformance with the
access policies for the original NSFnet backbone time servers.
-While this facility may be otherwise useful for keeping unwanted or
-broken remote time servers from affecting your own, it should not
-be considered an alternative to the standard NTP authentication
-facility. Source address based restrictions are easily circumvented
-by a determined cracker.
Access Control Support
-ntpd implements a general purpose address-and-mask based
-restriction list. The list is sorted by address and by mask, and
-the list is searched in this order for matches, with the last match
-found defining the restriction flags associated with the incoming
-packets. The source address of incoming packets is used for the
-match, with the 32- bit address being and'ed with the mask
-associated with the restriction entry and then compared with the
-entry's address (which has also been and'ed with the mask) to look
-for a match. Additional information and examples can be found in
-the Notes on Configuring NTP and Setting up a
-NTP Subnet page.
+ntpd implements a general purpose address/mask based
+restriction list. The list contains address/match entries sorted
+first by increasing address values and and then by increasing mask
+values. A match occurs when the bitwise AND of the mask and the
+packet source address is equal to the bitwise AND of the mask and
+address in the list. The list is searched in order with the last
+match found defining the restriction flags associated with the
+entry. Additional information and examples can be found in the Notes on Configuring NTP and Setting up a NTP
+Subnet page.
Clients can be denied service because they are explicitly +included in the restrict list created by the restrict +command or implicitly as the result of cryptographic or rate limit +violations. Cryptographic violations include certificate or +identity verification failure; rate limit violations generally +result from multiple clients from the same network congesting the +server . Cryptographic violations cause the single offender to be +denied further access, while rate limit violations cause the entire +network to be denied access. When a client or network is denied +access for these reasons, the only way at present to remove the +restrictions is by restarting the server.
A client or peer receiving a kiss-of-death packet performs a set -of sanity checks to minimize security exposure. If this is the -first packet received from the server, the client assumes an access -denied condition at the server. It updates the stratum and -reference identifier peer variables and sets the access denied -(test 4) bit in the peer flash variable. If this bit is set, the -client sends no packets to the server. If this is not the first -packet, the client assumes a client limit condition at the server, -but does not update the peer variables. In either case, a message -is sent to the system log.
+for this purpose called the "kiss-of-death" (KOD) packet. KOD +packets have the leap bits set unsynchronized and stratum set to +zero and the reference identifier field set to a four-byte ASCII +code. If the noserve flag of the matching restrict list +entry is set, the code is "DENY"; if the limited flag is +set and the rate limit is exceeded, the code is "RATE". Finally, if +a cryptographic violation occurs, the code is "CRYP". + +A client receiving a KOD performs a set of sanity checks to +minimize security exposure, then updates the stratum and reference +identifier peer variables, sets the access denied (TEST4) bit in +the peer flash variable and sends a message to the log. As long as +the TEST4 bit is set, the client will send no further packets to +the server. The only way at present to recover from this condition +is to restart the protocol at both the client and server. This +happens automatically at the client when the association times out. +It will happen at the server only if the server operator +cooperates.
Authentication is always enabled, although ineffective if no -keys are configured as described below. If a NTP packet arrives -including a message authentication code (MAC), only if it passes -all cryptographic checks is it accepted for further processing. The -checks require correct key ID, key value and message contents. If -the packet has been modified in any way or replayed by an intruder, -it will fail one or more of these checks and be discarded. +
Authentication is always enabled, although ineffective if not +configured as described below. If a NTP packet arrives including a +message authentication code (MAC), only if it passes all +cryptographic checks is it accepted for further processing. The +checks require correct key ID, key value and message digest. If the +packet has been modified in any way or replayed by an intruder, it +will fail one or more of these checks and be discarded. Furthermore, the Autokey scheme requires a preliminary protocol exchange to obtain the server public key, verify its credentials and compute a private session key.
@@ -70,69 +70,53 @@ remote configuration commands require cryptographic authentication. This flag can be set or reset by the enable and disable commands and also by remote configuration commands sent by a ntpdc program running in another machine. If -this flag is enabled, which is the default case, new broadcast -client and symmetric passive associations and remote configuration -commands must be cryptographically authenticated using either -symmetric key or public key schemes. If this flag is disabled, -these operations are effective even if not cryptographic -authenticated. - -It should be understood that operating with the auth -disabled invites a significant vulnerability where a rogue hacker -can seriously disrupt system timekeeping. It is important to note -that this flag has no purpose other than to allow or disallow a new -association in response to new broadcast client and symmetric -passive associations and remote configuration commands and, in -particular, the flag has no effect on the authentication process -itself.
- -In networks with firewalls and large numbers of broadcast -clients it may be acceptable to disable authentication, since that -avoids key distribution and simplifies network maintenance. -However, when the configuration file contains host names, or when a -server or client is configured remotely, host names are resolved -using the DNS and a separate name resolution process. In order to -protect against bogus configuration messages, name resolution -messages are authenticated using an internally generated key which -is normally invisible to the user. However, if cryptographic -support is disabled, the name resolution process will fail. This -can be avoided either by specifying IP addresses instead of host -names, which is generally inadvisable, or by enabling the -authflag for name resolution and disabled it once the name -resolution process is complete.
+this flag is enabled, which is the default case, new +broadcast/manycast client and symmetric passive associations and +remote configuration commands must be cryptographically +authenticated using either symmetric key or public key schemes. If +this flag is disabled, these operations are effective even if not +cryptographic authenticated. It should be understood that operating +with the auth disabled invites a significant vulnerability +where a rogue hacker can seriously disrupt system timekeeping. It +is important to note that this flag has no purpose other than to +allow or disallow a new association in response to new broadcast +and symmetric active messages and remote configuration commands +and, in particular, the flag has no effect on the authentication +process itself.An attractive alternative where multicast support is available is manycast mode, in which clients periodically troll for servers as described in the Association Management -page. Cryptographic authentication in this mode the Autokey -protocol described below. The principle advantage of manycast mode -is that potential servers need not be configured in advance, since -the client finds them during regular operation, and the -configuration files for all clients can be identical.
+page. Either symmetric key or public key cryptographic +authentication can be used in this mode. The principle advantage of +manycast mode is that potential servers need not be configured in +advance, since the client finds them during regular operation, and +the configuration files for all clients can be identical.While the algorithms for symmetric key cryptography are included in the NTPv4 distribution, public key cryptography requires the OpenSSL software library to be installed before building the NTP -distribution. Public key cryptography provides secure -authentication of servers without compromising accuracy and -stability. The security model and protocol schemes for both -symmetric key and public key cryptography are summarized below and -detailed in the briefings, papers and reports at www.ntp.org.
+distribution. Directions for doing that are on the Building and Installing the Distribution page. + +The security model and protocol schemes for both symmetric key +and public key cryptography are summarized below; further details +are in the briefings, papers and reports at the NTP project page +linked from www.ntp.org.
When ntpd is first started, it reads the key file specified in the keys configuration command and installs @@ -153,42 +137,45 @@ utility.
in RFC-1305 and in addition the Autokey protocol, which is based on public key cryptography. The Autokey Version 2 protocol verifies packet integrity using MD5 message digests and verifies the source -with digital signatures and any of several digest/signature schemes -available in the OpenSSL software library. This library is -available from -http://www.openssl.org and can be installed using the -procedures outlined in the Building and -Installing the Distribution page. Once installed, the configure -and build process automatically detects the library and links the -interface routines required. +with digital signatures and any of several digest/signature +schemes. Optional identification schemes based on cryptographic +challenge/response algorithms are also available. Using all of +these schemes provides strong security against replay with or +without modification, spoofing, masquerade and most forms of +clogging attacks. + +The cryptographic means necessary for all Autokey operations +provided by the OpenSSL software library. This library is available +from http://www.openssl.org +and can be installed using the procedures outlined in the Building and Installing the Distribution page. Once +installed, the configure and build process automatically detects +the library and links the interface routines required.
The Autokey protocol has several modes of operation -corresponding to the various NTP modes supported. Digital -signatures with any of several message digest and signature -encryption schemes are used in all modes to verify that the server -is authentic and not an intruder. Most modes use a special cookie -which can be computed independently by the client and server, but -encrypted in transmission. All modes use in addition a variant of -the S-KEY scheme, in which a pseudo-random key list is generated -and used in reverse order. These schemes are described along with -an executive summary, current status, briefing slides and reading -list, on the Autonomous Authentication page.
The specific cryptographic environment used by Autokey servers and clients is determined by a set of files and soft links. This -includes a host key file, certificate file and optional sign file -and leapsecond file. The digest/signature scheme is specified in -the X.509 certificate configured during installation along with the -matching sign key. There are several schemes available in the -OpenSSL software library, each identified by a specific string such -as md5WithRSAEncryption, which stands for the MD5 message -digest with RSA encryption scheme. The current NTP distribution -supports all the schemes in the OpenSSL library, including those -based on RSA and DSA digital signatures. The schemes currently -available are described in the -ntp-genkeys page.
+includes a required host key file, required certificate file and +optional sign key file, leapsecond file and identification scheme +files. The digest/signature scheme is specified in the X.509 +certificate along with the matching sign key. There are several +schemes available in the OpenSSL software library, each identified +by a specific string such as md5WithRSAEncryption, which +stands for the MD5 message digest with RSA encryption scheme. The +current NTP distribution supports all the schemes in the OpenSSL +library, including those based on RSA and DSA digital signatures. +The schemes currently available are described in the ntp-keygen page.The digest/signature scheme and certificate are provided to dependent clients in the Autokey protocol. Different client or peer @@ -205,86 +192,131 @@ algorithm specified in the certificate.
explanation of the subprotocols, called dances, is beyond the scope of this page. Detailed information and briefings can be found via the NTP project page at -www.ntp.org. Briefly, the all dances start out with a client -request for the server name and status word. The next step is to -request the server host certificate and the third to request the -certificate of the server that signed the first certificate. If the -client verifies the server certificate signature, the server is -pronounced authentic. The fourth step is to present a certificate -to the server acting as certificate authority and request that it -be signed and returned. This allows a client acting as a server for -the next higher stratum to prove authenticity. +www.ntp.org. Briefly, the dances start when a client requests +the server name and status word. Next, the client requests the +server host certificate used to verify the signature of subsequent +data supplied by the server. + +Next comes the identification procedure which confirms the +server group membership. There are four schemes to prove +identification: one using private certificates (PC), a second using +trusted certificates (TC), a third using a modified Schnorr +algorithm (IFF aka Identify Friend or Foe) and the fourth using a +modified Guillou-Quisquater (GQ) algorithm. The particular scheme +and required parameters and certificates are selected during +operation of the ntp-keygen utility.
+ +The PC scheme uses a private certificate as group key. The +certificate is distributed to all other group members by secret +means and never revealed outside the group. The TC scheme involves +a conventional certificate trail and a sequence of certificates, +each signed by an issuer one stratum level lower than the client +and terminating on a self signed trusted certificate, as described +in RFC-2510.
+ +The two remaining schemes involve a cryptographically strong +challenge-response exchange. Both the IFF and GQ schemes start when +the client sends a nonce to the server, which then rolls its own +nonce, performs a mathematical operation and sends the results +along with a message digest to the client. The client performs a +second mathematical operation to produce a digest that must match +the one included in the message.
The next steps retrieve the cryptographic values needed in the particular dance, including the cookie, autokey values and -leapsecond table. As one of these steps the client presents the -server with its certificate and asks that it be signed using the -server private key. The server response is saved for future -dependent clients as proof that the client itself is a legitimate -member of the community and not an intruder attempting to -impersonate a legitimate member.
+leapsecond table. As a required step in the TC identification +scheme, the client presents the server with its certificate and +asks that it be signed using the server private key. The server +response is saved for future dependent clients to walk the +certificate trail. + +A specific combination of authentication scheme (none, symmetric +key, public key) and identification scheme (PC, TC, IFF, GQ) is +called a cryptotype, although not all combinations are legal. There +may be management configurations where the clients, servers and +peers may not all support the same cryptotypes. A secure NTPv4 +subnet can be configured in several ways while keeping in mind the +principles explained in this section. Note however that some +cryptotype combinations may successfully interoperate with each +other, but may not represent good security practice.
+ +The cryptotype of an association is determined at the time of +mobilization, either at configuration time or some time later when +a message of appropriate cryptotype arrives. When mobilized by a +server or peer configuration command and no +key or autokey subcommands are present, the +association is not authenticated; if the key subcommand is +present, the association is authenticated using the symmetric key +ID given as argument; if the autokey subcommand is +present, the association is authenticated using Autokey.
+ +When multiple identification schemes are supported in the +Autokey protocol, the first message exchange determines which one +is used. The client request message contains bits corresponding to +which schemes it has available. The server response message +contains bits corresponding to which schemes it has available. Both +server and client match the received bits with their own and select +the common scheme judged most secure. For this purpose the order +from most secure to least is GC, IFF, TC. Note that PC does not +interoperate with any of the rest, since they require the server +certificate which a PC server will not reveal.
+ +Following the principle that time is a public value, a server +responds to any client packet that matches its cryptotype +capabilities. Thus, a server receiving an unauthenticated packet +will respond with an unauthenticated packet, while the same server +receiving a packet of a cryptotype it supports will respond with +packets of that cryptotype. However, unconfigured broadcast or +manycast client associations or symmetric passive associations will +not be mobilized unless the server supports a cryptotype compatible +with the first packet received. By default, unauthenticated +associations will not be mobilized unless overridden in a decidedly +dangerous way.
+ +Some examples may help to reduce confusion. Client Alice has no +specific cryptotype selected. Server Bob has both a symmetric key +file and minimal Autokey files. Alice's unauthenticated messages +arrive at Bob, who replies with unauthenticated messages. Cathy has +a copy of Bob's symmetric key file and has selected key ID 4 in +messages to Bob. Bob verifies the message with his key ID 4. If +it's the same key and the message is verified, Bob sends Cathy a +reply authenticated with that key. If verification fails, Bob sends +Cathy a thing called a crypto-NAK, which tells her something broke. +She can see the evidence using the ntpq program.
+ +Denise has rolled her own host key and certificate. She also +uses one of the identification schemes as Bob. She sends the first +Autokey message to Bob and they both dance the protocol +authentication and identification steps. If all comes out okay, +Denise and Bob continue as described above and in the Internet +Draft cited earlier.
+ +It should be clear from the above that Bob can support all the +girls at the same time, as long as he has compatible authentication +and identification credentials. Now, Bob can act just like the +girls in his own choice of servers; he can run multiple configured +associations with multiple different servers (or the same server, +although that might not be useful). But, wise security policy might +preclude some cryptotype combinations; for instance, running an +identification scheme with one server and no authentication with +another might not be wise.
The cryptographic values used by the Autokey protocol are incorporated as a set of files generated by the ntp-genkeys utility program, including -the required symmetric keys, host key pair and public certificate -files and optional sign key and leapseconds files. The symmetric -keys file is necessary for the ntpq and ntpdc -utility programs. The remaining files are necessary for the Autokey -protocol. The files incorporate cryptographic values generated by -the OpenSSL library algorithms and are in printable PEM-encoded -ASCII format. Further information about these files and how they -are generated and installed is on the ntp-genkeys -page.
- -All key files are installed by default in -/usr/local/etc, which is normally in a shared filesystem in -NFS-mounted networks and avoids installing them in each machine -separately. The default can be overridden by the keysdir -configuration command. Ordinarily, the host keys are permitted root -read-only; the others are public values permitted world readable. -Since uniqueness is insured by the hostname and file name -extensions, the files for a NFS server and dependent clients can -all be installed in the same directory. This is different than the -original Autokey version 1 support, which required the private key -to be installed separately for each client.
- -The recommended practice is to keep the file name extensions -when installing a file and to install a soft link from the default -name specified in the ntp-genkeys page to the actual file. -This allows new file generations to be activated simply by changing -the link. However, ntpd parses the link name when present -to extract the filestamp and sends it along with the public key and -host name when requested. This allows clients to verify that the -file and generation time are always current. The actual location of -each file can be overridden by the crypto configuration -command, but this is not recommended.
- -All cryptographic keys and related values should be regenerated -on a periodic and automatic basis, like once per month. The -ntp-genkeys program uses the same timestamp extension for all -files generated at one time, so each generation is distinct and can -be readily recognized in monitoring data. While a host key pair and -certificate must be generated by every server and peer, the -certificates do not need to be explicitly copied to all machines in -the same security compartment, since they can be obtained -automatically using the Autokey protocol.
- -Servers and peers can make a new generation in the following -way. All machines have loaded the current keys and certificate at -startup. At designated intervals, each machine generates a new -public/private key pair and certificate and makes links from the -default file names to the new file names. The ntpd daemon -is restarted after each new generation and load the new files. The -Autokey protocol is designed so that after a few minutes the -clients time out and restart the protocol from the beginning, with -result the new generation is loaded and operation continues as -before. If for some reason this does not happen, the ntpd -daemon refreshes all crhyptographic values at intervals of about -one day, so that the protocol is restarted for all client -associations and results in the same actions.
+"genkeys.htm">ntp-keygen utility program, including +symmetric keys, required host key and public certificate files and +optional sign key, identification parameters and leapseconds files. +The symmetric keys file is necessary for the ntpq and +ntpdc utility programs. The remaining files are necessary only +for the Autokey protocol. The files incorporate cryptographic +values generated by the OpenSSL library algorithms and are in +printable PEM-encoded ASCII format. Further information about these +files and how they are generated and installed is on the +ntp-keygen page.The entropy seed used by the OpenSSL library is contained in a file, usually called .rnd, which must be available when -starting the NTP daemon or the ntp-genkeys program. The -NTP daemon will first look for the file using the path specified by -the randfile subcommand of the crypto command. If -not specified in this way, or when starting the -ntp-genkeys program, the OpenSSL library will look for the -file using the path specified by the RANDFILE environment -variable in the user home directory, whether root or some other -user. If the RANDFILE environment variable is not present, -the library will look for the .rnd file in the user home -directory. If the file is not available or cannot be written, the -daemon exits with a message to the system log and the -ntp-genkeys program exits with a suitable error message.
+starting the NTP daemon or the ntp-keygen program. The NTP +daemon will first look for the file using the path specified by the +randfile subcommand of the crypto command. If not +specified in this way, or when starting the ntp-keygen +program, the OpenSSL library will look for the file using the path +specified by the RANDFILE environment variable in the user +home directory, whether root or some other user. If the +RANDFILE environment variable is not present, the library will +look for the .rnd file in the user home directory. If the +file is not available or cannot be written, the daemon exits with a +message to the system log and the ntp-keygen program exits +with a suitable error message.The daemon will occasionally add additional entropy and write to the file when generating new keys and certificates, for example, so -the file must be writable by root. If the ntp-genkeys +the file must be writable by root. If the ntp-keygen program is run by other than root, or if the Unix su command is used to assume root, the home directory assumed by the OpenSSL library might not be root. Probably the safest way to generate keys is to log in as root, change to the keys directory -and run the ntp-genkeys program from there
+and run the ntp-keygen program from thereSee the ntp-genkeys page.
+See the ntp-keygen page.

from Pogo,
-Walt Kelly
-
-Gnu autoconfigure tools are in the backpack.
-
Configuration options are specified as arguments to the -configure script. Following is a summary of the current -options, as of the 4.0.99m version: - -
Usage: configure [options] [host]
-
Options: [defaults in brackets after descriptions]
-Configuration:
-
+ + + + +-Directory and file names: +Directory and file names: -Configuration Options + + +Configuration Options
+ +from Pogo, +Walt Kelly + +
Gnu autoconfigure tools are in the backpack.
+ +
+
+Basic Configuration Options - the configure +utility
+ +The following options are for compiling and installing a working +version of the NTP distribution. In most cases, the build process +is completely automatic. In some cases where memory space is at a +premium, or the binaries are to be installed in a different place, +it is possible to tailor the configuration to remove such features +as reference clock driver support, debugging support, and so forth. + + +Configuration options are specified as arguments to the +configure script. Following is a summary of the current +options, as of the 4.0.99m version:
+ +Usage: configure [options] [host]
+ +
+Options: [defaults in brackets after descriptions] +Configuration:--cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print `checking...' messages --version print the version of autoconf that created configure -+
+-Host type: +Host type: ---prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX @@ -68,19 +75,19 @@ names names --program-transform-name=PROGRAM run sed PROGRAM on installed program names -+
+-Optional packages: +Optional packages: ---build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] -+
+-Optional features: +Optional features: ---with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) @@ -91,11 +98,11 @@ Optional packages: crypto=autokey Use autokey cryptography crypto=rsaref Use the RSAREF library electricfence Compile with ElectricFence malloc debugger -+
+Radio clocks (these are ordinarily enabled, if supported by the -machine and operating system): +machine and operating system): ---disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] @@ -115,12 +122,12 @@ Optional features: tick=VALUE Force a value for 'tick' tickadj=VALUE Force a value for 'tickadj' udp-wildcard Use UDP wildcard delivery -+
+-PARSE Clocks: +PARSE Clocks: -all-clocks Include drivers for all suitable non-PARSE clocks [enable] ACTS NIST dialup clock @@ -163,11 +170,11 @@ clocks [enable] ULINK Ultralink WWVB receiver USNO US Naval Observatory dialup clock WWV WWV audio receiver -+
++ +parse-clocks Include drivers for all suitable PARSE clocks [enable] COMPUTIME Diem Computime Radio Clock @@ -181,8 +188,12 @@ PARSE Clocks: TRIMTSIP Trimble GPS/TSIP Protocol VARITEXT VARITEXT clock WHARTON Wharton 400A Series clock -+
+David L. Mills
+<mills@udel.edu>
+
+
-
David L. Mills <mills@udel.edu>
-