RFC 5343

Simple Network Management Protocol (SNMP) Context EngineID Discovery

πŸ“… published September 2008, from ietf

RFC 5343: Simple Network Management Protocol (SNMP) Context EngineID Discovery πŸŽ€

Part 1 of 2 πŸ’…

  • Written by: J. Schoenwaelder, Jacobs University Bremen πŸŽ“
  • RFC number: 5343
  • Category: Standards Track πŸ”₯
  • Date: September 2008 πŸ“…
  • Updates: RFC 3411 (this one tweaks an older spec, obsessed 🫢)
  • Obsoletes: nothing is listed in the header

Status of This Memo ✨

okay so this doc is an Internet standards track protocol, meaning the community is invited to talk about it and suggest improvements πŸ’– If you want the current official status of this protocol, check the "Internet Official Protocol Standards" (STD 1) document. And distribution of this memo is unlimited, so share it with everyone 🌈

Abstract πŸ¦‹

so SNMPv3 needs an app to already know the identifier (snmpEngineID) of the remote SNMP protocol engine before it can grab or change objects on that remote SNMP entity. no cap, that's a lot of prep 😭

this doc introduces a well-known localEngineID plus a discovery mechanism that lets you learn the snmpEngineID of a remote SNMP protocol engine 🧚 It's not tied to any SNMP security model's features, and other protocol interfaces that access managed objects may use it too.

this document updates RFC 3411. πŸ’œ

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . . . 2
   2.  Background  . . . . . . . . . . . . . . . . . . . . . . . . . . 2
   3.  Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
     3.1.  Local EngineID  . . . . . . . . . . . . . . . . . . . . . . 4
     3.2.  EngineID Discovery  . . . . . . . . . . . . . . . . . . . . 4
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 5
   5.  Security Considerations . . . . . . . . . . . . . . . . . . . . 6
   6.  Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . 7
   7.  References  . . . . . . . . . . . . . . . . . . . . . . . . . . 7
     7.1.  Normative References  . . . . . . . . . . . . . . . . . . . 7
     7.2.  Informative References  . . . . . . . . . . . . . . . . . . 7

1. Introduction 🌸

okay so to retrieve or manipulate management information using SNMPv3 [RFC3410], you need the identifier of the remote SNMP protocol engine, the so-called snmpEngineID [RFC3411] 🧠 You can configure an appropriate snmpEngineID on every management application for every SNMP agent, but honestly it's way more iconic to discover it automatically 🀩

this document introduces a discovery mechanism that lets you learn the snmpEngineID of a remote SNMP protocol engine ✨ It doesn't depend on features from SNMP security models, and it was designed to coexist with discovery mechanisms that security models already have, like the authoritative engine identifier discovery of the User-based Security Model (USM) of SNMP [RFC3414] 🫢 Teamwork makes the dream work!

This document updates RFC 3411 [RFC3411] by clarifying the IANA rules for the maintenance of the SnmpEngineID format registry. πŸ“š

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. πŸ’…

2. Background πŸ¦‹

within an administrative domain, an SNMP engine is uniquely identified by an snmpEngineID value [RFC3411] πŸ”‘ An SNMP entity is made up of an SNMP engine and several SNMP applications, and it may give access to multiple contexts πŸŽ€

an SNMP context is a collection of management information that an SNMP entity can access 🌈 One item of management information may live in more than one context, and an SNMP entity can potentially access lots of contexts [RFC3411] πŸ“ A context is identified by the snmpEngineID value of the entity hosting the management information (also called a contextEngineID) plus a context name that identifies the specific context (also called a contextName) 🧚

to identify one individual item of management information within an administrative domain, you use a four tuple made of:

  1. a contextEngineID,
  2. a contextName,
  3. an object type, and
  4. its instance identification.

the last two elements are encoded in an object identifier (OID) value ✨ The contextName is a character string (following the SnmpAdminString textual convention of the SNMP-FRAMEWORK-MIB [RFC3411]), while the contextEngineID is an octet string built according to the rules defined as part of the SnmpEngineID textual convention of the SNMP-FRAMEWORK-MIB [RFC3411] πŸ’–

the SNMP protocol operations and the protocol data units (PDUs) work on OIDs, so they deal with object types and instances [RFC3416] πŸ’œ The SNMP architecture [RFC3411] introduces the concept of a scopedPDU, a data structure containing a contextEngineID, a contextName, and a PDU πŸ‘‘ The SNMP version 3 (SNMPv3) message format uses ScopedPDUs to exchange management information [RFC3412] 🫢

