6. Clock and Secret Distribution
The protocols described in Sections 4 and 5 assume the existence of loosely synchronized clocks and shared secret values. Three requirements constrain the strategy by which clock values and secrets are distributed.
-
If the value of an authentication clock is decreased, the last-timestamp and private authentication key must be changed concurrently.
When the value of an authentication clock is decreased, messages that have been sent with a timestamp value between the value of the authentication clock and its new value may be replayed. Changing the private authentication key obviates this threat. However, changing the authentication clock and the private authentication key is not sufficient to ensure proper operation. If the last-timestamp is not reduced similarly to the authentication clock, no message will be considered authentic until the value of the authentication clock exceeds the value of the last-timestamp.
-
The private authentication key and private privacy key must be known only to the parties requiring knowledge of them.
Protecting the secrets from disclosure is critical to the security of the protocols. In particular, if the secrets are distributed via a network, the secrets must be protected with a protocol that supports confidentiality, e.g., the Symmetric Privacy Protocol. Further, knowledge of the secrets must be as restricted as possible within an implementation. In particular, although the secrets may be known to one or more persons during the initial configuration of a device, the secrets should be changed immediately after configuration such that their actual value is known only to the software. A management station has the additional responsibility of recovering the state of all parties whenever it boots, and it may address this responsibility by recording the secrets on a long-term storage device. Access to information on this device must be as restricted as is practically possible.
-
There must exist at least one SNMP protocol entity that assumes the role of a responsible management station.
This management station is responsible for ensuring that all authentication clocks are synchronized and for changing the secret values when necessary. Although more than one management station may share this responsibility, their coordination is essential to the secure management of the network. The mechanism by which multiple management stations ensure that no more than one of them attempts to synchronize the clocks or update the secrets at any one time is a local implementation issue.
A responsible management station may either support clock synchronization and secret distribution as separate functions, or combine them into a single functional unit.
The first section below specifies the procedures by which a SNMP protocol entity is initially configured. The next two sections describe one strategy for distributing clock values and one for determining a synchronized clock value among SNMP parties supporting the Digest Authentication Protocol. For SNMP parties supporting the Symmetric Privacy Protocol, the next section describes a strategy for distributing secret values. The last section specifies the procedures by which a SNMP protocol entity recovers from a "crash."
6.1. Initial Configuration
This section describes the initial configuration of a SNMP protocol entity that supports the Digest Authentication Protocol or both the Digest Authentication Protocol and the Symmetric Privacy Protocol.
When a network device is first installed, its initial, secure configuration must be done manually, i.e., a person must physically visit the device and enter the initial secret values for at least its first secure SNMP party. This requirement suggests that the person will have knowledge of the initial secret values.
In general, the security of a system is enhanced as the number of entities that know a secret is reduced. Requiring a person to physically visit a device every time a SNMP party is configured not only exposes the secrets unnecessarily but is administratively prohibitive. In particular, when MD5 is used, the initial authentication secret is 128 bits long and when DES is used an additional 128 bits are needed -- 64 bits each for the key and initialization vector. Clearly, these values will need to be recorded on a medium in order to be transported between a responsible management station and a managed agent. The recommended procedure is to configure a small set of initial SNMP parties for each SNMP protocol entity, one pair of which may be used initially to configure all other SNMP parties.
In fact, there is a minimal, useful set of SNMP parties that could be configured between each responsible management station and managed agent. This minimal set includes one of each of the following for both the responsible management station and the managed agent:
-
a SNMP party for which the authentication protocol and privacy protocol are the values noAuth and noPriv, respectively,
-
a SNMP party for which the authentication protocol identifies the mechanism defined in Section 2.4.1 and its privacy protocol is the value noPriv, and
-
a SNMP party for which the authentication protocol and privacy protocol identify the mechanisms defined in Section 2.4.1 and Section 2.4.2, respectively.
The last of these SNMP parties in both the responsible management station and the managed agent could be used to configure all other SNMP parties. It is the only suitable party for this purpose because it is the only party that supports data confidentiality, which is necessary in order to protect the distributed secrets from disclosure to unauthorized entities.
Configuring one pair of SNMP parties to be used to configure all other parties has the advantage of exposing only one pair of secrets -- the secrets used to configure the minimal, useful set identified above. To limit this exposure, the responsible management station should change these values as its first operation upon completion of the initial configuration. In this way, secrets are known only to the peers requiring knowledge of them in order to communicate.
The Management Information Base (MIB) document [4] supporting these security protocols specifies 6 initial party identities and initial values, which, by convention, are assigned to the parties and their associated parameters.
All 6 parties should be configured in each new managed agent and its responsible management station. The responsible management station should be configured first, since the management station can be used to generate the initial secrets and provide them to a person, on a suitable medium, for distribution to the managed agent. The following sequence of steps describes the initial configuration of a managed agent and its responsible management station.
-
Determine the initial values for each of the attributes of the SNMP party to be configured. Some of these values may be computed by the responsible management station, some may be specified in the MIB document, and some may be administratively determined.
-
Configure the parties in the responsible management station, according to the set of initial values. If the management station is computing some initial values to be entered into the agent, an appropriate medium must be present to record the values.
-
Configure the parties in the managed agent, according to the set of initial values.
-
The responsible management station must synchronize the authentication clock values for each party it shares with each managed agent. Section 6.3 specifies one strategy by which this could be accomplished.
-
The responsible management station should change the secret values manually configured to ensure the actual values are known only to the peers requiring knowledge of them in order to communicate. To do this, the management station generates new secrets for each party to be reconfigured and distributes those secrets with a strategy that uses a protocol that protects them from disclosure, e.g., Symmetric Privacy Protocol (see Section 6.4). Upon receiving positive acknowledgement that the new values have been distributed, the management station should update its local database with the new values.
If the managed agent does not support a protocol that protects messages from disclosure, then automatic maintenance and configuration of parties is not possible, i.e., the last step above is not possible. The secrets can only be changed by a physical visit to the device.
If there are other SNMP protocol entities requiring knowledge of the secrets, the responsible management station must distribute the information upon completion of the initial configuration. The mechanism used must protect the secrets from disclosure to unauthorized entities. The Symmetric Privacy Protocol, for example, is an acceptable mechanism.
6.2. Clock Distribution
A responsible management station must ensure that the authentication clock value for each SNMP party for which it is responsible
-
is loosely synchronized among all the local databases in which it appears,
-
is reset, as indicated below, upon reaching its maximal value, and
-
is non-decreasing, except as indicated below.
The skew among the clock values must be accounted for in the lifetime value, in addition to the expected communication delivery delay.
A skewed authentication clock may be detected by a number of strategies, including knowledge of the accuracy of the system clock, unauthenticated queries of the party database, and recognition of authentication failures originated by the party.
Whenever clock skew is detected, and whenever the SNMP entities at both the responsible management station and the relevant managed agent support an appropriate privacy protocol (e.g., the Symmetric Privacy Protocol), a straightforward strategy for the correction of clock skew is simultaneous alteration of authentication clock and private key for the relevant SNMP party. If the request to alter the key and clock for a particular party originates from that same party, then, prior to transmitting that request, the local notion of the authentication clock is artificially advanced to assure acceptance of the request as authentic.
More generally, however, since an authentication clock value need not be protected from disclosure, it is not necessary that a managed agent support a privacy protocol in order for a responsible management station to correct skewed clock values. The procedure for correcting clock skew in the general case is presented in Section 6.3.
In addition to correcting skewed notions of authentication clocks, every SNMP entity must react correctly as an authentication clock approaches its maximal value. If the authentication clock for a particular SNMP party ever reaches the maximal time value, the clock must halt at that value. (The value of interest may be the maximum less lifetime. When authenticating a message, its authentication timestamp is added to lifetime and compared to the authentication clock. A SNMP protocol entity must guarantee that the sum is never greater than the maximal time value.) In this state, the only authenticated request a management station should generate for this party is one that alters the value of at least its authentication clock and private authentication key. In order to reset these values, the responsible management station may set the authentication timestamp in the message to the maximal time value. In this case, the nonce value may be used to distinguish multiple messages.
The value of the authentication clock for a particular SNMP party must never be altered such that its new value is less than its old value, unless its last-timestamp and private authentication key are also altered at the same time.
6.3. Clock Synchronization
Unless the secrets are changed at the same time, the correct way to synchronize clocks is to advance the slower clock to be equal to the faster clock. Suppose that party agentParty is realized by the SNMP entity in a managed agent; suppose that party mgrParty is realized by the SNMP entity in the corresponding responsible management station. For any pair of parties, there are four possible conditions of the authentication clocks that could require correction:
-
The management station's notion of the value of the authentication clock for agentParty exceeds the agent's notion.
-
The management station's notion of the value of the authentication clock for mgrParty exceeds the agent's notion.
-
The agent's notion of the value of the authentication clock for agentParty exceeds the management station's notion.
-
The agent's notion of the value of the authentication clock for mgrParty exceeds the management station's notion.
The selective clock acceleration mechanism intrinsic to the protocol corrects conditions 2 and 3 as part of the normal processing of an authentic message. Therefore, the clock adjustment procedure below does not provide for any adjustments in those cases. Rather, the following sequence of steps specifies how the clocks may be synchronized when condition 1, condition 4, or both of those conditions are manifest.
-
The responsible management station saves its existing notions of the authentication clocks for the two parties agentParty and mgrParty.
-
The responsible management station retrieves the authentication clock values for both agentParty and mgrParty from the agent. This retrieval must be an unauthenticated request, since the management station does not know if the clocks are synchronized. If the request fails, the clocks cannot be synchronized, and the clock adjustment procedure is aborted without further processing.
-
If the management station's notion of the authentication clock for agentParty exceeds the notion just retrieved from the agent by more than the amount of the communications delay between the two protocol entities, then condition 1 is manifest. The recommended estimate of communication delay in this context is one half of the lifetime value recorded for agentParty.
-
If the notion of the authentication clock for mgrParty just retrieved from the agent exceeds the management station's notion, then condition 4 is manifest, and the responsible management station advances its notion of the authentication clock for mgrParty to match the agent's notion.
-
If condition 1 is manifest, then the responsible management station sends an authenticated management operation to the agent that advances the agent's notion of the authentication clock for agentParty to be equal to the management station's notion. If this management operation fails, then the management station restores its previously saved notions of the clock values, and the clock adjustment procedure is aborted without further processing.
-
The responsible management station retrieves the authentication clock values for both agentParty and mgrParty from the agent. This retrieval must be an authenticated request, in order that the management station may verify that the clock values are properly synchronized. If this authenticated query fails, then the management station restores its previously saved notions of the clock values, and the clock adjustment procedure is aborted without further processing. Otherwise, clock synchronization has been successfully realized.
It is important to note step 4 above must be completed before attempting step 5. Otherwise, the agent may evaluate the request in step 5 as unauthentic. Similarly, step 5 above must be completed before attempting step 6. Otherwise, the management station may evaluate the query response in step 6 as unauthentic.
Administrative advancement of a clock as described above does not introduce any new vulnerabilities, since the value of the clock is intended to increase with the passage of time. A potential operational problem is the rejection of management operations that are authenticated using a previous value of the relevant party clock. This possibility may be avoided if a management station suppresses generation of management traffic between relevant parties while this clock adjustment procedure is in progress.
6.4. Secret Distribution
This section describes one strategy by which a SNMP protocol entity that supports both the Digest Authentication Protocol and the Symmetric Privacy Protocol can change the secrets for a particular SNMP party.
The frequency with which the secrets of a SNMP party should be changed is a local administrative issue. However, the more frequently a secret is used, the more frequently it should be changed. At a minimum, the secrets must be changed whenever the associated authentication clock approaches its maximal value (see Section 7). Note that, owing to both administrative and automatic advances of the authentication clock described in this memo, the authentication clock for a SNMP party may well approach its maximal value sooner than might otherwise be expected.
The following sequence of steps specifies how a responsible management station alters a secret value (i.e., the private authentication key or the private privacy key) for a particular SNMP party.
-
The responsible management station generates a new secret value.
-
The responsible management station encapsulates a SNMP Set request in a SNMP private management communication with at least the following properties.
-
Its source supports the Digest Authentication Protocol and the Symmetric Privacy Protocol.
-
Its destination supports the Symmetric Privacy Protocol and the Digest Authentication Protocol.
-
The SNMP private management communication is transmitted to its destination.
-
Upon receiving the request, the recipient processes the message according to [1] and [2].
-
The recipient encapsulates a SNMP Set response in a SNMP private management communication with at least the following properties.
-
Its source supports the Digest Authentication Protocol and the Symmetric Privacy Protocol.
-
Its destination supports the Symmetric Privacy Protocol and the Digest Authentication Protocol.
-
The SNMP private management communication is transmitted to its destination.
-
Upon receiving the response, the responsible management station updates its local database with the new value.
If the responsible management station does not receive a response to its request, there are two possible causes.
-
The request may not have been delivered to the destination.
-
The response may not have been delivered to the originator of the request.
In order to distinguish the two possible error conditions, a responsible management station could check the destination to see if the change has occurred. Unfortunately, since the secret values are unreadable, this is not directly possible.
The recommended strategy for verifying key changes is to set the public value corresponding to the secret being changed to a recognizable, novel value: that is, alter the public authentication key value for the relevant party when changing its private authentication key, or alter its public privacy key value when changing its private privacy key. In this way, the responsible management station may retrieve the public value when a response is not received, and verify whether or not the change has taken place. (This strategy is available since the public values are not used by the protocols defined in this memo. If this strategy is employed, then the public values are significant in this context. Of course, protocols using the public values may make use of this strategy directly.)
One other scenario worthy of mention is using a SNMP party to change its own secrets. In this case, the destination will change its local database prior to generating a response. Thus, the response will be constructed according to the new value. However, the responsible management station will not update its local database until after the response is received. This suggests the responsible management station may receive a response which will be evaluated as unauthentic, unless the correct secret is used. The responsible management station may either account for this scenario as a special case, or use an alteration of the relevant public values (as described above) to verify the key change.
Note, during the period of time after the request has been sent and before the response is received, the management station must keep track of both the old and new secret values. Since the delay may be the result of a network failure, the management station must be prepared to retain both values for an extended period of time, including across reboots.
6.5. Crash Recovery
This section describes the requirements for SNMP protocol entities in connection with recovery from system crashes or other service interruptions.
For each SNMP party in the local database for a particular SNMP protocol entity, its identity, authentication clock, private authentication key, and private privacy key must enjoy non-volatile, incorruptible representations. If possible, lifetime should also enjoy a non-volatile, incorruptible representation. If said protocol entity supports other security protocols or algorithms in addition to the two defined in this memo, then the authentication protocol and the privacy protocol for each party also require non-volatile, incorruptible representation.
The authentication clock of a SNMP party is a critical component of the overall security of the protocols. The inclusion of a reliable representation of a clock in a SNMP protocol entity enhances overall security. A reliable clock representation continues to increase according to the passage of time, even when the local SNMP protocol entity -- due to power loss or other system failure -- may not be operating. An example of a reliable clock representation is that provided by battery-powered clock-calendar devices incorporated into some contemporary systems. It is assumed that management stations always support reliable clock representations, where clock adjustment by a human operator during crash recovery may contribute to that reliability.
If a managed agent crashes and does not reboot in time for its responsible management station to prevent its authentication clock from reaching its maximal value, upon reboot the clock must be halted at its maximal value. The procedures specified in Section 6.3 would then apply.
If a managed network element supports a reliable clock representation, recovering from a crash requires few special actions. Upon recovery, those attributes of each SNMP party that do not enjoy non-volatile or reliable representation are initialized as follows.
-
If the private authentication key is not the OCTET STRING of zero length, the authentication protocol is set to identify use of the Digest Authentication Protocol in conjunction with the algorithm specified in Section 2.4.1.
-
The last-timestamp is initialized to the value of the authentication clock.
-
The nonce is initialized to zero.
-
If the lifetime is not retained, it should be initialized to zero.
-
If the private privacy key is not the OCTET STRING of zero length, the privacy protocol is set to identify use of the Symmetric Privacy Protocol in conjunction with the algorithm specified in Section 2.4.2.
Upon detecting that a managed agent has rebooted, a responsible management station must reset all other party attributes, including the lifetime if it was not retained. In order to reset the lifetime, the responsible management station should set the authentication timestamp in the message to the sum of the authentication clock and desired lifetime. This is an artificial advancement of the authentication timestamp in order to guarantee the message will be authentic when received by the recipient.
If, alternatively, a managed network element does not support a reliable clock representation, then those attributes of each SNMP party that do not enjoy non-volatile representation are initialized as follows.
-
If the private authentication key is not the OCTET STRING of zero length, the authentication protocol is set to identify use of the Digest Authentication Protocol in conjunction with the algorithm specified in Section 2.4.1.
-
The authentication clock is initialized to the maximal time value.
-
The last-timestamp is initialized to the maximal time value.
-
The nonce is initialized to zero.
-
If the lifetime is not retained, it should be initialized to zero.
-
If the private privacy key is not the OCTET STRING of zero length, the privacy protocol is set to identify use of the Symmetric Privacy Protocol in conjunction with the algorithm specified in Section 2.4.2.
The only authenticated request a management station should generate for a party in this initial state is one that alters the value of at least its authentication clock, private authentication key, and lifetime (if that was not retained). In order to reset these values, the responsible management station must set the authentication timestamp in the message to the maximal time value. The nonce value may be used to distinguish multiple messages.