Internet Draft User-based Security Model for SNMPv2 June 1995 User-based Security Model for Version 2 of the Simple Network Management Protocol (SNMPv2) Fri Jun 30 23:59:59 1995 draft-kzm-snmpv2-sec-alt-00.txt Keith McCloghrie Cisco Systems, Inc. kzm@cisco.com Marshall T. Rose Dover Beach Consulting, Inc. mrose@dbc.mtview.ca.us Glenn W. Waters Bell-Northern Research Ltd. gwaters@bnr.ca James M. Galvin Trusted Information Systems galvin@tis.com Status of this Memo This document is an Internet-Draft. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet- Drafts as reference material or to cite them other than as ``work in progress.'' Expires December 1995 [Page 1] Internet Draft User-based Security Model for SNMPv2 June 1995 To learn the current status of any Internet-Draft, please check the ``1id-abstracts.txt'' listing contained in the Internet- Drafts Shadow Directories on ds.internic.net (US East Coast), nic.nordu.net (Europe), ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific Rim). Expires December 1995 [Page 2] Internet Draft User-based Security Model for SNMPv2 June 1995 1. Introduction A management system contains: several (potentially many) nodes, each with a processing entity, termed an agent, which has access to management instrumentation; at least one management station; and, a management protocol, used to convey management information between the agents and management stations. Operations of the protocol are carried out under an administrative framework which defines authentication, authorization, access control, and privacy policies. Management stations execute management applications which monitor and control managed elements. Managed elements are devices such as hosts, routers, terminal servers, etc., which are monitored and controlled via access to their management information. The Administrative Infrastructure for SNMPv2 document [1] defines an administrative framework which realizes effective management in a variety of configurations and environments. In the administrative framework, a security model defines the mechanisms used to achieve an administratively-defined level of security for protocol interactions. Although many such security models might be defined, it is the purpose of this document, User-based Security Model for SNMPv2, to define the first, and, as of this writing, only, security model for the administrative framework. The administrative framework includes the provision of an access control model. The enforcement of access rights requires the means to identify the entity on whose behalf a request is generated. This SNMPv2 security model identifies an entity on whose behalf an SNMPv2 message is generated as a "user". 1.1. A Note on Terminology For the purpose of exposition, the original Internet-standard Network Management Framework, as described in RFCs 1155, 1157, and 1212, is termed the SNMP version 1 framework (SNMPv1). The current framework is termed the SNMP version 2 framework (SNMPv2). Expires December 1995 [Page 3] Internet Draft User-based Security Model for SNMPv2 June 1995 1.2. Threats Several of the classical threats to network protocols are applicable to the network management problem and therefore would be applicable to any SNMPv2 security model. Other threats are not applicable to the network management problem. This section discusses principal threats, secondary threats, and threats which are of lesser importance. The principal threats against which this SNMPv2 security model should provide protection are: Modification of Information The modification threat is the danger that some unauthorized entity may alter in-transit SNMPv2 messages generated on behalf of an authorized user in such a way as to effect unauthorized management operations, including falsifying the value of an object. Masquerade The masquerade threat is the danger that management operations not authorized for some user may be attempted by assuming the identity of another user that has the appropriate authorizations. Two secondary threats are also identified. The security protocols defined in this memo do provide protection against: Message Stream Modification The SNMPv2 protocol is typically based upon a connectionless transport service which may operate over any subnetwork service. The re-ordering, delay or replay of messages can and does occur through the natural operation of many such subnetwork services. The message stream modification threat is the danger that messages may be maliciously re-ordered, delayed or replayed to an extent which is greater than can occur through the natural operation of a subnetwork service, in order to effect unauthorized management operations. Disclosure The disclosure threat is the danger of eavesdropping on the exchanges between managed agents and a management station. Protecting against this threat may be required as a matter of local policy. There are at least two threats that an SNMPv2 security protocol need not protect against. The security protocols defined in this memo do not Expires December 1995 [Page 4] Internet Draft User-based Security Model for SNMPv2 June 1995 provide protection against: Denial of Service An SNMPv2 security protocol need not attempt to address the broad range of attacks by which service on behalf of authorized users is denied. Indeed, such denial-of-service attacks are in many cases indistinguishable from the type of network failures with which any viable network management protocol must cope as a matter of course. Traffic Analysis In addition, an SNMPv2 security protocol need not attempt to address traffic analysis attacks. Indeed, many traffic patterns are predictable - agents may be managed on a regular basis by a relatively small number of management stations - and therefore there is no significant advantage afforded by protecting against traffic analysis. 1.3. Goals and Constraints Based on the foregoing account of threats in the SNMP network management environment, the goals of this SNMPv2 security model are as follows. (1) The protocol should provide for verification that each received SNMPv2 message has not been modified during its transmission through the network in such a way that an unauthorized management operation might result. (2) The protocol should provide for verification of the identity of the user on whose behalf a received SNMPv2 message claims to have been generated. (3) The protocol should provide for detection of received SNMPv2 messages whose time of generation was not recent. (4) The protocol should provide, when necessary, that the contents of each received SNMPv2 message are protected from disclosure. In addition to the principal goal of supporting secure network management, the design of this SNMPv2 security model is also influenced by the following constraints: (1) When the requirements of effective management in times of network stress are inconsistent with those of security, the design should prefer the former. Expires December 1995 [Page 5] Internet Draft User-based Security Model for SNMPv2 June 1995 (2) Neither the security protocol nor its underlying security mechanisms should depend upon the ready availability of other network services (e.g., Network Time Protocol (NTP) or key management protocols). (3) A security mechanism should entail no changes to the basic SNMP network management philosophy. 1.4. Security Services The security services necessary to support the goals of an SNMPv2 security model are as follows. Data Integrity is the provision of the property that data has not been altered or destroyed in an unauthorized manner, nor have data sequences been altered to an extent greater than can occur non-maliciously. Data Origin Authentication is the provision of the property that the claimed identity of the user on whose behalf received data was originated is corroborated. Data Confidentiality is the provision of the property that information is not made available or disclosed to unauthorized individuals, entities, or processes. For the protocols specified in this memo, it is not possible to assure the specific originator of a received SNMPv2 message; rather, it is the user on whose behalf the message was originated that is authenticated. For these protocols, it not possible to obtain data integrity without data origin authentication, nor is it possible to obtain data origin authentication without data integrity. Further, there is no provision for data confidentiality without both data integrity and data origin authentication. The security protocols used in this memo are considered acceptably secure at the time of writing. However, the procedures allow for new authentication and privacy methods to be specified at a future time if the need arises. Expires December 1995 [Page 6] Internet Draft User-based Security Model for SNMPv2 June 1995 1.5. Mechanisms The security protocols defined in this memo employ several types of mechanisms in order to realize the goals and security services described above: - In support of data integrity, a message digest algorithm is required. A digest is calculated over an appropriate portion of an SNMPv2 message and included as part of the message sent to the recipient. - In support of data origin authentication and data integrity, a secret value is inserted into the SNMPv2 message prior to computing the digest and then overwritten prior to transmission. The secret value is shared by all SNMPv2 entities authorized to originate messages on behalf of the appropriate user. - To protect against the threat of message delay or replay (to an extent greater than can occur through normal operation), a set of time indicators are included in each message generated. A recipient evaluates the time indicators to determine if the message is recent. This protection against the threat of message delay or replay does not imply nor provide any protection against unauthorized deletion or suppression of messages. Other mechanisms defined independently of the security protocol can also be used to detect message replay (e.g., the request-id [12]), or for set operations, the re-ordering, replay, deletion, or suppression of messages (e.g., the MIB variable snmpSetSerialNo [14]). - In support of data confidentiality, an encryption algorithm is required. An appropriate portion of the message is encrypted prior to being transmitted. Expires December 1995 [Page 7] Internet Draft User-based Security Model for SNMPv2 June 1995 1.5.1. Digest Authentication Protocol The Digest Authentication Protocol defined in this memo provides for: - verifying the integrity of a received message (i.e., the message received is the message sent). The integrity of the message is protected by computing a digest over an appropriate portion of a message. The digest is computed by the originator of the message, transmitted with the message, and verified by the recipient of the message. - verifying the user on whose behalf the message was generated. A secret value known only to SNMPv2 entities authorized to generate messages on behalf of this user is inserted into the message prior to the digest computation. Thus, the verification of the user is implicit with the verification of the digest. - verifying that a message sent to/from one agent cannot be replayed to/as-if-from another agent. Included in each message is an identifier unique to the SNMPv2 agent which is the sender or intended recipient of the message. - detecting messages which were not recently generated. A set of time indicators are included in the message, indicating the time of generation. Messages without recent time indicators are not considered authentic. This protocol uses the MD5 [3] message digest algorithm. A 128-bit digest is calculated over the designated portion of an SNMPv2 message and included as part of the message sent to the recipient. The size of both the digest carried in a message and the private authentication key is 16 octets. This memo allows the same user to be defined on multiple SNMPv2 agents and managers. Each SNMPv2 agent maintains a value, agentID, which uniquely identifies the agent, and is included in each authenticated message sent to/from that agent. On receipt of a message, an agent checks the value to ensure it is the intended recipient, and a manager uses the value to ensure that the message is processed using the correct state information for that agent. Expires December 1995 [Page 8] Internet Draft User-based Security Model for SNMPv2 June 1995 Each SNMPv2 agent maintains two values, agentBoots and agentTime, which taken together provide an indication of time at that agent. Both of these values are included in an authenticated message sent to/received from that agent. On receipt, the values are checked to ensure that the indicated time is within a time window of the current time. The time window represents an administrative upper bound on acceptable delivery delay for protocol messages. For an SNMPv2 manager to generate a message which an agent will accept as authentic, and to verify that a message received from an agent is authentic, that manager must first achieve time synchronization with that agent. 1.5.2. Symmetric Encryption Protocol The Symmetric Encryption Protocol defined in this memo provides support for data confidentiality through the use of the Data Encryption Standard (DES) in the Cipher Block Chaining mode of operation. The designated portion of an SNMPv2 message is encrypted and included as part of the message sent to the recipient. Two organizations have published specifications defining the DES: the National Institute of Standards and Technology (NIST) [5] and the American National Standards Institute [6]. There is a companion Modes of Operation specification for each definition (see [7] and [8], respectively). The NIST has published three additional documents that implementors may find useful. - There is a document with guidelines for implementing and using the DES, including functional specifications for the DES and its modes of operation [9]. - There is a specification of a validation test suite for the DES [10]. The suite is designed to test all aspects of the DES and is useful for pinpointing specific problems. - There is a specification of a maintenance test for the DES [11]. The test utilizes a minimal amount of data and processing to test all components of the DES. It provides a simple yes-or-no indication of correct operation and is useful to run as part of an initialization step, e.g., when a computer reboots. Expires December 1995 [Page 9] Internet Draft User-based Security Model for SNMPv2 June 1995 This Symmetric Encryption Protocol specifies that the size of the privacy key is 16 octets, of which the first 8 octets are a DES key and the second 8 octets are a DES Initialization Vector. The 64-bit DES key in the first 8 octets of the private key is a 56 bit quantity used directly by the algorithm plus 8 parity bits - arranged so that one parity bit is the least significant bit of each octet. The setting of the parity bits is ignored by this protocol. The length of an octet sequence to be encrypted by the DES must be an integral multiple of 8. When encrypting, the data is padded at the end as necessary; the actual pad value is irrelevant. If the length of the octet sequence to be decrypted is not an integral multiple of 8 octets, the processing of the octet sequence is halted and an appropriate exception noted. When decrypting, the padding is ignored. Expires December 1995 [Page 10] Internet Draft User-based Security Model for SNMPv2 June 1995 2. Elements of the Model This section contains definitions required to realize the security model defined by this memo. 2.1. SNMPv2 Users Management operations using this security model make use of a defined set of user identities. For any SNMPv2 user on whose behalf management operations are authorized at a particular SNMPv2 agent, that agent must have knowledge of that user. A SNMPv2 manager that wishes to communicate with a particular agent must also have knowledge of a user known to that agent, including knowledge of the applicable attributes of that user. A user and its attributes are defined as follows: An octet string representing the name of the user. An indication of whether messages sent on behalf of this user can be authenticated, and if so, the type of authentication protocol which is used. One such protocol is defined in this memo: the Digest Authentication Protocol. If messages sent on behalf of this user can be authenticated, the (private) authentication key for use with the authentication protocol. Note that a user's authentication key may be different at different agents. An indication of whether messages sent on behalf of this user can be protected from disclosure, and if so, the type of privacy protocol which is used. One such protocol is defined in this memo: the Symmetric Encryption Protocol. If messages sent on behalf of this user can be protected from disclosure, the (private) privacy key for use with the privacy protocol. Note that a user's privacy key may be different at different agents. Expires December 1995 [Page 11] Internet Draft User-based Security Model for SNMPv2 June 1995 2.2. Context Selectors An SNMPv2 context is a collection of management information accessible (locally or via proxy) by an SNMPv2 agent. An SNMPv2 agent potentially has access to many contexts. Each SNMPv2 message contains a context selector which uniquely identifies an SNMPv2 context accessible by the SNMPv2 agent to which the message is directed. At the option of the administrator, a context selector may uniquely identify an SNMPv2 context among all SNMPv2 contexts within the administrative domain. 2.3. Quality of Service (qoS) Messages are generated with a particular Quality of Service (qoS), either: - without authentication and privacy, - with authentication but not privacy, - with authentication and privacy. All users are capable of having messages without authentication and privacy generated on their behalf. Users having an authentication protocol and an authentication key can have messages with authentication but not privacy generated on their behalf. Users having an authentication protocol, an authentication key, a privacy protocol and a privacy key can have messages with authentication and privacy generated on their behalf. Orthogonal to its indication of authentication and privacy, the qoS of an SNMPv2 message may also indicate that the message relates to a maintenance function (see Section 2.6 below). 2.4. Access Policy An administration's access policy determines the access rights of users. For a particular SNMPv2 context to which a user has access using a particular qoS, that user's access rights are given by a list of authorized operations, and for a local context, a read-view and a write-view. The read-view is the set of object instances authorized for the user when reading objects. Reading objects occurs when processing a retrieval (get, get-next, get-bulk) operation and when sending a notification. The write-view is the set of object instances authorized Expires December 1995 [Page 12] Internet Draft User-based Security Model for SNMPv2 June 1995 for the user when writing objects. Writing objects occurs when processing a set operation. A user's access rights may be different at different agents. 2.5. Replay Protection Each SNMPv2 agent maintains three objects: - agentID, which is an identifier unique among all agents in (at least) an administrative domain; - agentBoots, which is a count of the number of times the agent has rebooted/re-initialized since agentID was last configured; and, - agentTime, which is the number of seconds since agentBoots was last incremented. An SNMPv2 agent is always authoritative with respect to these variables. It is the responsibility of an SNMPv2 manager to synchronize with the agent, as appropriate. In the case of an SNMPv2 dual-role entity sending an Inform-Request, it is that entity acting in an agent role which is authoritative with respect to these variables for the Inform- Request. An agent is required to maintain the values of agentID and agentBoots in non-volatile storage. 2.5.1. agentID The agentID value contained in an authenticated message is used to defeat attacks in which messages from a manager are replayed to a different agent and/or messages from one agent are replayed as if from a different agent. When an agent is first installed, it sets its local value of agentID according to a enterprise-specific algorithm (see the definition of agentID in Section 4.1). 2.5.2. agentBoots and agentTime The agentBoots and agentTime values contained in an authenticated message are used to defeat attacks in which messages from a manager are Expires December 1995 [Page 13] Internet Draft User-based Security Model for SNMPv2 June 1995 replayed to the same agent at a time when they are no longer valid. Through use of agentBoots and agentTime, there is no requirement for an SNMPv2 agent to have a non-volatile clock which ticks (i.e., increases with the passage of time) even when the agent is powered off. Rather, each time an SNMPv2 agent reboots, it retrieves, increments, and then stores agentBoots in non-volatile storage, and resets agentTime to zero. When an agent is first installed, it sets its local values of agentBoots and agentTime to zero. If agentTime ever reaches its maximum value (2147483647), then agentBoots is incremented as if the agent has rebooted and agentTime is reset to zero and starts incrementing again. Each time an agent reboots, any SNMPv2 managers holding that agent's values of agentBoots and agentTime need to re-synchronize prior to sending correctly authenticated messages to that agent. If an agent is ever unable to determine its latest agentBoots value, then it must set its agentBoots value to 0xffffffff. Whenever the local value of agentBoots has the value 0xffffffff, it latches at that value and an authenticated message always causes an usecStatsNotInWindows authentication failure. In order to reset an agent whose agentBoots value has reached the value 0xffffffff, manual intervention is required. The agent must be physically visited and re-configured, either with a new agentID value, or with new secret values for the authentication and privacy keys of all users known to that agent. 2.5.3. Time Window The Time Window is a value that specifies the window of time in which a message generated on behalf of any user is valid. This memo specifies that the same value of the Time Window, 150 seconds, is used for all users. 2.6. Maintenance Functions In order to facilitate communication between SNMPv2 entities, certain "maintenance" functions are defined. An operation relating to a maintenance function is carried in an SNMPv2 message with the appropriate qoS indicator. For example, error reporting and time synchronization are achieved by performing SNMP operations on behalf of Expires December 1995 [Page 14] Internet Draft User-based Security Model for SNMPv2 June 1995 the user "usec" and accessing the context for which the context selector is the zero-length string. When processing a maintenance function, an SNMPv2 entity utilizes the same mechanisms defined for normal operations. However, normal operations execute with respect to an administration's security policy (which may vary between administrations). In contrast, maintenance functions always execute within a fixed, standardized security policy. This is advantageous in that it allows code re-use within an SNMPv2 entity, while also not allowing an administration's policy to impair the proper operation of essential maintenance functions. However, not all of the rules applicable to normal users and contexts specified in this document necessarily apply to these maintenance functions. The sole purpose of maintenance functions is to ensure that all SNMPv2 entities provide essential maintenance functionality within a well- known, standardized, security environment. Maintenance functions are intended for use only by the internal operations of an SNMPv2 entity. Thus, their scope is intentionally restricted to be the minimum necessary to fulfill their purpose. 2.6.1. The Well-known Maintenance User All implementations must support the well-known user named "usec", which has no authentication nor privacy capabilities. The access policy for this maintenance user allows read-only access to the local context which has the empty string as its selector, and which contains all objects in the snmpStatsGroup [14] and usecBasicGroup object groups. 2.6.2. Error Reporting While processing a received communication, an SNMPv2 entity may determine that the message is unacceptable (see Section 3.2). In this case, the appropriate counter from the snmpStatsGroup [14] or usecBasicGroup object groups is incremented and the received message is discarded without further processing. If an SNMPv2 entity acting in the agent role makes such a determination, then after incrementing the appropriate counter, it is required to generate a report PDU and to send it to the transport address which originated the received message. Expires December 1995 [Page 15] Internet Draft User-based Security Model for SNMPv2 June 1995 Report-PDU ::= [8] IMPLICIT PDU If the agent is able to determine the request-id field of the received PDU, then it uses that value for the request-id field of the report PDU. Otherwise, the value 2147483647 is used. The error-status and error-index fields of the report PDU are always set to zero. The variable-bindings field contains a single variable: the identity of the statistics counter which was incremented and its new value. A report PDU is never sent by an SNMPv2 entity acting in a manager role, nor by any SNMPv2 entity as a result of receiving a message containing a report PDU. 2.6.3. Time Synchronization An SNMPv2 manager achieves time synchronization with an agent by issuing a maintenance function to retrieve agentID.0, agentBoots.0, and, agentTime.0. It is recommended that after these values are retrieved, that the manager attempt an authenticated retrieval using the new values before updating its local configuration datastore. 2.6.4. Proxy Error Propagation When a proxy SNMPv2 agent receives a report PDU from a proxied agent, it invokes the appropriate maintenance procedures. If the result of such maintenance procedures determines that a proxy-forwarded request cannot be delivered to the proxied agent, then the snmpStatsProxyDrops counter [14] is incremented and a report PDU is generated and transmitted to the transport address from which the original request was received. (Note that the receipt of a report PDU containing snmpStatsProxyDrops as a varbind, is included among the reasons why a proxy-forwarded request cannot be delivered.) Expires December 1995 [Page 16] Internet Draft User-based Security Model for SNMPv2 June 1995 2.7. SNMPv2 Messages The syntax of an SNMPv2 message differs from that of an SNMPv1 message as follows: - The version component is changed to 2. - The data component contains either a PDU or an OCTET STRING containing an encrypted PDU. The SNMPv1 community string is now termed the "parameters" component and contains a set of administrative information for the message. Only the PDU is protected from disclosure by the privacy protocol. This exposes the administrative information to eavesdroppers. However, malicious use of this information is considered to be a Traffic Analysis attack against which protection is not provided. For an authenticated SNMPv2 message, the message digest is applied to the entire message given to the transport service. As such, message generation first privatizes the PDU, then adds the message wrapper, and then authenticates the message. An SNMPv2 message is an ASN.1 value with the following syntax: Message ::= SEQUENCE { version INTEGER { v2 (2) }, parameters OCTET STRING, -- -- -- -- data CHOICE { plaintext PDUs, encrypted OCTET STRING } } Expires December 1995 [Page 17] Internet Draft User-based Security Model for SNMPv2 June 1995 where: parameters if the first octet of this component () is zero, then = 8-bits of quality-of-service bitnumber 7654 3210 meaning ---- ---- ----------------------------- .... ..00 no authentication nor privacy .... ..01 authentication, no privacy .... ..1. authentication and privacy 1... .... maintenance function where bit 7 is the most significant bit. = 12 octets a unique identifier for the agent. = 32-bits an unsigned quantity (0..4294967295) in network-byte order. = 32-bits an unsigned quantity (0..2147483647) in network-byte order. = 1 octet the length of following field. = 1..32 arbitrary octets the user on whose behalf this message is sent. = 1 octet the length of following field. = 0..255 octets for authenticated messages, the authentication digest. Otherwise, the value has zero-length on transmission and is ignored on receipt. = 16-bits an unsigned quantity (484..65507) in network-byte order, which identifies the maximum message size which the sender of this message can receive using the same transport domain as used for this message. Expires December 1995 [Page 18] Internet Draft User-based Security Model for SNMPv2 June 1995 = 0..64 octets the context selector by which the agent identifies the SNMPv2 context containing the management information referenced by the SNMPv2 message. plaintext an SNMPv2 PDU as defined in [12]. encrypted the encrypted form of an SNMPv2 PDU. 2.8. Local Configuration Datastore (LCD) Each SNMPv2 entity maintains a local conceptually database, called the Local Configuration Datastore (LCD), which holds its known set of information about SNMPv2 users and other associated (e.g., access control) information. It is a local implementation issue as to whether information in the LCD is stored information or whether it is obtained dynamically (e.g., as a part of an SNMPv2 manager's API) on an as-needed basis. Expires December 1995 [Page 19] Internet Draft User-based Security Model for SNMPv2 June 1995 3. Elements of Procedure This section describes the procedures followed by an SNMPv2 entity in processing SNMPv2 messages. 3.1. Generating a Request or Notification This section describes the procedure followed by an SNMPv2 entity whenever it generates a message containing a management operation (either a request or a notification) on behalf of a user, for a particular context and with a particular qoS value. (1) Information concerning the user is extracted from the LCD. The transport domain and transport address to which the operation is to be sent is determined. (2) If the qoS specifies that the message is to be protected from disclosure, but the user does not support both an authentication and a privacy protocol, or does not have configured authentication and privacy keys, then the operation cannot be sent. (3) If the qoS specifies that the message is to be authenticated, but the user does not support an authentication protocol, or does not have a configured authentication key, then the operation cannot be sent. (4) The operation is serialized (i.e., encoded) according to the conventions of [13] and [12] into a PDUs value. (5) An SNMPv2 message is constructed using the ASN.1 Message syntax: - the version component is set to the value 2. - if the qoS specifies that the message is to be protected from disclosure, then the octet sequence representing the serialized PDUs value is encrypted according to the user's privacy protocol and privacy key, and the encrypted string is used as the value of the data component. - if the qoS specifies that the message is not to be protected from disclosure, then the serialized PDUs value is used directly as the value of the data component. - the parameters component is constructed using: Expires December 1995 [Page 20] Internet Draft User-based Security Model for SNMPv2 June 1995 - the requested qoS, userName, and context selector, - if the qoS specifies that the message is to be authenticated or the management operation is a notification, then the current values of agentID, agentBoots, and agentTime from the LCD are used. Otherwise, the , , and fields are set to zero-filled octets. - the field is set to the maximum message size which the local SNMPv2 entity can receive using the transport domain which will be used to send this message. - if the qoS specifies that the message is to be authenticated, then the field is temporarily set to the user's authentication key. Otherwise, the field is set to the zero-length string. (6) The constructed Message value is serialized (i.e., encoded) according to the conventions of [13] and [12]. (7) If the qoS specifies that the message is to be authenticated, then an MD5 digest value is computed over the octet sequence representing the serialized Message value. The field is then set to the computed digest value. (8) The serialized Message value is transmitted to the determined transport address. Expires December 1995 [Page 21] Internet Draft User-based Security Model for SNMPv2 June 1995 3.2. Processing a Received Communication This section describes the procedure followed by an SNMPv2 entity whenever it receives an SNMPv2 message. This procedure is independent of the transport service address at which the message was received. (1) The snmpStatsPackets counter [14] is incremented. If the received message is not the serialization (according to the conventions of [13]) of a Message value, then the snmpStatsEncodingErrors counter [14] is incremented, and the message is discarded without further processing. (2) If the value of the version component has a value other than 2, then the message is either processed according to some other version of this protocol, or the snmpStatsEncodingErrors counter [14] is incremented, and the message is discarded without further processing. (3) The values of the individual fields are extracted from the parameters component of the Message value. (4) If the value of the field is not 0, then either the message is processed according to some other security model, or the snmpStatsEncodingErrors counter [14] is incremented, and the message is discarded without further processing. (5) Information about the value of the field is extracted from the LCD. If no information is available, then the usecStatsUnknownUserNames counter is incremented, a report PDU is generated, and the received message is discarded without further processing. (6) If the information about the user indicates that it does not support the quality of service indicated by the field, then the usecStatsUnsupportedQoS counter is incremented, a report PDU is generated, and the received message is discarded without further processing. (7) The LCD is consulted for information about the SNMPv2 context identified by the field. If information about this SNMPv2 context is absent from the LCD, then the usecStatsUnknownContextSelectors counter is incremented, a report PDU is generated, and the received message is discarded without further processing. Expires December 1995 [Page 22] Internet Draft User-based Security Model for SNMPv2 June 1995 (8) If the field indicates an authenticated message, the user's authentication protocol is the Digest Authentication Protocol described in this memo, and indicates a context realized by the local SNMPv2 entity (i.e., a context for which it will accept authorized retrieval and/or modification operations), then: - if the field is not equal to the local value of agentID then the usecStatsNotInWindows counter is incremented, a report PDU is generated, and the received message is discarded without further processing. - if the value of the field differs from the local value of agentBoots, or the value of the field differs from the local value of agentTime by more than +/- 150 seconds, then the usecStatsNotInWindows counter is incremented, a report PDU is generated, and the received message is discarded without further processing. However, if the snmpV2EnableAuthenTraps object [14] is enabled, then the SNMPv2 entity sends authorizationFailure traps [14] according to its configuration. - the value of the field is temporarily saved, a new serialized Message is constructed which differs from that received in exactly one respect: that the field within it has the value of the user's authentication key. An MD5 digest value is computed over the octet sequence representing the new serialized Message. - if the computed digest differs from the saved authDigest value, then the usecStatsWrongDigestValues counter is incremented, a report PDU is generated, and the received message is discarded without further processing. However, if the snmpV2EnableAuthenTraps object [14] is enabled, then the SNMPv2 entity sends authorizationFailure traps [14] according to its configuration. (9) If the field indicates an authenticated message, the user's authentication protocol is the Digest Authentication Protocol described in this memo, and the field indicates a context not realized by the local SNMPv2 entity, then: - the local values of agentBoots and agentTime corresponding to the value of the field are extracted from the LCD. Expires December 1995 [Page 23] Internet Draft User-based Security Model for SNMPv2 June 1995 - if the local value of agentBoots is 0xffffffff, or the field differs from the local value of agentBoots, or the differs from the local value of agentTime by more than +/- 150 seconds, then the usecStatsNotInWindows counter is incremented, and the received message is discarded without further processing; however, time synchronization procedures may be invoked. - the value of the field is temporarily saved, a new serialized Message is constructed which differs from that received in exactly one respect: that the field within it has the value of the user's authentication key. An MD5 digest value is computed over the octet sequence representing the new serialized Message. - if the computed digest differs from the saved authDigest value, then the usecStatsWrongDigestValues counter is incremented and the received message is discarded without further processing. - the LCD is updated by setting the local value of agentTime corresponding to the value of field, to the value of the field. (10) If the field indicates use of a privacy protocol, then the octet sequence representing the data component is decrypted according to the user's privacy protocol to obtain a serialized PDUs value. Otherwise the data component is assumed to directly contain the PDUs value. (11) The SNMPv2 operation type is determined from the ASN.1 tag value associated with the PDUs component. (12) If the SNMPv2 message contains a report PDU, then the request-id in the PDU is correlated to an outstanding request, and if the correlation is successful, the appropriate maintenance function (e.g., time synchronization, proxy error propagation, etc.) is invoked. Otherwise, the snmpStatsBadOperations counter [14] is incremented, and the received message is discarded without further Expires December 1995 [Page 24] Internet Draft User-based Security Model for SNMPv2 June 1995 processing. (13) If the SNMPv2 operation type is either a Get, GetNext, GetBulk, or Set operation, then: a) if the LCD information indicates that the SNMPv2 context is of type remote, then the usecStatsUnknownContextSelectors counter is incremented, a report PDU is generated, and the received message is discarded without further processing. b) the LCD is consulted for access rights authorized for communications on behalf of the user concerning management information in the indicated SNMPv2 context for the particular SNMPv2 operation type. c) if the SNMPv2 operation type is not among the authorized access rights, then the received message is discarded without further processing after generation and transmission of a response message. This response message is sent on behalf of the same user. Its context, var-bind-list and request-id components are identical to those of the received request. Its error-index component is zero and its error-status component is authorizationError [12]. d) The information extracted from the LCD concerning the user and the SNMPv2 context, together with the sending transport address of the received message is cached for later use in generating a response message. e) if the LCD information indicates the SNMPv2 context is of type local, then the management operation represented by the PDUs value is performed by the receiving SNMPv2 entity with respect to the relevant MIB view within the SNMPv2 context according to the procedures set forth in [12], where the relevant MIB view is determined according to the user, the contextSelector, the qoS values and the type of operation requested. Expires December 1995 [Page 25] Internet Draft User-based Security Model for SNMPv2 June 1995 f) if the LCD information indicates the SNMPv2 context is of type proxy, then: i. the user and context to be used to forward the request are extracted from the LCD. If either or both of these values are not currently available for use, then snmpStatsProxyDrops [14] is incremented, a report PDU is generated, and the received message is discarded. ii. a new SNMPv2 message is constructed: its PDUs component is copied from that in the received message except that the contained request-id is replaced by a unique value (this value will enable a subsequent response message to be correlated with this request); and the and fields are set to the values extracted from the LCD. iii. the information cached in Step 13d above is augmented with the request-id of the received message as well as the request-id and context of the constructed message. iv. the constructed message is forwarded to the appropriate transport address. (14) If the SNMPv2 operation type is either a SNMPv2-Trap, Inform, or Response operation, then: a) if the LCD information indicates the SNMPv2 context is of type local, then the usecStatsUnknownContextSelectors counter is incremented, a report PDU is generated, and the received message is discarded without further processing. b) if the LCD information indicates the SNMPv2 context is of type remote, then the management operation represented by the PDUs value is performed by the receiving SNMPv2 entity according to the procedures set forth in [12]. Expires December 1995 [Page 26] Internet Draft User-based Security Model for SNMPv2 June 1995 c) if the LCD information indicates the SNMPv2 context is of type proxy and the SNMPv2 operation type is a Response, then: i. the request-id is extracted from the PDUs component of the received message. The SNMPv2 context and extracted request-id are used to correlate this response message to the corresponding values for a previously forwarded request by inspecting the cache of information as augmented in Substep iii of Step 13f above. If no such correlated information is found, then the received message is discarded without further processing. ii. a new SNMPv2 message is constructed: its PDUs component is copied from that in the received message except that the contained request-id is replaced by the value saved in the correlated information from the original request; its and fields are set to the values saved from the original request. iii. the constructed message is forwarded to the transport address saved in the correlated information as the sending transport address of the original request. iv. the correlated information is deleted from the cache of information. d) if the LCD information indicates the SNMPv2 context is of type proxy, and the SNMPv2 operation type is an Inform or SNMPv2- Trap, then: i. a unique request-id is selected for use by all forwarded copies of this request. This value will enable a subsequent response message to be correlated with this request. ii. information is extracted from the LCD concerning all combinations of userName and contextSelector with which the received message is to be forwarded. iii. for each such combination whose access rights permit Inform or SNMPv2-Trap operations (as appropriate) to be forwarded, a new SNMPv2 message is constructed: its PDUs component is copied from that in the received message except that the contained request-id is replaced by the value selected in Step i above; its and Expires December 1995 [Page 27] Internet Draft User-based Security Model for SNMPv2 June 1995 fields are set to the values extracted in Step ii above. iv. if the SNMPv2 operation type of the received message is an Inform, then for each constructed SNMPv2 message, information concerning the , , request-id and sending transport address of the received message, as well as the request-id and contextSelector of the constructed message, is cached for later use in generating a response message. v. each constructed message is forwarded to the appropriate transport address. 3.2.1. Additional Details For the sake of clarity and to prevent the above procedure from being even longer, the following details were omitted from the above procedure. 3.2.1.1. ASN.1 Parsing Errors For ASN.1 parsing errors, the snmpStatsEncodingErrors counter [14] is incremented and a report PDU is generated whenever such an ASN.1 parsing error is discovered. 3.2.1.2. Incorrectly Encoded Parameters For an incorrectly encoded parameters component of the Message value (e.g., incorrect or inconsistent value of the or fields), the snmpStatsEncodingErrors counter [14] is incremented and a report PDU is generated whenever such an encoding error is discovered. 3.2.1.3. Generation of a Report PDU Some steps specify that the received message is discarded without further processing whenever a report PDU is generated. However, first, an SNMPv2 manager never generates a report PDU; second, a report PDU must not be generated unless and until the SNMPv2 operation type can be determined, so as to ensure that a report PDU is not generated due to Expires December 1995 [Page 28] Internet Draft User-based Security Model for SNMPv2 June 1995 the receipt of a report PDU. In addition, a generated report PDU must whenever possible contain the same request-id value as in the PDU contained in the received message. Meeting these constraints normally requires the message to be further processed just enough so as to extract its SNMPv2 operation type and request-id. Even in the case where the userName is unknown, an attempt must be made to extract the SNMPv2 operation type and request-id by assuming the message is not encrypted. With this assumption, the only situation in which the SNMPv2 operation type and request-id cannot be extracted is when an ASN.1 parsing error occurs. 3.3. Generating a Response The procedure for generating a response to an SNMPv2 management request is identical to the procedure for transmitting a request (see Section 3.1), with these exceptions: - The response is sent on behalf of the same user and with the same value of the contextSelector as the request. - The PDUs value of the responding Message value is the response which results from performing the operation specified in the original PDUs value. - The authentication protocol and other relevant information for the user is obtained, not from the LCD, but rather from information cached (in Step 13d) when processing the original message. - The serialized Message value is transmitted using the transport address and transport domain from which its corresponding request originated - even if that is different from any transport information obtained from the LCD. - If the qoS specifies that the message is to be authenticated, then the current values of agentID, agentBoots, and agentTime from the LCD are used. Expires December 1995 [Page 29] Internet Draft User-based Security Model for SNMPv2 June 1995 4. Definitions SNMPv2-USEC-MIB DEFINITIONS ::= BEGIN IMPORTS MODULE-IDENTITY, OBJECT-TYPE, Counter32, Unsigned32, snmpModules FROM SNMPv2-SMI MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF; usecMIB MODULE-IDENTITY LAST-UPDATED "9506300000Z" ORGANIZATION "IETF SNMPv2 Working Group" CONTACT-INFO " Keith McCloghrie Postal: Cisco Systems, Inc. 170 West Tasman Drive San Jose, CA 95134-1706 US Tel: +1 408 526 5260 E-mail: kzm@cisco.com" DESCRIPTION "The MIB module for SNMPv2 entities implementing the user- based security model." ::= { snmpModules 6 } usecMIBObjects OBJECT IDENTIFIER ::= { usecMIB 1 } Expires December 1995 [Page 30] Internet Draft User-based Security Model for SNMPv2 June 1995 -- the USEC Basic group -- -- a collection of objects providing basic instrumentation of -- the SNMPv2 entity implementing the user-based security model usecAgent OBJECT IDENTIFIER ::= { usecMIBObjects 1 } agentID OBJECT-TYPE SYNTAX OCTET STRING (SIZE (12)) MAX-ACCESS read-only STATUS current DESCRIPTION "The agent's administratively-unique identifier. The initial value for this object may be configured via an operator console entry or via an algorithmic function. In the later case, the following guidelines are recommended: 1) The first four octets are set to the binary equivalent of the agent's SNMP network management private enterprise number as assigned by the Internet Assigned Numbers Authority (IANA). For example, if Acme Networks has been assigned { enterprises 696 }, the first four octets would be assigned '000002b8'H. 2) The remaining eight octets are the cookie whose contents are determined via one or more enterprise- specific methods. Such methods must be designed so as to maximize the possibility that the value of this object will be unique in the agent's administrative domain. For example, the cookie may be the IP address of the agent, or the MAC address of one of the interfaces, with each address suitably padded with random octets. If multiple methods are defined, then it is recommended that the cookie be further divided into one octet that indicates the method being used and seven octets which are a function of the method." ::= { usecAgent 1 } Expires December 1995 [Page 31] Internet Draft User-based Security Model for SNMPv2 June 1995 agentBoots OBJECT-TYPE SYNTAX Unsigned32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of times that the agent has re-initialized itself since its initial configuration." ::= { usecAgent 2 } agentTime OBJECT-TYPE SYNTAX Unsigned32 (0..2147483647) UNITS "seconds" MAX-ACCESS read-only STATUS current DESCRIPTION "The number of seconds since the agent last incremented the agentBoots object." ::= { usecAgent 3 } agentSize OBJECT-TYPE SYNTAX INTEGER (484..65507) MAX-ACCESS read-only STATUS current DESCRIPTION "The maximum length in octets of an SNMPv2 message which this agent will accept using any transport mapping." ::= { usecAgent 4 } Expires December 1995 [Page 32] Internet Draft User-based Security Model for SNMPv2 June 1995 -- USEC statistics -- -- a collection of objects providing basic instrumentation of -- the SNMPv2 entity implementing the user-based security model usecStats OBJECT IDENTIFIER ::= { usecMIBObjects 2 } usecStatsUnsupportedQoS OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of packets received by the SNMPv2 entity which were dropped because they requested a quality-of- service that was unknown to the agent or otherwise unavailable." ::= { usecStats 1 } usecStatsNotInWindows OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of packets received by the SNMPv2 entity which were dropped because they appeared outside of the agent's window." ::= { usecStats 2 } usecStatsUnknownUserNames OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of packets received by the SNMPv2 entity which were dropped because they referenced a user that was not known to the agent." ::= { usecStats 3 } Expires December 1995 [Page 33] Internet Draft User-based Security Model for SNMPv2 June 1995 usecStatsWrongDigestValues OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of packets received by the SNMPv2 entity which were dropped because they didn't contain the expected digest value." ::= { usecStats 4 } usecStatsUnknownContextSelectors OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of packets received by the SNMPv2 entity which were dropped because they referenced a context that was not known to the agent." ::= { usecStats 5 } Expires December 1995 [Page 34] Internet Draft User-based Security Model for SNMPv2 June 1995 -- conformance information usecMIBConformance OBJECT IDENTIFIER ::= { usecMIB 2 } usecMIBCompliances OBJECT IDENTIFIER ::= { usecMIBConformance 1 } usecMIBGroups OBJECT IDENTIFIER ::= { usecMIBConformance 2 } -- compliance statements usecMIBCompliance MODULE-COMPLIANCE STATUS current DESCRIPTION "The compliance statement for SNMPv2 entities which implement the SNMPv2 USEC MIB." MODULE -- this module MANDATORY-GROUPS { usecBasicGroup } ::= { usecMIBCompliances 1 } -- units of conformance usecBasicGroup OBJECT-GROUP OBJECTS { agentID, agentBoots, agentTime, agentSize, usecStatsUnsupportedQoS, usecStatsNotInWindows, usecStatsUnknownUserNames, usecStatsWrongDigestValues, usecStatsUnknownContextSelectors } STATUS current DESCRIPTION "A collection of objects providing basic instrumentation of an SNMPv2 entity which implements the SNMPv2 USEC MIB." ::= { usecMIBGroups 1 } END Expires December 1995 [Page 35] Internet Draft User-based Security Model for SNMPv2 June 1995 5. Security Considerations 5.1. Recommended Practices This section describes practices that contribute to the secure, effective operation of the mechanisms defined in this memo. - A management station must discard SNMPv2 responses for which neither the request-id component nor the represented management information corresponds to any currently outstanding request. Although it would be typical for a management station to do this as a matter of course, when using these security protocols it is significant due to the possibility of message duplication (malicious or otherwise). - When sending state altering messages to a managed agent, a management station should delay sending successive messages to the managed agent until a positive acknowledgement is received for the previous message or until the previous message expires. No message ordering is imposed by the SNMPv2. Messages may be received in any order relative to their time of generation and each will be processed in the ordered received. Note that when an authenticated message is sent to a managed agent, it will be valid for a period of time of approximately 150 seconds under normal circumstances, and is subject to replay during this period. Indeed, a management station must cope with the loss and re- ordering of messages resulting from anomalies in the network as a matter of course. However, a managed object, snmpSetSerialNo [14], is specifically defined for use with SNMPv2 set operations in order to provide a mechanism to ensure the processing of SNMPv2 messages occurs in a specific order. - The frequency with which the secrets of an SNMPv2 user should be changed is indirectly related to the frequency of their use. Protecting the secrets from disclosure is critical to the overall security of the protocols. Frequent use of a secret provides a continued source of data that may be useful to a cryptanalyst in exploiting known or perceived weaknesses in an algorithm. Frequent changes to the secret avoid this vulnerability. Expires December 1995 [Page 36] Internet Draft User-based Security Model for SNMPv2 June 1995 Changing a secret after each use is generally regarded as the most secure practice, but a significant amount of overhead may be associated with that approach. Note, too, in a local environment the threat of disclosure may be less significant, and as such the changing of secrets may be less frequent. However, when public data networks are the communication paths, more caution is prudent. 5.2. Defining Users The mechanisms defined in this document employ the notion of "users" having access rights. How "users" are defined is subject to the security policy of the network administration. For example, users could be individuals (e.g., "joe" or "jane"), or a particular role (e.g., "operator" or "administrator"), or a combination (e.g., "joe-operator", "jane-operator" or "joe-admin"). Furthermore, a "user" may be a logical entity, such as a manager station application or set of manager station applications, acting on behalf of a individual or role, or set of individuals, or set of roles, including combinations. Appendix A describes an algorithm for mapping a user "password" to a 16 octet value for use as either a user's authentication key or privacy key (or both). Passwords are often generated, remembered, and input by a human. Human-generated passwords may be less than the 16 octets required by the authentication and privacy protocols, and brute force attacks can be quite easy on a relatively short ASCII character set. Therefore, the algorithm is Appendix A performs a transformation on the password. If the Appendix A algorithm is used, agent implementations (and agent configuration applications) must ensure that passwords are at least 8 characters in length. Because the Appendix A algorithm uses such passwords (nearly) directly, it is very important that they not be easily guessed. It is suggested that they be composed of mixed-case alphanumeric and punctuation characters that don't form words or phrases that might be found in a dictionary. Longer passwords improve the security of the system. Users may wish to input multiword phrases to make their password string longer while ensuring that it is memorable. Note that there is security risk in configuring the same "user" on multiple systems where the same password is used on each system, since the compromise of that user's secrets on one system results in the compromise of that user on all other systems having the same password. Expires December 1995 [Page 37] Internet Draft User-based Security Model for SNMPv2 June 1995 There is also greater security risk and less accountability in allowing multiple humans to know the password for a given "user". 5.3. Conformance To claim conformance to this memo, an SNMPv2 implementation: - must recognize and perform maintenance functions on behalf of the well-known maintenance user "usec". - must implement the Digest Authentication Protocol. Otherwise, it is termed an "insecure SNMPv2 implementation" -- one which adheres to the SNMPv2 Administrative Framework but does not support secure operations. - must, to the maximal extent possible, prohibit access to the secret(s) of each user about which it maintains information in a LCD, under all circumstances except as required to generate and/or validate SNMPv2 messages with respect to that user. - must implement the SNMPv2 USEC MIB. Implementation of the Symmetric Encryption Protocol is optional. Expires December 1995 [Page 38] Internet Draft User-based Security Model for SNMPv2 June 1995 6. Acknowledgements The authors wish to acknowledge the contributions of the SNMPv2 Working Group in general. In particular, the authors extend a special thanks for the contributions of: Dave Arneson (Cabletron) Uri Blumenthal (IBM) Doug Book (Chipcom) Kim Curran (Bell-Northern Research) Maria Greene (Ascom Timeplex) Deirdre Kostick (Bellcore) Dave Harrington (Cabletron) Jeff Johnson (Cisco Systems) David Levi (SNMP Research) Brian O'Keefe (Hewlett Packard) Andrew Pearson (SNMP Research) Dave Perkins (Bay Networks) Randy Presuhn (Peer Networks) Shawn Routhier (Epilogue) Bob Stewart (Cisco Systems) Kaj Tesink (Bellcore) Bert Wijnen (IBM) 7. References [1] Case, J., Galvin, J., McCloghrie, K., Rose, M., and Waldbusser, S., "Administrative Infrastructure for Version 2 of the Simple Network Management Protocol (SNMPv2)", Internet Draft, SNMP Research, Inc., Trusted Information Systems, Cisco Systems, Dover Beach Consulting, Inc., Carnegie Mellon University, May 1995. [2] Case, J., Fedor, M., Schoffstall, M., Davin, J., "Simple Network Management Protocol", STD 15, RFC 1157, SNMP Research, Performance Systems International, MIT Laboratory for Computer Science, May 1990. [3] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, MIT Laboratory for Computer Science, April 1992. [4] Case, J., McCloghrie, K., Rose, M., and Waldbusser, S., "Coexistence between Version 1 and Version 2 of the Internet- standard" Network Management Framework", Internet Draft, SNMP Research, Inc., Cisco Systems, Dover Beach Consulting, Inc., Expires December 1995 [Page 39] Internet Draft User-based Security Model for SNMPv2 June 1995 Carnegie Mellon University, May 1995. [5] Data Encryption Standard, National Institute of Standards and Technology. Federal Information Processing Standard (FIPS) Publication 46-1. Supersedes FIPS Publication 46, (January, 1977; reaffirmed January, 1988). [6] Data Encryption Algorithm, American National Standards Institute. ANSI X3.92-1981, (December, 1980). [7] DES Modes of Operation, National Institute of Standards and Technology. Federal Information Processing Standard (FIPS) Publication 81, (December, 1980). [8] Data Encryption Algorithm - Modes of Operation, American National Standards Institute. ANSI X3.106-1983, (May 1983). [9] Guidelines for Implementing and Using the NBS Data Encryption Standard, National Institute of Standards and Technology. Federal Information Processing Standard (FIPS) Publication 74, (April, 1981). [10] Validating the Correctness of Hardware Implementations of the NBS Data Encryption Standard, National Institute of Standards and Technology. Special Publication 500-20. [11] Maintenance Testing for the Data Encryption Standard, National Institute of Standards and Technology. Special Publication 500-61, (August, 1980). [12] Case, J., McCloghrie, K., Rose, M., and Waldbusser, S., "Protocol Operations for Version 2 of the Simple Network Management Protocol (SNMPv2)", Internet Draft, SNMP Research, Inc., Cisco Systems, Dover Beach Consulting, Inc., Carnegie Mellon University, May 1995. [13] Case, J., McCloghrie, K., Rose, M., and Waldbusser, S., "Transport Mappings for Version 2 of the Simple Network Management Protocol (SNMPv2)", Internet Draft, SNMP Research, Inc., Cisco Systems, Dover Beach Consulting, Inc., Carnegie Mellon University, May 1995. [14] Case, J., McCloghrie, K., Rose, M., and Waldbusser, S., "Management Information Base for Version 2 of the Simple Network Management Protocol (SNMPv2)", Internet Draft, SNMP Research, Inc., Cisco Systems, Dover Beach Consulting, Inc., Carnegie Mellon University, May 1995. Expires December 1995 [Page 40] Internet Draft User-based Security Model for SNMPv2 June 1995 APPENDIX A - Installation A.1. Agent Installation Parameters During installation, an agent is configured with several parameters. These include: (1) a security posture The choice of security posture determines the extent of the view configured for unauthenticated access. One of three possible choices is selected: minimum-secure, semi-secure, or very-secure. (2) one or more transport service addresses These parameters may be specified explicitly, or they may be specified implicitly as the same set of network-layer addresses configured for other uses by the device together with the well- known transport-layer "port" information for the appropriate transport domain [13]. The agent listens on each of these transport service addresses for messages sent on behalf of any user it knows about. (3) one or more secrets These are the authentication/privacy secrets for the first user to be configured. One way to accomplish this is to have the installer enter a "password" for each required secret. The password is then algorithmically converted into the required secret by: forming a string of length 1,048,576 octets by repeating the value of the password as often as necessary, truncating accordingly, and using the resulting string as the input to the MD5 algorithm. The resulting digest is the required secret (see Appendix A.2). With these configured parameters, the agent instantiates the following user, context, views and access rights. This configuration information should be persistent. Expires December 1995 [Page 41] Internet Draft User-based Security Model for SNMPv2 June 1995 - One user: privacy not supported privacy supported --------------------- ----------------- "public" "public" Digest Auth. Protocol Digest Auth. Protocol authentication key authentication key none Symmetric Privacy Protocol -- privacy key - One local context with its as the empty-string. - One view for authenticated access: - the MIB view is the "internet" subtree. - A second view for unauthenticated access. This view is configured according to the selected security posture. For the "very-secure" posture: - the MIB view is the union of the "snmpStats" and "usecStats" subtrees. For the "semi-secure" posture: - the MIB view is the union of the "snmpStats", "usecStats" and "system" subtrees. For the "minimum-secure" posture: - the MIB view is the "internet" subtree. - Access rights to allow: - read-only access for unauthenticated messages on behalf of the user "public" to the MIB view of contextSelector "". - read-write access for authenticated but not private messages on behalf of the user "public" to the MIB view of contextSelector "". - if privacy is supported, read-write access for authenticated and private messages on behalf of the user "public" to the MIB view of contextSelector "". Expires December 1995 [Page 42] Internet Draft User-based Security Model for SNMPv2 June 1995 A.2. Password to Key Algorithm The following code fragment demonstrates the password to key algorithm which can be used when mapping a password to an authentication or privacy key. (The calls to MD5 are as documented in RFC 1321.) void password_to_key(password, passwordlen, key) u_char *password; /* IN */ u_int passwordlen; /* IN */ u_char *key; /* OUT - caller supplies pointer to 16 octet buffer */ { MD5_CTX MD; u_char *cp, password_buf[64]; u_long password_index = 0; u_long count = 0, i; MD5Init (&MD); /* initialize MD5 */ /* loop until we've done 1 Megabyte */ while (count < 1048576) { cp = password_buf; for(i = 0; i < 64; i++) { *cp++ = password[ password_index++ % passwordlen ]; /* * Take the next byte of the password, wrapping to the * beginning of the password as necessary. */ } MDupdate (&MD, password_buf, 64); count += 64; } MD5Final (key, &MD); /* tell MD5 we're done */ return; } Expires December 1995 [Page 43] Internet Draft User-based Security Model for SNMPv2 June 1995 APPENDIX B - Compatibility with SNMPv1 Community Profiles For an insecure SNMPv2 implementation (see Section 5.3) of an agent, for which the configuration of access rights is specified via SNMPv1 community profiles, it is mandatory that it treat SNMPv2 messages having a zero-valued qoS field and a zero-length contextSelector field as referring to an SNMPv1 community profile; in particular, to the SNMPv1 community profile identified by treating the value of the field as if it were an SNMPv1 community string, For example, the 5-octet community string hexadecimal value of x"0001020304" would be encoded as a parmeters component value of: field hex value ----- --------- 00 00 00000000 00000000 00000000 00000000 00000000 05 0001020304 00 -- 01e4 (= 484 decimal) -- or: x"0000 00000000 00000000 00000000 00000000 00000000 05 0001020304 0001e4" Expires December 1995 [Page 44] Internet Draft User-based Security Model for SNMPv2 June 1995 Authors' Addresses Keith McCloghrie Cisco Systems, Inc. 170 West Tasman Drive San Jose, CA 95134-1706 US Phone: +1 408 526 5260 Email: kzm@cisco.com Marshall T. Rose Dover Beach Consulting, Inc. 420 Whisman Court Mountain View, CA 94043-2186 US Phone: +1 415 968 1052 Email: mrose@dbc.mtview.ca.us Glenn W. Waters Bell-Northern Research Ltd. P.O. Box 3511, Station C Ottawa, Ontario K1Y 4H7 CA Phone: +1 613 763 3933 Email: gwaters@bnr.ca James M. Galvin Trusted Information Systems, Inc. 3060 Washington Road, Route 97 Glenwood, MD 21738 US Phone: +1 301 854 6889 EMail: galvin@tis.com Expires December 1995 [Page 45] Internet Draft User-based Security Model for SNMPv2 June 1995 Table of Contents 1 Introduction .................................................... 3 1.1 A Note on Terminology ......................................... 3 1.2 Threats ....................................................... 4 1.3 Goals and Constraints ......................................... 5 1.4 Security Services ............................................. 6 1.5 Mechanisms .................................................... 7 1.5.1 Digest Authentication Protocol .............................. 8 1.5.2 Symmetric Encryption Protocol ............................... 9 2 Elements of the Model ........................................... 11 2.1 SNMPv2 Users .................................................. 11 2.2 Context Selectors ............................................. 12 2.3 Quality of Service (qoS) ...................................... 12 2.4 Access Policy ................................................. 12 2.5 Replay Protection ............................................. 13 2.5.1 agentID ..................................................... 13 2.5.2 agentBoots and agentTime .................................... 13 2.5.3 Time Window ................................................. 14 2.6 Maintenance Functions ......................................... 14 2.6.1 The Well-known Maintenance User ............................. 15 2.6.2 Error Reporting ............................................. 15 2.6.3 Time Synchronization ........................................ 16 2.6.4 Proxy Error Propagation ..................................... 16 2.7 SNMPv2 Messages ............................................... 17 2.8 Local Configuration Datastore (LCD) ........................... 19 3 Elements of Procedure ........................................... 20 3.1 Generating a Request or Notification .......................... 20 3.2 Processing a Received Communication ........................... 22 3.2.1 Additional Details .......................................... 28 3.2.1.1 ASN.1 Parsing Errors ...................................... 28 3.2.1.2 Incorrectly Encoded Parameters ............................ 28 3.2.1.3 Generation of a Report PDU ................................ 28 3.3 Generating a Response ......................................... 29 4 Definitions ..................................................... 30 4.1 The USEC Basic Group .......................................... 31 4.2 Conformance Information ....................................... 35 4.2.1 Compliance Statements ....................................... 35 4.2.2 Units of Conformance ........................................ 35 5 Security Considerations ......................................... 36 5.1 Recommended Practices ......................................... 36 5.2 Defining Users ................................................ 37 5.3 Conformance ................................................... 38 6 Acknowledgements ................................................ 39 Expires December 1995 [Page 46] Internet Draft User-based Security Model for SNMPv2 June 1995 7 References ...................................................... 39 Appendix A Installation ........................................... 41 Appendix A.1 Agent Installation Parameters ........................ 41 Appendix A.2 Password to Key Algorithm ............................ 43 Appendix B Compatibility with SNMPv1 Community Profiles ........... 44 Authors' Addresses ................................................ 45 Expires December 1995 [Page 47]