within the SNMP framework, contextEngineIDs act as end-to-end identifiers 🌟 This matters when SNMP proxies are deployed to translate between protocol versions, or to cross middleboxes such as network address translators πŸ™ˆ snmpEngineIDs also separate the identity of an SNMP engine from the transport addresses used to talk to it πŸ¦‹ That's lowkey genius, because you can correlate management information easily, even when multiple different transports were used to retrieve it or when transport addresses change dynamically πŸ”₯

to retrieve data from an SNMPv3 agent, you need the right contextEngineID πŸŽ€ The User-based Security Model (USM) of SNMPv3 has a mechanism to discover the snmpEngineID of the remote SNMP engine, since security processing needs it πŸ” The discovered snmpEngineID can then be used as a contextEngineID in a ScopedPDU to access management information local to the remote SNMP engine 🧁 Other security models, like the Transport Security Model (TSM) [TSM], don't have such a procedure and may use the discovery mechanism defined in this memo πŸ’…

3. Procedure 🧚

the proposed discovery mechanism has two parts, namely (i) a special well-known snmpEngineID value called the localEngineID, which always refers to a local default context, and (ii) a procedure to acquire the snmpEngineID scalar of the SNMP-FRAMEWORK-MIB [RFC3411] using that special well-known localEngineID value 🌈

3.1. Local EngineID πŸ’–

an SNMP command responder implementing this specification MUST register their pduTypes using the localEngineID snmpEngineID value (defined below) by invoking the registerContextEngineID() Abstract Service Interface (ASI) defined in RFC 3412 [RFC3412] πŸŽ€ This registration happens in addition to the normal registration under the SNMP engine's snmpEngineID 🫢 That's consistent with SNMPv3, since those specs explicitly allow registering multiple engineIDs and multiple pduTypes [RFC3412] ✨

the SnmpEngineID textual convention [RFC3411] says an snmpEngineID value MUST be between 5 and 32 octets long πŸ“ This spec proposes using the variable length format 3) of the SnmpEngineID textual convention, and allocating the reserved, unused format value 6, using enterprise ID 0 for the localEngineID πŸ“ An ASN.1 definition for localEngineID would look like this:

            localEngineID OCTET STRING ::= '8000000006'H

the localEngineID value always gives access to the default context of an SNMP engine πŸ¦‹ Note that localEngineID is meant to be used as a special value for the contextEngineID field in the ScopedPDU πŸ™ˆ It MUST NOT be used as a value to identify an SNMP engine, so that value MUST NOT be used in the snmpEngineID.0 scalar [RFC3418] or in the msgAuthoritativeEngineID field in the securityParameters of the User-based Security Model (USM) [RFC3414] 🚫 no mixing those up, bestie πŸ’€

3.2. EngineID Discovery πŸ”

discovery of the snmpEngineID is done by sending a Read Class protocol operation (see Section 2.8 of [RFC3411]) to retrieve the snmpEngineID scalar, using the localEngineID defined above as a contextEngineID value 🧠 Implementations SHOULD only perform this discovery step when it's actually needed ⏰ If security models are used that already discover the remote snmpEngineID (such as USM), then no further discovery is necessary πŸ™Œ The same goes when the application already knows a suitable snmpEngineID value 🌸

the procedure to discover the snmpEngineID of a remote SNMP engine goes like this:

  1. Check whether a suitable contextEngineID value is already known. If yes, use the provided contextEngineID value and stop the discovery procedure.
  2. Check whether the selected security model supports discovery of the remote snmpEngineID (e.g., USM with its discovery mechanism). If yes, let the security model perform the discovery. If the remote snmpEngineID value has been successfully determined, assign it to the contextEngineID and stop the discovery procedure.
  3. Send a Read Class operation to the remote SNMP engine using the localEngineID value as the contextEngineID in order to retrieve the scalar snmpEngineID.0 of the SNMP-FRAMEWORK-MIB [RFC3411]. If successful, set the contextEngineID to the retrieved value and stop the discovery procedure.
  4. Return an error indication that a suitable contextEngineID could not be discovered.

the procedure above is just an example, and you can tweak it to retrieve more variables in step 3, like the sysObjectID.0 scalar or the snmpSetSerialNo.0 scalar of the SNMPv2-MIB [RFC3418] πŸŽ€


part 2 drops next, stay tuned πŸ‘€πŸ«Ά

5. Security Considerations πŸ”βœ¨

Okay bestie, security is where we get serious πŸ’…. SNMP version 3 (SNMPv3) comes with cryptographic security to protect devices from unauthorized access πŸ”’. This spec says you should lean on those SNMPv3 security services, and in particular, it is RECOMMENDED to protect the discovery exchange πŸ›‘οΈ.

An snmpEngineID can contain a device's MAC address, IPv4 address, IPv6 address, or text that someone assigned on purpose πŸ‘€. An attacker sitting behind a router, firewall, or network address translator might not be able to grab that info directly, so they could go digging for snmpEngineID values to get the device details instead 😬.

In a lot of environments, letting snmpEngineID values be read at the noAuthNoPriv security level is actually helpful πŸ™Œ. Legit tools use it to figure out basic facts about a device with an algorithm. That's why the default View-based Access Control Model (VACM) setup in Appendix A of RFC 3415 [RFC3415] gives noAuthNoPriv read access to the snmpEngineID πŸŽ€. The USM discovery mechanism from RFC 3414 [RFC3414] also sends unprotected messages and reveals snmpEngineID values, so keep that in mind πŸ‘€.

In highly secure environments, you can protect snmpEngineID values by using the discovery mechanism described here together with a security model that never sends cleartext SNMP messages πŸ”. The Transport Security Model (TSM) [TSM] is one example πŸ¦‹.

Here's the tea β˜•: the isAccessAllowed() abstract service primitive in the SNMP access control subsystem doesn't look at the contextEngineID when it checks access rights [RFC3411] 😭. So it's not possible to define a special view for contextEngineID discovery. A request using a localEngineID gets treated just like a request with the correct snmpEngineID by the access control subsystem πŸ’€. This matches the SNMPv3 design, where the authenticated identity is the securityName (along with the securityModel and securityLevel), and neither transport addresses nor knowing contextEngineID values change the access-control decision πŸ’œ.


6. Acknowledgments 🫢

Dave Perkins suggested adding a "local" contextEngineID during the ISMS (Integrated Security Model for SNMP) working group interim meeting in Boston, 2006 🌸. Joe Fernandez, David Harrington, Dan Romascanu, and Bert Wijnen gave super helpful review and feedback, which made this document better ✨.


7. References πŸ“š

7.1. Normative References

[RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
           Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC3411]  Harrington, D., Presuhn, R., and B. Wijnen, "An
           Architecture for Describing Simple Network Management
           Protocol (SNMP) Management Frameworks", STD 62, RFC 3411,
           December 2002.

[RFC3412]  Case, J., Harrington, D., Presuhn, R., and B. Wijnen,
           "Message Processing and Dispatching for the Simple Network
           Management Protocol (SNMP)", STD 62, RFC 3412,
           December 2002.

[RFC3414]  Blumenthal, U. and B. Wijnen, "User-based Security Model
           (USM) for version 3 of the Simple Network Management
           Protocol (SNMPv3)", STD 62, RFC 3414, December 2002.

[RFC3416]  Presuhn, R., "Version 2 of the Protocol Operations for the
           Simple Network Management Protocol (SNMP)", STD 62,
           RFC 3416, December 2002.

[RFC3418]  Presuhn, R., "Management Information Base (MIB) for the
           Simple Network Management Protocol (SNMP)", STD 62,
           RFC 3418, December 2002.

[RFC5226]  Narten, T. and H. Alvestrand, "Guidelines for Writing an
           IANA Considerations Section in RFCs", BCP 26, RFC 5226,
           May 2008.

7.2. Informative References

[RFC3410]  Case, J., Mundy, R., Partain, D., and B. Stewart,
           "Introduction and Applicability Statements for Internet-
           Standard Management Framework", RFC 3410, December 2002.

[RFC3415]  Wijnen, B., Presuhn, R., and K. McCloghrie, "View-based
           Access Control Model (VACM) for the Simple Network
           Management Protocol (SNMP)", STD 62, RFC 3415,
           December 2002.

[TSM]      Harrington, D., "Transport Security Model for SNMP", Work
           in Progress, July 2008.

Author's Address πŸ–‹οΈ

Juergen Schoenwaelder
Jacobs University Bremen
Campus Ring 1
28725 Bremen
Germany

Phone: +49 421 200-3587
EMail: j.schoenwaelder@jacobs-university.de

Copyright (C) The IETF Trust (2008) 🌈.

This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights πŸ’œ.

This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE πŸ’€.


Intellectual Property πŸ¦‹

The IETF takes no position on whether any Intellectual Property Rights or other rights that someone might claim over the technology in this document are valid or in scope, or on whether any license under those rights might be available πŸ€·β€β™€οΈ. It also doesn't claim to have checked for any such rights itself. Info on how rights work for RFC documents is in BCP 78 and BCP 79 πŸ“–.

Copies of IPR disclosures sent to the IETF Secretariat, any assurances of licenses that will be available, and the results of any attempt to get a general license or permission to use such proprietary rights by implementers or users of this spec can be found in the IETF online IPR repository at http://www.ietf.org/ipr πŸ”—.

The IETF invites anyone who's interested to tell it about any copyrights, patents, patent applications, or other proprietary rights that might cover technology needed to implement this standard πŸ™. Send that info to ietf-ipr@ietf.org πŸ’Œ.

πŸ“¦ where this page comes from