RFC 6353

Transport Layer Security (TLS) Transport Model for the Simple Network Management Protocol (SNMP)

πŸ“… published July 2011, from ietf

RFC 6353 ✨ Transport Layer Security (TLS) Transport Model for the Simple Network Management Protocol (SNMP)

Part 1 of 13 πŸŽ€

okay so bestie, this is RFC 6353 and it's giving standards track πŸ’… It was written by W. Hardaker at SPARTA, Inc., and it's dated July 2011. It's filed under Category: Standards Track with ISSN: 2070-1721 πŸ¦‹

The big plot twist is that it obsoletes RFC 5953, so this one is the new and improved version of that older spec πŸ‘‘ The title is Transport Layer Security (TLS) Transport Model for the Simple Network Management Protocol (SNMP) 🌸


Abstract

okay so the abstract is literally the whole pitch πŸ’– This doc describes a Transport Model for SNMP that can run on either Transport Layer Security (TLS) or Datagram Transport Layer Security (DTLS) πŸ” Both of them give SNMP applications authentication and privacy, which is so important ngl ✨

It also explains how the TLS Transport Model (TLSTM) plugs in the features an SNMP Transport Subsystem needs, so that all this protection works in an interoperable way 🫢

The model is built for what network admins actually need, both on the security side and the operations side 🧚 It can send SNMP messages over TLS/TCP and DTLS/UDP. TLS gets to use TCP's better handling of larger packet sizes, while DTLS can be the potentially superior pick when a connectionless transport like UDP is what you want πŸ¦‹ And honestly? Both of them slot right into existing public keying infrastructures, which is very iykyk πŸ’…

The doc also defines a chunk of the Management Information Base (MIB) for network management protocols. Specifically, it adds objects for managing the TLS Transport Model for SNMP πŸ“¦


Status of This Memo

this part is the official paperwork, but I'll keep it real and simple πŸŽ€

This is an Internet Standards Track document 🌈

It's a product of the Internet Engineering Task Force (IETF), and it represents the consensus of the IETF community. It went through public review and was approved for publication by the Internet Engineering Steering Group (IESG) ✨ If you want more on Internet Standards, check Section 2 of RFC 5741 πŸ“š

For the latest status, any errata, and how to send feedback, go to http://www.rfc-editor.org/info/rfc6353 πŸ’œ


so the legal stuff, but make it cute πŸ’…

Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved.

This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stand on the publication date. Please actually read them, because they explain your rights and restrictions for this document πŸ™ˆ Any Code Components pulled out of this document must include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come with no warranty, same as the Simplified BSD License says 🫢

heads up: this doc may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. Some of the people who own the copyright in that older material may not have given the IETF Trust permission to allow modifications outside the IETF Standards Process πŸ’€

So, unless you get a proper license from the copyright holders of that material, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be made outside the IETF Standards Process. The only exceptions are formatting it for publication as an RFC or translating it into languages other than English 🌸


Table of Contents 🧚

here's the full map of the doc, so you can see what's coming πŸ—ΊοΈ

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  4
     1.1.  Conventions  . . . . . . . . . . . . . . . . . . . . . . .  7
     1.2.  Changes Since RFC 5953 . . . . . . . . . . . . . . . . . .  8
   2.  The Transport Layer Security Protocol  . . . . . . . . . . . .  8
   3.  How the TLSTM Fits into the Transport Subsystem  . . . . . . .  8
     3.1.  Security Capabilities of This Model  . . . . . . . . . . . 11
       3.1.1.  Threats  . . . . . . . . . . . . . . . . . . . . . . . 11
       3.1.2.  Message Protection . . . . . . . . . . . . . . . . . . 12
       3.1.3.  (D)TLS Connections . . . . . . . . . . . . . . . . . . 13
     3.2.  Security Parameter Passing . . . . . . . . . . . . . . . . 14
     3.3.  Notifications and Proxy  . . . . . . . . . . . . . . . . . 14
   4.  Elements of the Model  . . . . . . . . . . . . . . . . . . . . 15
     4.1.  X.509 Certificates . . . . . . . . . . . . . . . . . . . . 15
       4.1.1.  Provisioning for the Certificate . . . . . . . . . . . 15
     4.2.  (D)TLS Usage . . . . . . . . . . . . . . . . . . . . . . . 17
     4.3.  SNMP Services  . . . . . . . . . . . . . . . . . . . . . . 18
       4.3.1.  SNMP Services for an Outgoing Message  . . . . . . . . 18
       4.3.2.  SNMP Services for an Incoming Message  . . . . . . . . 19

     4.4.  Cached Information and References  . . . . . . . . . . . . 20
       4.4.1.  TLS Transport Model Cached Information . . . . . . . . 20
         4.4.1.1.  tmSecurityName . . . . . . . . . . . . . . . . . . 20
         4.4.1.2.  tmSessionID  . . . . . . . . . . . . . . . . . . . 21
         4.4.1.3.  Session State  . . . . . . . . . . . . . . . . . . 21
   5.  Elements of Procedure  . . . . . . . . . . . . . . . . . . . . 21
     5.1.  Procedures for an Incoming Message . . . . . . . . . . . . 21
       5.1.1.  DTLS over UDP Processing for Incoming Messages . . . . 22
       5.1.2.  Transport Processing for Incoming SNMP Messages  . . . 23
     5.2.  Procedures for an Outgoing SNMP Message  . . . . . . . . . 25
     5.3.  Establishing or Accepting a Session  . . . . . . . . . . . 26
       5.3.1.  Establishing a Session as a Client . . . . . . . . . . 26
       5.3.2.  Accepting a Session as a Server  . . . . . . . . . . . 28
     5.4.  Closing a Session  . . . . . . . . . . . . . . . . . . . . 29
   6.  MIB Module Overview  . . . . . . . . . . . . . . . . . . . . . 30
     6.1.  Structure of the MIB Module  . . . . . . . . . . . . . . . 30
     6.2.  Textual Conventions  . . . . . . . . . . . . . . . . . . . 30
     6.3.  Statistical Counters . . . . . . . . . . . . . . . . . . . 30
     6.4.  Configuration Tables . . . . . . . . . . . . . . . . . . . 30
       6.4.1.  Notifications  . . . . . . . . . . . . . . . . . . . . 31
     6.5.  Relationship to Other MIB Modules  . . . . . . . . . . . . 31
       6.5.1.  MIB Modules Required for IMPORTS . . . . . . . . . . . 31
   7.  MIB Module Definition  . . . . . . . . . . . . . . . . . . . . 31
   8.  Operational Considerations . . . . . . . . . . . . . . . . . . 54
     8.1.  Sessions . . . . . . . . . . . . . . . . . . . . . . . . . 54
     8.2.  Notification Receiver Credential Selection . . . . . . . . 54
     8.3.  contextEngineID Discovery  . . . . . . . . . . . . . . . . 55
     8.4.  Transport Considerations . . . . . . . . . . . . . . . . . 55
   9.  Security Considerations  . . . . . . . . . . . . . . . . . . . 55
     9.1.  Certificates, Authentication, and Authorization  . . . . . 55
     9.2.  (D)TLS Security Considerations . . . . . . . . . . . . . . 56
       9.2.1.  TLS Version Requirements . . . . . . . . . . . . . . . 56
       9.2.2.  Perfect Forward Secrecy  . . . . . . . . . . . . . . . 57
     9.3.  Use with SNMPv1/SNMPv2c Messages . . . . . . . . . . . . . 57
     9.4.  MIB Module Security  . . . . . . . . . . . . . . . . . . . 57
   10. IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 59
   11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 59
   12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 60
     12.1. Normative References . . . . . . . . . . . . . . . . . . . 60
     12.2. Informative References . . . . . . . . . . . . . . . . . . 61
   Appendix A.  Target and Notification Configuration Example . . . . 63
     A.1.  Configuring a Notification Originator  . . . . . . . . . . 63
     A.2.  Configuring TLSTM to Utilize a Simple Derivation of
           tmSecurityName . . . . . . . . . . . . . . . . . . . . . . 64
     A.3.  Configuring TLSTM to Utilize Table-Driven Certificate
           Mapping  . . . . . . . . . . . . . . . . . . . . . . . . . 64

next up: Section 1, Introduction πŸ¦‹βœ¨

1. Introduction ✨

okay bestie, before we get into TLSTM we need to understand the modular SNMPv3 architecture as defined by [RFC3411] and then glowed up by the Transport Subsystem [RFC5590] πŸ’…. it's also super important to know the SNMPv3 architecture terminology so you can see where the Transport Model in this doc fits in and how it vibes with the other subsystems πŸ¦‹. if you want the full tea on the documents that make up the current Internet-Standard Management Framework, check out Section 7 of [RFC3410] πŸ“š.

okay so this doc describes a Transport Model that uses Transport Layer Security (TLS) [RFC5246] and the Datagram Transport Layer Security (DTLS) Protocol [RFC4347], inside a Transport Subsystem [RFC5590] πŸ”. DTLS is basically the datagram version of TLS [RFC5246], so it's giving sibling energy πŸ‘―β€β™€οΈ. the Transport Model here is called the Transport Layer Security Transport Model (TLSTM) πŸŽ€. TLS and DTLS both lean on the X.509 public keying infrastructure [RFC5280] πŸ—οΈ. (D)TLS supports multiple authentication mechanisms, but this document only talks about X.509 certificate-based authentication. other forms of authentication are possible, but they're outside the scope of this spec, so we're not going there today πŸ™ˆ. this transport model is built for network admins who need it to work in places where a connectionless transport (like UDP) is preferred, and also in places where huge amounts of data need to be sent (like over a TCP-based stream) 🌊. both TLS and DTLS fit nicely into existing public keying infrastructures πŸ’œ. this document supports sending SNMP messages over TLS/TCP and DTLS/UDP ✨.

this document also defines a portion of the Management Information Base (MIB) for network management protocols 🧚. specifically, it defines objects for managing the TLS Transport Model for SNMP πŸ’–.

so managed objects are accessed through a virtual information store called the Management Information Base or MIB πŸ“. MIB objects are usually accessed through the Simple Network Management Protocol (SNMP) πŸ“‘. objects in the MIB are defined using the mechanisms in the Structure of Management Information (SMI) 🧩. this memo specifies a MIB module that is compliant with SMIv2, which is described in STD 58: [RFC2578], [RFC2579], and [RFC2580] πŸ’….

here's a little diagram of two SNMP entities chatting over the TLS Transport Model (shown as "TLSTM") πŸ‘€. one entity has a command responder and a notification originator application, and the other has a command generator and a notification receiver application. this particular mix of application types is just an example, and other combos are equally valid 🌈.

Note: this diagram shows the Transport Security Model (TSM) being used as the security model that is defined in [RFC5591] 🫢.

 +---------------------------------------------------------------------+
 |                              Network                                |
 +---------------------------------------------------------------------+
     ^                     |            ^               |
     |Notifications        |Commands    |Commands       |Notifications
 +---|---------------------|-------+ +--|---------------|--------------+
 |   |                     V       | |  |               V              |
 | +------------+  +------------+  | | +-----------+   +----------+    |
 | |  (D)TLS    |  |  (D)TLS    |  | | | (D)TLS    |   | (D)TLS   |    |
 | |  (Client)  |  |  (Server)  |  | | | (Client)  |   | (Server) |    |
 | +------------+  +------------+  | | +-----------+   +----------+    |
 |       ^             ^           | |       ^              ^          |
 |       |             |           | |       |              |          |
 |       +-------------+           | |       +--------------+          |
 | +-----|------------+            | | +-----|------------+            |
 | |     V            |            | | |     V            |            |
 | | +--------+       |   +-----+  | | | +--------+       |   +-----+  |
 | | | TLS TM |<--------->|Cache|  | | | | TLS TM |<--------->|Cache|  |
 | | +--------+       |   +-----+  | | | +--------+       |   +-----+  |
 | |Transport Subsys. |      ^     | | |Transport Subsys. |      ^     |
 | +------------------+      |     | | +------------------+      |     |
 |    ^                      |     | |    ^                      |     |
 |    |                      +--+  | |    |                      +--+  |
 |    v                         |  | |    V                         |  |
 | +-----+ +--------+ +-------+ |  | | +-----+ +--------+ +-------+ |  |
 | |     | |Message | |Securi.| |  | | |     | |Message | |Securi.| |  |
 | |Disp.| |Proc.   | |Subsys.| |  | | |Disp.| |Proc.   | |Subsys.| |  |
 | |     | |Subsys. | |       | |  | | |     | |Subsys. | |       | |  |
 | |     | |        | |       | |  | | |     | |        | |       | |  |
 | |     | | +----+ | | +---+ | |  | | |     | | +----+ | | +---+ | |  |
 | |    <--->|v3MP|<--> |TSM|<--+  | | |    <--->|v3MP|<--->|TSM|<--+  |
 | |     | | +----+ | | +---+ |    | | |     | | +----+ | | +---+ |    |
 | |     | |        | |       |    | | |     | |        | |       |    |
 | +-----+ +--------+ +-------+    | | +-----+ +--------+ +-------+    |
 |    ^                            | |    ^                            |
 |    |                            | |    |                            |
 |    +-+------------+             | |    +-+----------+               |
 |      |            |             | |      |          |               |
 |      v            v             | |      v          V               |
 | +-------------+ +-------------+ | | +-------------+ +-------------+ |
 | |   COMMAND   | | NOTIFICAT.  | | | |  COMMAND    | | NOTIFICAT.  | |
 | |  RESPONDER  | | ORIGINATOR  | | | | GENERATOR   | | RECEIVER    | |
 | | application | | application | | | | application | | application | |
 | +-------------+ +-------------+ | | +-------------+ +-------------+ |
 |                     SNMP entity | |                     SNMP entity |
 +---------------------------------+ +---------------------------------+

1.1. Conventions πŸ“

for consistency with SNMP-related specs, this doc sticks with the terminology from STD 62, instead of the wording used in non-SNMP specs πŸ€“. this lines up with the IESG decision not to make SNMPv3 terminology match other non-SNMP specs when SNMPv3 was advanced to a Full Standard πŸŽ€.

"Authentication" in this document typically refers to the English meaning of "serving to prove the authenticity of" the message, not data source authentication or peer identity authentication. πŸ™ƒ

the terms "manager" and "agent" aren't used here, because in the [RFC3411] architecture every SNMP entity can act as a manager, an agent, or both, depending on which SNMP application types its implementation supports 🧸. when we need to be specific, we use the application names: command generator, command responder, notification originator, notification receiver, and proxy forwarder πŸ”. for more info, see "SNMP Applications" [RFC3413] πŸ“–.

a lot of this doc talks about both TLS and DTLS at once, when the parts being discussed work the same with either protocol πŸ’«. "(D)TLS" is used in those spots to mean the statement applies to either or both protocols, as appropriate πŸ’œ. when we need to split them up, we say "TLS" or "DTLS" on their own 🌸. the Transport Model itself is named "TLS Transport Model," and it doesn't refer to the TLS or DTLS protocol. it refers to the spec in this document, which supports both TLS and DTLS πŸ¦‹.

throughout this doc, "client" and "server" refer to the two ends of the (D)TLS transport connection ✨. the client actively opens the (D)TLS connection, and the server passively listens for incoming (D)TLS connections πŸ‘‚. an SNMP entity can be a (D)TLS client, a (D)TLS server, or both, depending on the SNMP applications it supports 🫢.

the User-Based Security Model (USM) [RFC3414] is a mandatory-to-implement Security Model in STD 62 πŸ‘‘. while (D)TLS and USM often refer to a user, the term preferred in RFC 3411 and in this memo is "principal" πŸ™Œ. a principal is the "who" on whose behalf services are provided or processing takes place 🧠. a principal can be lots of things, like an individual acting in a particular role, a set of individuals each acting in a particular role, an application or set of applications, or a combo of these within an administrative domain 🌈.

throughout this doc, "session" means a secure association between two TLS Transport Models that lets one or more SNMP messages be sent during the lifetime of the session πŸ”. the (D)TLS protocols have their own internal idea of a session too. these two concepts are related, but when this document says "session," it means the TLSTM's specific session, not the (D)TLS protocol's session πŸ’….

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 [RFC2119] πŸ“œ.

1.2. Changes Since RFC 5953 πŸ”„

This document obsoletes [RFC5953]. πŸ—‘οΈ

since RFC 5953 came out, a few editorial errata have been noted πŸ“. they're posted on the RFC Editor web site, and this document has fixed those errors βœ….

this document updates the references to RFC 3490 (IDNA 2003) to [RFC5890] (IDNA 2008), because RFC 3490 was obsoleted by RFC 5890 🌏.

references to RFC 1033 were swapped out for [RFC1123] πŸ”.

added an informative reference to 5953 πŸ“Ž.

updated MIB dates and the revision date πŸ“….

2. The Transport Layer Security Protocol πŸ”

(D)TLS provides authentication, data message integrity, and privacy at the transport layer (see [RFC4347]) πŸ›‘οΈ.

The primary goals of the TLS Transport Model are to provide privacy, peer identity authentication, and data integrity between two communicating SNMP entities. πŸ’œ The TLS and DTLS protocols provide a secure transport that the TLSTM is built on πŸ—οΈ. please refer to [RFC5246] and [RFC4347] for complete descriptions of the protocols πŸ“š.

3. How the TLSTM Fits into the Transport Subsystem ✨

Okay so, a transport model is a piece of the Transport Subsystem 🧚 The TLS Transport Model (TLSTM) lives right between the (D)TLS transport layer underneath it and the Message Dispatcher [RFC3411] inside the SNMP engine. It's the middleman, and it's giving main character energy πŸ’…

The TLS Transport Model sets up a session with the TLS Transport Model of another SNMP engine 🫢 On the sending side, the transport model takes unencrypted and unauthenticated messages from the Dispatcher and hands them down to (D)TLS so they get encrypted and authenticated. On the receiving side, it takes the decrypted and authenticated/integrity-checked messages coming up from (D)TLS and passes them along to the Dispatcher. Pretty neat, right? πŸŽ€

Once a TLS Transport Model session exists, SNMP messages can basically travel through that session from one SNMP message Dispatcher to another SNMP Message Dispatcher πŸ¦‹ If two SNMP applications need to pass several messages between them, they MAY all go through the same session. And a TLSTM implementation MAY decide to close the session to save resources, which is honestly so responsible of it 🌸

The TLS Transport Model of an SNMP engine is also the one doing the translating between (D)TLS-specific security parameters and the SNMP-specific, model-independent parameters πŸ”₯

Here's a diagram showing where the TLS Transport Model (the "(D)TLS TM" box) sits in the architecture from RFC 3411 and the Transport Subsystem πŸ‘‘

   +------------------------------+
   |    Network                   |
   +------------------------------+
      ^       ^              ^
      |       |              |
      v       v              v
   +-------------------------------------------------------------------+
   | +--------------------------------------------------+              |
   | |  Transport Subsystem                             |  +--------+  |
   | | +-----+ +-----+ +-------+             +-------+  |  |        |  |
   | | | UDP | | SSH | |(D)TLS |    . . .    | other |<--->| Cache  |  |
   | | |     | | TM  | | TM    |             |       |  |  |        |  |
   | | +-----+ +-----+ +-------+             +-------+  |  +--------+  |
   | +--------------------------------------------------+         ^    |
   |              ^                                               |    |
   |              |                                               |    |
   | Dispatcher   v                                               |    |
   | +--------------+ +---------------------+  +----------------+ |    |
   | | Transport    | | Message Processing  |  | Security       | |    |
   | | Dispatch     | | Subsystem           |  | Subsystem      | |    |
   | |              | |     +------------+  |  | +------------+ | |    |
   | |              | |  +->| v1MP       |<--->| | USM        | | |    |
   | |              | |  |  +------------+  |  | +------------+ | |    |
   | |              | |  |  +------------+  |  | +------------+ | |    |
   | |              | |  +->| v2cMP      |<--->| | Transport  | | |    |
   | | Message      | |  |  +------------+  |  | | Security   |<--+    |
   | | Dispatch    <---->|  +------------+  |  | | Model      | |      |
   | |              | |  +->| v3MP       |<--->| +------------+ |      |
   | |              | |  |  +------------+  |  | +------------+ |      |
   | |              | |  |  +------------+  |  | | Other      | |      |
   | | PDU Dispatch | |  |  +------------+  |  | | Model(s)   | |      |
   | +--------------+ |  +->| otherMP    |<--->| | Model(s)   | |      |
   |              ^   |     +------------+  |  | +------------+ |      |
   |              |   +---------------------+  +----------------+      |
   |              v                                                    |
   |      +-------+-------------------------+---------------+          |
   |      ^                                 ^               ^          |
   |      |                                 |               |          |
   |      v                                 v               v          |
   | +-------------+   +---------+   +--------------+  +-------------+ |
   | |   COMMAND   |   | ACCESS  |   | NOTIFICATION |  |    PROXY    | |
   | |  RESPONDER  |<->| CONTROL |<->|  ORIGINATOR  |  |  FORWARDER  | |
   | | application |   |         |   | applications |  | application | |
   | +-------------+   +---------+   +--------------+  +-------------+ |
   |      ^                                 ^                          |
   |      |                                 |                          |
   |      v                                 v                          |
   | +----------------------------------------------+                  |
   | |             MIB instrumentation              |      SNMP entity |
   +-------------------------------------------------------------------+

3.1. Security Capabilities of This Model πŸ”

3.1.1. Threats πŸ’€

The TLS Transport Model protects against the threats that the RFC 3411 architecture [RFC3411] calls out 🫢

  1. Modification of Information - This is the danger that an unauthorized entity changes SNMP messages in transit, even though they were made for an authorized principal, so it can pull off unauthorized management operations like faking the value of an object 😭

(D)TLS checks that the content of every received message hasn't been changed while it was moving across the network. It also checks that data hasn't been altered or destroyed in an unauthorized way, and that data sequences haven't been changed more than could happen by accident πŸ”₯

  1. Masquerade - This is the danger that someone tries to do management operations they aren't allowed to do, by pretending to be another principal who does have those permissions πŸ™ˆ

The TLSTM checks the identity of the (D)TLS server by using the (D)TLS protocol and X.509 certificates. A TLS Transport Model implementation MUST support the authentication of both the server and the client πŸ”‘

  1. Message stream modification - Messages can get re-ordered, delayed, or replayed through the normal way connectionless transport services work, and that's just life πŸŒ€ The real threat is when someone maliciously re-orders, delays, or replays messages more than normal transport behavior would ever do, just to sneak in unauthorized management operations πŸ‘€

(D)TLS gives replay protection using a Message Authentication Code (MAC) that includes a sequence number πŸ’œ UDP doesn't have any sequencing built in, so DTLS uses a sliding window protocol with the sequence number used for replay protection (see [RFC4347]) ✨

  1. Disclosure - This is the danger of someone eavesdropping on the conversations between SNMP engines πŸ‘‚

(D)TLS protects information from unauthorized recipients or eavesdroppers by letting all traffic between SNMP engines be encrypted πŸ”’ A TLS Transport Model implementation MUST support message encryption to protect sensitive data from eavesdropping attacks πŸ›‘οΈ

  1. Denial of Service - The RFC 3411 architecture [RFC3411] says that denial-of-service (DoS) attacks don't need to be handled by an SNMP security protocol πŸ€·β€β™€οΈ Still, connectionless transports (like DTLS over UDP) are vulnerable to a bunch of DoS attacks because they're more open to spoofed IP addresses 😬 Check out Section 4.2 for how the cookie mechanism gets used. Just know that this mechanism doesn't defend against DoS attacks coming from valid IP addresses 🚫

See Section 9 for more on the security considerations for the TLSTM and these threats. Seriously, go read it, it's important 🫢⚠️

3.1.2. Message Protection πŸ›‘οΈ

The RFC 3411 architecture recognizes three levels of security πŸ‘‘

  • noAuthNoPriv: without authentication and without privacy
  • authNoPriv: with authentication but without privacy
  • authPriv: with authentication and with privacy

The TLS Transport Model figures out from (D)TLS who the authenticated principal is, along with the transport type and transport address of an incoming message πŸ“¬ For outgoing messages, it gives (D)TLS the identity and the destination type and address πŸ¦‹

When an application asks for a session for a message, it also asks for a security level for that session πŸŽ€ The TLS Transport Model MUST ensure that the (D)TLS connection gives security at least as high as the level that was requested πŸ” How that security level gets turned into the algorithms for data integrity and privacy is up to the implementation 🧠 But the NULL integrity and encryption algorithms MUST NOT be used to meet security level requests for authentication or privacy 🚫 Implementations MAY choose to force (D)TLS to only allow cipher_suites that provide both authentication and privacy, so that this is guaranteed πŸ’œ

If there's a suitable interface between the TLS Transport Model and the (D)TLS Handshake Protocol that lets you pick algorithms based on the security level (like a security level to cipher_suites mapping table), then the application can use different security levels 🌈

The authentication, integrity, and privacy algorithms used by the (D)TLS Protocols can change over time πŸ•°οΈ Cryptography keeps evolving, and so does (D)TLS, so it's a whole journey 🧚 Implementers are encouraged to plan for changes in how much operators trust particular algorithms πŸ’… Implementations SHOULD offer configuration settings for mapping algorithms to SNMPv3 security levels πŸ“

3.1.3. (D)TLS Connections πŸ”—

The TLS Transport Model opens (D)TLS connections while it's going through the steps for an outgoing SNMP message ✨ Since the sender of a message is the one who starts creating a (D)TLS connection when one is needed, that connection will already be there for an incoming message 🫢

Implementations MAY choose to set up (D)TLS connections ahead of time, in anticipation of outgoing messages πŸ™Œ This can help make sure a (D)TLS connection to a given target is ready before you actually need to send something over it πŸ• Of course, there's no guarantee that a session set up in advance will still be valid when you need it πŸ˜…

DTLS connections, when used over UDP, are uniquely identified inside the TLS Transport Model by the combination of transportDomain, transportAddress, tmSecurityName, and requestedSecurityLevel tied to each session πŸ†” Every unique combination of those parameters MUST have a locally chosen unique tlstmSessionID for each active session πŸ”‘ For more info, see Section 5. TLS over TCP sessions are different 🧡 They don't need a unique pairing of address and port, because TCP already handles the session framing. They still MUST provide a unique tlstmSessionID so the session can be referenced πŸŽ€

The tlstmSessionID MUST NOT change during the whole life of the session from the TLSTM's point of view, and it MUST uniquely identify a single session πŸ’– Here's a little implementation hint: the (D)TLS internal SessionID doesn't meet these requirements πŸ™…β€β™€οΈ It can change over the life of the connection as the TLSTM sees it (for example, during renegotiation), and it doesn't necessarily uniquely identify a TLSTM session, because multiple TLSTM sessions can share the same D(TLS) internal SessionID 🌸

3.2. Security Parameter Passing ✨

Okay so, for the (D)TLS server side 🫢, the (D)TLS-specific security parameters (aka cipher_suites, X.509 certificate fields, IP addresses, and ports) get translated by the TLS Transport Model into security parameters for the TLS Transport Model and the security model (like tmSecurityLevel, tmSecurityName, transportDomain, transportAddress). The transport info and the (D)TLS security info, including the authenticated identity, get stored in a cache that's referenced by tmStateReference πŸ’…

On the (D)TLS client side, the TLS Transport Model takes input from the Dispatcher in the sendMessage() Abstract Service Interface (ASI), plus input from the tmStateReference cache. It converts all of that into suitable security parameters for (D)TLS and sets up sessions as needed 🌸

Section 5 goes way deeper into these concepts in the elements of procedure, so go check it out if you're curious 🧚

3.3. Notifications and Proxy πŸ””

(D)TLS connections can be started by (D)TLS clients on behalf of SNMP applications that initiate communications, like command generators, notification originators, and proxy forwarders. Command generators are often run by a human πŸ™‹, but notification originators and proxy forwarders are usually unmanned automated processes πŸ€–. The targets that notifications and proxied requests should be sent to are typically picked and configured by a network administrator.

The SNMP-TARGET-MIB module [RFC3413] has objects for defining management targets, including transportDomain, transportAddress, securityName, securityModel, and securityLevel parameters, for notification originator, proxy forwarder, and SNMP-controllable command generator applications. Transport domains and transport addresses are configured in the snmpTargetAddrTable, and the securityModel, securityName, and securityLevel parameters are configured in the snmpTargetParamsTable. This document defines a MIB module that extends the SNMP-TARGET-MIB's snmpTargetParamsTable to specify a (D)TLS client-side certificate to use for the connection πŸŽ€

When configuring a (D)TLS target, the snmpTargetAddrTDomain and snmpTargetAddrTAddress parameters in snmpTargetAddrTable SHOULD be set to the snmpTLSTCPDomain or snmpDTLSUDPDomain object and an appropriate snmpTLSAddress value. When it's used with the SNMPv3 message processing model, the snmpTargetParamsMPModel column of the snmpTargetParamsTable SHOULD be set to a value of 3. The snmpTargetParamsSecurityName SHOULD be set to an appropriate securityName value, and the snmpTlstmParamsClientFingerprint parameter of the snmpTlstmParamsTable SHOULD be set to a value that refers to a locally held certificate (and the corresponding private key) to be used. Other parameters, for example cryptographic configuration such as which cipher_suites to use, must come from configuration mechanisms not defined in this document πŸ”

The securityName defined in the snmpTargetParamsSecurityName column will be used by the access control model to authorize any notifications that need to be sent πŸ’œ


4. Elements of the Model 🧩

This section contains the definitions required to realize the (D)TLS Transport Model defined by this document 🌈

4.1. X.509 Certificates πŸ“œ

(D)TLS can use X.509 certificates to authenticate both sides of the transport. This section talks about how X.509 certificates get used in the TLSTM πŸ¦‹

While (D)TLS supports multiple authentication mechanisms, this document only covers X.509-certificate-based authentication. Other forms of authentication are outside the scope of this specification. TLSTM implementations are REQUIRED to support X.509 certificates πŸ‘‘

4.1.1. Provisioning for the Certificate πŸŽ€

Authentication using (D)TLS will require that SNMP entities have certificates, either signed by trusted Certification Authorities (CAs), or self signed. Furthermore, SNMP entities will most commonly need to be provisioned with root certificates that represent the list of trusted CAs that an SNMP entity can use for certificate verification. SNMP entities SHOULD also be provisioned with an X.509 certificate revocation mechanism, which can be used to verify that a certificate has not been revoked. Trusted public keys from either CA certificates and/or self-signed certificates MUST be installed into the server through a trusted out-of-band mechanism, and their authenticity MUST be verified before access is granted πŸ”’

Having received a certificate from a connecting TLSTM client, the authenticated tmSecurityName of the principal is derived using the snmpTlstmCertToTSNTable. This table allows mapping of incoming connections to tmSecurityNames through defined transformations. The transformations defined in the SNMP-TLS-TM-MIB include:

  • Mapping a certificate's subjectAltName or CommonName components to a tmSecurityName, or
  • Mapping a certificate's fingerprint value to a directly specified tmSecurityName

As an implementation hint: implementations may choose to discard any connections for which no potential snmpTlstmCertToTSNTable mapping exists before performing certificate verification, to avoid expending computational resources associated with certificate verification πŸ’‘

Deployments SHOULD map the "subjectAltName" component of X.509 certificates to the TLSTM specific tmSecurityNames. The authenticated identity can be obtained by the TLS Transport Model by extracting the subjectAltName(s) from the peer's certificate. The receiving application will then have an appropriate tmSecurityName for use by other SNMPv3 components, like an access control model ✨

An example of this type of mapping setup can be found in Appendix A 🧁

This tmSecurityName may be later translated from a TLSTM specific tmSecurityName to an SNMP engine securityName by the security model. A security model, like the TSM security model [RFC5591], may perform an identity mapping or a more complex mapping to derive the securityName from the tmSecurityName offered by the TLS Transport Model πŸ”

The standard View-Based Access Control Model (VACM) access control model constrains securityNames to be 32 octets or less in length. A TLSTM generated tmSecurityName, possibly in combination with a messaging or security model that increases the length of the securityName, might cause the securityName length to exceed 32 octets. For example, a 32-octet tmSecurityName derived from an IPv6 address, paired with a TSM prefix, will generate a 36-octet securityName. Such a securityName will not be able to be used with standard VACM or TARGET MIB modules. Operators should be careful to select algorithms and subjectAltNames to avoid this situation πŸ™ˆ

Heads up, bestie: that 32-octet limit is a real trap. An IPv6-derived tmSecurityName plus a TSM prefix already blows past it, so pick your algorithms and subjectAltNames carefully 😭

A pictorial view of the complete transformation process (using the TSM security model for the example) is shown below πŸ–ΌοΈ

    +-------------+     +-------+                   +-----+
    | Certificate |     |       |                   |     |
    |    Path     |     | TLSTM |  tmSecurityName   | TSM |
    | Validation  | --> |       | ----------------->|     |
    +-------------+     +-------+                   +-----+
                                                        |
                                                        | securityName
                                                        V
                                                    +-------------+
                                                    | application |
                                                    +-------------+

4.2. (D)TLS Usage πŸ”

(D)TLS MUST negotiate a cipher_suite that uses X.509 certificates for authentication, and MUST authenticate both the client and the server. The mandatory-to-implement cipher_suite is specified in the TLS specification [RFC5246] πŸ’–

TLSTM verifies the certificates when the connection is opened (see Section 5.3). For this reason, TLS renegotiation with different certificates MUST NOT be done. That is, implementations MUST either disable renegotiation completely (RECOMMENDED), or they MUST present the same certificate during renegotiation (and MUST verify that the other end presented the same certificate) πŸ›‘οΈ

For DTLS over UDP, each SNMP message MUST be placed in a single UDP datagram; it MAY be split to multiple DTLS records. In other words, if a single datagram contains multiple DTLS application_data records, they are concatenated when received. The TLSTM implementation SHOULD return an error if the SNMP message does not fit in the UDP datagram, and thus cannot be sent πŸ“¦

For DTLS over UDP, the DTLS server implementation MUST support DTLS cookies ([RFC4347] already requires that clients support DTLS cookies). Implementations are not required to perform the cookie exchange for every DTLS handshake; however, enabling it by default is RECOMMENDED πŸͺ

For DTLS, replay protection MUST be used πŸ™…β€β™€οΈ

4.3. SNMP Services πŸ›ŽοΈ

This section describes the services provided by the TLS Transport Model, with their inputs and outputs. The services are between the Transport Model and the Dispatcher πŸ’Œ

The services are described as primitives of an abstract service interface (ASI), and the inputs and outputs are described as abstract data elements as they are passed in these abstract service primitives 🧠

4.3.1. SNMP Services for an Outgoing Message πŸ“€

The Dispatcher passes the information to the TLS Transport Model using the ASI defined in the Transport Subsystem:

      statusInformation =
      sendMessage(
      IN   destTransportDomain           -- transport domain to be used
      IN   destTransportAddress          -- transport address to be used
      IN   outgoingMessage               -- the message to send
      IN   outgoingMessageLength         -- its length
      IN   tmStateReference              -- reference to transport state
       )

The abstract data elements returned from, or passed as parameters into, the abstract service primitives are as follows:

  • statusInformation: An indication of whether the sending of the message was successful. If not, it is an indication of the problem.
  • destTransportDomain: The transport domain for the associated destTransportAddress. The Transport Model uses this parameter to determine the transport type of the associated destTransportAddress. This document specifies the snmpTLSTCPDomain and the snmpDTLSUDPDomain transport domains.
  • destTransportAddress: The transport address of the destination TLS Transport Model, in a format specified by the SnmpTLSAddress TEXTUAL-CONVENTION.
  • outgoingMessage: The outgoing message to send to (D)TLS for encapsulation and transmission.
  • outgoingMessageLength: The length of the outgoingMessage.
  • tmStateReference: A reference used to pass model-specific and mechanism-specific parameters between the Transport Subsystem and transport-aware Security Models 🫧

4.3.2. SNMP Services for an Incoming Message ✨

okay so when a message shows up, the TLS Transport Model grabs it from the network using the (D)TLS service and then hands it off to the Dispatcher with this abstract service interface (ASI) πŸ’…:

statusInformation =
receiveMessage(
IN   transportDomain               -- origin transport domain
IN   transportAddress              -- origin transport address
IN   incomingMessage               -- the message received
IN   incomingMessageLength         -- its length
IN   tmStateReference              -- reference to transport state
 )

these are the abstract data elements that get returned or passed in as parameters 🧁:

  • statusInformation: says whether the message got passed along successfully. If it didn't, it tells you what went wrong 😭
  • transportDomain: the transport domain for the matching transportAddress. This document defines the snmpTLSTCPDomain and snmpDTLSUDPDomain transport domains πŸ¦‹
  • transportAddress: the transport address of whoever sent the message, in the format defined by the SnmpTLSAddress TEXTUAL-CONVENTION πŸ“¬
  • incomingMessage: the entire SNMP message after (D)TLS has finished with it πŸ’Œ
  • incomingMessageLength: how long the incomingMessage is πŸ“
  • tmStateReference: a reference that lets model-specific and mechanism-specific parameters get passed between the Transport Subsystem and transport-aware Security Models πŸ”—

4.4. Cached Information and References 🧠

okay this part is lowkey important bc there are two levels of state info that might need to stick around. one is the immediate state linking a request-response pair. the other is potentially longer-term state about transport and security 🫢 "Transport Subsystem for the Simple Network Management Protocol (SNMP)" [RFC5590] lays out the general requirements for caches and references.

4.4.1. TLS Transport Model Cached Information 🌸

the TLS Transport Model has its own specific responsibilities when it comes to cached info. check out the Elements of Procedure in Section 5 for the detailed steps on how the TLS Transport Model uses the tmStateReference fields πŸŽ€

4.4.1.1. tmSecurityName

the tmSecurityName MUST be a human-readable name (in snmpAdminString format) that represents the identity set up through the procedures in Section 5. the tmSecurityName MUST stay constant for all traffic going through a single TLSTM session. messages MUST NOT be sent through an existing (D)TLS connection that was set up with a different tmSecurityName πŸ™…β€β™€οΈ no mixing identities, bestie!

on the (D)TLS server side of a connection, the tmSecurityName gets derived using the procedures in Section 5.3.2 and the SNMP-TLS-TM-MIB's snmpTlstmCertToTSNTable DESCRIPTION clause πŸ”

on the (D)TLS client side, the security model hands the tmSecurityName over to the TLS Transport Model through the tmStateReference. this tmSecurityName is usually a copy of, or derived from, the securityName that the application passed in (possibly because of configuration in the SNMP-TARGET-MIB). the Security Model likely derived the tmSecurityName from the securityName the application gave it (possibly because of configuration in the SNMP-TARGET-MIB) πŸ€“

transport-model-aware security models derive tmSecurityName from a securityName, which might be configured in MIB modules for notifications and access controls. Transport Models SHOULD use predictable tmSecurityNames so operators know what to put in when they configure MIB modules that use securityNames derived from tmSecurityNames πŸ—ΊοΈ the TLSTM generates predictable tmSecurityNames based on the configuration in the SNMP-TLS-TM-MIB's snmpTlstmCertToTSNTable, and it relies on network operators to have configured that table properly πŸ‘‘

4.4.1.2. tmSessionID

the tmSessionID MUST be recorded for each message the moment it's received. when tmSameSecurity is set, the recorded tmSessionID can be used to check whether the (D)TLS connection available for sending a matching outgoing message is the same (D)TLS connection that was used to receive the incoming message (for example, a response to a request) πŸ¦‹

4.4.1.3. Session State

the per-session state that tmStateReference points to may be saved across multiple messages in a Local Configuration Datastore. extra session/connection state info might also be stored in a Local Configuration Datastore πŸ’Ύ


5. Elements of Procedure πŸŽ€

okay so the Abstract service interfaces were defined by [RFC3411] and then further augmented by [RFC5590] to describe the conceptual data flows between the different subsystems inside an SNMP entity. the TLSTM uses some of these conceptual data flows when it talks to other subsystems πŸ’¬

to keep the elements of procedure from getting too long, the release of state info isn't always spelled out. the general rule is: if state info is around when a message gets discarded, the message-state info should also be released. if state info is around when a session is closed, the session state info should also be released. sensitive stuff, like cryptographic keys, should be overwritten appropriately before it gets released πŸ” no leaks, periodt!

an error indication in statusInformation will usually include the Object Identifier (OID) and value for an incremented error counter. it may come with the requested securityLevel and the tmStateReference. per-message context info isn't accessible to Transport Models, so for the returned counter OID and value, contextEngine would be set to the local value of snmpEngineID and contextName to the default context for error counters 🧾

5.1. Procedures for an Incoming Message πŸ“₯

this section covers the steps the (D)TLS Transport Model follows when it gets a (D)TLS protected packet. the required functionality is split into two sections πŸ’–

Section 5.1.1 covers the processing needed to de-multiplex multiple DTLS connections, which is specifically needed for DTLS over UDP sessions. it's assumed that TLS protocol implementations already handle appropriate message demultiplexing 🧚

Section 5.1.2 covers the transport processing needed once the (D)TLS processing is done. this is needed for all (D)TLS-based connections 🌈

5.1.1. DTLS over UDP Processing for Incoming Messages 🌊

demultiplexing incoming packets into separate DTLS sessions MUST be implemented. for connection-oriented transport protocols like TCP, the transport protocol takes care of sending incoming packets to the right connection. for DTLS over UDP, that demultiplexing either has to happen inside the DTLS implementation (if supported) or in the TLSTM implementation 🫠

like TCP, DTLS over UDP uses the four-tuple <source IP, destination IP, source port, destination port> to identify the connection (and the relevant DTLS connection state). so when a new session gets set up, implementations MUST use a different UDP source port number for each active connection to a remote destination IP-address/port-number combination, so the remote entity can tell the multiple connections apart 🎯

if demultiplexing received UDP datagrams to DTLS connection state is done by the TLSTM implementation (instead of the DTLS implementation), the steps below describe one possible method for doing it ✨

the important outputs from these steps are the remote transport address, incomingMessage, incomingMessageLength, and the tlstmSessionID πŸ’…

  1. The TLS Transport Model examines the raw UDP message, in an implementation-dependent manner.
  2. The TLS Transport Model queries the Local Configuration Datastore (LCD) (see [RFC3411], Section 3.4.2) using the transport parameters (source and destination IP addresses and ports) to determine if a session already exists.
    • 2a) If a matching entry in the LCD does not exist, then the UDP packet is passed to the DTLS implementation for processing. If the DTLS implementation decides to continue with the connection and allocate state for it, it returns a new DTLS connection handle (an implementation dependent detail). In this case, TLSTM selects a new tlstmSessionId, and caches this and the DTLS connection handle as a new entry in the LCD (indexed by the transport parameters). If the DTLS implementation returns an error or does not allocate connection state (which can happen with the stateless cookie exchange), processing stops. πŸ™ˆ
    • 2b) If a session does exist in the LCD, then its DTLS connection handle (an implementation dependent detail) and its tlstmSessionId are extracted from the LCD. The UDP packet and the connection handle are passed to the DTLS implementation. If the DTLS implementation returns success but does not return an incomingMessage and an incomingMessageLength, then processing stops (this is the case when the UDP datagram contained DTLS handshake messages, for example). If the DTLS implementation returns an error, then processing stops. πŸ›‘
  3. Retrieve the incomingMessage and an incomingMessageLength from DTLS. These results and the tlstmSessionID are used below in Section 5.1.2 to complete the processing of the incoming message. πŸŽ€

5.1.2. Transport Processing for Incoming SNMP Messages ✨

okay bestie, this part is about what the TLS Transport Model does once a message has already been pulled out of the (D)TLS stream 🫢 the careful bit: you need to make sure each message is complete and single before you process it πŸ’… multiple SNMP messages can ride inside one DTLS message, and a TLS stream can hand you only part of an SNMP message, so these steps are about one singular, finished message at a time πŸ¦‹

  1. Determine the tlstmSessionID for the incoming message. The tlstmSessionID MUST be a unique session identifier for this (D)TLS connection πŸ”‘ The contents and format of this identifier are implementation dependent, as long as it's unique to the session. A session identifier MUST NOT be reused until all references to it are no longer in use ⏳ The tmSessionID is equal to the tlstmSessionID discussed in Section 5.1.1. tmSessionID is the session identifier when it's stored in the tmStateReference, and tlstmSessionID is the session identifier when it's stored in the LCD. They MUST always be equal when processing a given session's traffic πŸ’–

If this is the first message received through this session, and the session doesn't have an assigned tlstmSessionID yet, then the snmpTlstmSessionAccepts counter is incremented and a tlstmSessionID for the session is created 🌱 This will only happen on the server side of a connection, because a client would have already assigned a tlstmSessionID during the openSession() invocation. Implementations may have performed the procedures described in Section 5.3.2 before this point, or they may perform them now, but the procedures described in Section 5.3.2 MUST be performed before continuing beyond this point πŸ‘‘

  1. Create a tmStateReference cache for the subsequent reference and assign the following values within it: 🧺
    • tmTransportDomain = snmpTLSTCPDomain or snmpDTLSUDPDomain, as appropriate.
    • tmTransportAddress = The address from which the message originated.
    • tmSecurityLevel = The derived tmSecurityLevel for the session, as discussed in Sections 3.1.2 and 5.3.
    • tmSecurityName = The derived tmSecurityName for the session, as discussed in Section 5.3. This value MUST be constant during the lifetime of the session πŸ”’
    • tmSessionID = The tlstmSessionID described in step 1 above.
  2. The incomingMessage and incomingMessageLength are assigned values from the (D)TLS processing πŸ“¦
  3. The TLS Transport Model passes the transportDomain, transportAddress, incomingMessage, and incomingMessageLength to the Dispatcher using the receiveMessage ASI πŸš€
statusInformation =
receiveMessage(
IN   transportDomain     -- snmpTLSTCPDomain or snmpDTLSUDPDomain,
IN   transportAddress    -- address for the received message
IN   incomingMessage        -- the whole SNMP message from (D)TLS
IN   incomingMessageLength  -- the length of the SNMP message
IN   tmStateReference    -- transport info
 )

5.2. Procedures for an Outgoing SNMP Message πŸ“€

okay so this is the outgoing side πŸ’Œ the Dispatcher sends a message to the TLS Transport Model using the following ASI, and the whole vibe here is the TLS Transport Model checking everything before it sends anything out πŸ¦‹

statusInformation =
sendMessage(
IN   destTransportDomain           -- transport domain to be used
IN   destTransportAddress          -- transport address to be used
IN   outgoingMessage               -- the message to send
IN   outgoingMessageLength         -- its length
IN   tmStateReference              -- transport info
)

This section describes the procedure the TLS Transport Model follows whenever it's asked, through this ASI, to send a message πŸ’…

  1. If tmStateReference does not refer to a cache containing values for tmTransportDomain, tmTransportAddress, tmSecurityName, tmRequestedSecurityLevel, and tmSameSecurity, then increment the snmpTlstmSessionInvalidCaches counter, discard the message, and return the error indication in the statusInformation. Processing of this message stops πŸ›‘
  2. Extract the tmSessionID, tmTransportDomain, tmTransportAddress, tmSecurityName, tmRequestedSecurityLevel, and tmSameSecurity values from the tmStateReference. Note: the tmSessionID value may be undefined if no session exists yet over which the message can be sent πŸŒ™
  3. If tmSameSecurity is true and tmSessionID is either undefined or refers to a session that is no longer open, then increment the snmpTlstmSessionNoSessions counter, discard the message, and return the error indication in the statusInformation. Processing of this message stops πŸ₯€
  4. If tmSameSecurity is false and tmSessionID refers to a session that is no longer available, then an implementation SHOULD open a new session, using the openSession() ASI (described in greater detail in step 5b). Instead of opening a new session, an implementation MAY return an snmpTlstmSessionNoSessions error to the calling module and stop the processing of the message πŸ”
  5. If tmSessionID is undefined, then use tmTransportDomain, tmTransportAddress, tmSecurityName, and tmRequestedSecurityLevel to see if there's a corresponding entry in the LCD suitable for sending the message over πŸ”
    • 5a) If there is a corresponding LCD entry, then this session will be used to send the message ✨
    • 5b) If there is no corresponding LCD entry, then open a session using the openSession() ASI (discussed further in Section 5.3.1). Implementations MAY wish to offer message buffering to prevent redundant openSession() calls for the same cache entry 🧁 If an error is returned from openSession(), then discard the message, discard the tmStateReference, increment the snmpTlstmSessionOpenErrors, return an error indication to the calling module, and stop the processing of the message 🚫
  6. Using either the session indicated by the tmSessionID (if there was one) or the session resulting from a previous step (4 or 5), pass the outgoingMessage to (D)TLS for encapsulation and transmission πŸŽ€

5.3. Establishing or Accepting a Session 🀝

okay so setting up a (D)TLS connection is kinda different depending on whether you're the client or the server 🌸 Establishing a (D)TLS connection as either a client or a server requires slightly different processing. The next two sections walk through the necessary processing steps for each one πŸ’œ

5.3.1. Establishing a Session as a Client ✨

Okay bestie, the TLS Transport Model gives clients exactly one primitive to spin up a brand new (D)TLS connection πŸ” Here's the openSession() signature:

statusInformation =           -- errorIndication or success
openSession(
IN   tmStateReference         -- transport information to be used
OUT  tmStateReference         -- transport information to be used
IN   maxMessageSize           -- of the sending SNMP entity
)

This is the play-by-play every SNMP client engine follows when it opens an SNMP-over-(D)TLS session for later use πŸ’– It's totally fine (it MAY πŸ’…) for this to happen automatically for an SNMP app that kicks off a transaction, like a command generator, a notification originator, or a proxy forwarder πŸ¦‹

  1. The snmpTlstmSessionOpens counter gets incremented πŸ“ˆ
  2. The client picks the right certificate and cipher_suites for key agreement, based on the tmSecurityName and the tmRequestedSecurityLevel for the session. For sessions started by an SNMP-TARGET-MIB operation, the certificate may already be identified through the snmpTlstmParamsTable mapping, and the cipher_suites have to come from a system-wide or implementation-specific configuration. If there's no row in snmpTlstmParamsTable, implementations MAY choose to connect using a default client certificate the app has. Otherwise, the certificate and the right cipher_suites need to get passed into openSession() as supplemental information, or be configured through an implementation-dependent mechanism. How tmRequestedSecurityLevel shapes the security capabilities of the (D)TLS connection is implementation-dependent and possibly policy-dependent πŸ€” However you get there, the security capabilities provided by (D)TLS MUST be at least as high as the level tmRequestedSecurityLevel asks for πŸ›‘οΈ The actual level is reported in the tmStateReference cache as tmSecurityLevel. For (D)TLS to give strong authentication, each principal acting as a command generator SHOULD have its own certificate πŸ”‘
  3. Using the destTransportDomain and destTransportAddress values, the client starts the (D)TLS handshake to set up session keys for message integrity and encryption 🀝

If the attempt to establish a session fails, then snmpTlstmSessionOpenErrors gets incremented, an error indication comes back, and processing stops πŸ’€ If the session failed to open because the presented server certificate was unknown or invalid, then snmpTlstmSessionUnknownServerCertificate or snmpTlstmSessionInvalidServerCertificates MUST be incremented, and an snmpTlstmServerCertificateUnknown or snmpTlstmServerInvalidCertificate notification SHOULD be sent as appropriate. Reasons for server certificate invalidation include, but are not limited to, cryptographic validation failures and an unexpected presented certificate identity.

  1. The (D)TLS client MUST then verify that the server's presented certificate is the expected one. The (D)TLS client MUST NOT transmit SNMP messages until the server certificate has been authenticated, the client certificate has been transmitted, and the TLS connection has been fully established πŸ™…

If the connection is being set up from SNMP-TARGET-MIB configuration, then the snmpTlstmAddrTable DESCRIPTION clause explains how the verification is done (using either a certificate fingerprint, or an identity authenticated via certification path validation) πŸ“œ

If the connection is being set up for reasons other than SNMP-TARGET-MIB configuration, then configuration and procedures outside the scope of this document should be followed. Configuration mechanisms SHOULD be similar in nature to those defined in the snmpTlstmAddrTable to keep things consistent across management configuration systems 🧩 For example, a command-line tool for generating SNMP GETs might support specifying either the server's certificate fingerprint or the expected host name as a command-line argument ⌨️

  1. (D)TLS provides assurance that the authenticated identity has been signed by a trusted, configured Certification Authority πŸ›οΈ If verification of the server's certificate fails in any way (for example, because of cryptographic verification failures, or because the presented identity didn't match the expected named entity), then the session establishment MUST fail, and the snmpTlstmSessionInvalidServerCertificates object gets incremented. If the session can't be opened for any reason at all, including cryptographic verification failures and snmpTlstmCertToTSNTable lookup failures, then the snmpTlstmSessionOpenErrors counter gets incremented and processing stops 😭
  2. The TLSTM-specific session identifier (tlstmSessionID) gets set in the tmSessionID of the tmStateReference passed to the TLS Transport Model 🎯 This shows the session was established successfully and points to a specific (D)TLS connection for future use. The tlstmSessionID is also stored in the LCD so it can be looked up later when processing incoming messages (Section 5.1.2) πŸ—‚οΈ

5.3.2. Accepting a Session as a Server πŸŽ€

A (D)TLS server should accept new session connections from any client whose credentials it can verify 🧾 That's done by authenticating the client's presented certificate through a certificate path validation process (e.g., [RFC5280]) or through certificate fingerprint verification using fingerprints configured in the snmpTlstmCertToTSNTable. After that, the server works out the identity of the remote entity using the procedures below.

The (D)TLS server figures out the authenticated identity from the (D)TLS client's principal certificate, using configuration information from the snmpTlstmCertToTSNTable mapping table πŸ•΅οΈ The server MUST request and expect a certificate from the client, and it MUST NOT accept SNMP messages over the (D)TLS connection until the client has sent a certificate and it has been authenticated 🚫 The resulting derived tmSecurityName gets recorded in the tmStateReference cache as tmSecurityName. The details of the lookup are fully described in the DESCRIPTION clause of the snmpTlstmCertToTSNTable MIB object πŸ“– If any verification fails in any way (for example, because of cryptographic verification failures, or because there's no appropriate row in the snmpTlstmCertToTSNTable), then the session establishment MUST fail, and the snmpTlstmSessionInvalidClientCertificates object gets incremented. If the session can't be opened for any reason at all, including cryptographic verification failures, then the snmpTlstmSessionOpenErrors counter gets incremented and processing stops.

Servers that want to support multiple principals at a particular port SHOULD use a (D)TLS extension that allows server-side principal selection, like the Server Name Indication extension defined in Section 3.1 of [RFC4366] 🌈 Supporting this lets you do things like send notifications to a specific principal at a given TCP or UDP port πŸ“¬

5.4. Closing a Session

The TLS Transport Model gives you one primitive to close a session πŸšͺ

statusInformation =
closeSession(
IN  tmSessionID        -- session ID of the session to be closed
)

This is the procedure any SNMP engine follows when it closes the matching SNMP session between a client and server πŸ’œ

  1. Increment either the snmpTlstmSessionClientCloses or the snmpTlstmSessionServerCloses counter, whichever is appropriate πŸ”’
  2. Look up the session using the tmSessionID πŸ”
  3. If there's no open session associated with the tmSessionID, then closeSession processing is completed βœ…
  4. Have (D)TLS close the specified connection. This MUST include sending a close_notify TLS Alert to let the other side know that session cleanup may be performed πŸ‘‹

6. MIB Module Overview ✨

This MIB module is all about managing the TLS Transport Model 🧁 It defines the textual conventions, statistical counters, notifications, and configuration infrastructure needed for session establishment. Example usage of the configuration tables can be found in Appendix A πŸ“š

6.1. Structure of the MIB Module

Objects in this MIB module are arranged into subtrees, and each subtree is a set of related objects 🌳 The overall structure, how objects are assigned to their subtrees, and what each subtree is for are laid out below.

6.2. Textual Conventions

Generic and Common Textual Conventions used in this module can be found summarized at http://www.ops.ietf.org/mib-common-tcs.html πŸ”—

This module defines the following new Textual Conventions:

  • A new TransportAddress format for describing (D)TLS connection addressing requirements πŸ“
  • A certificate fingerprint, which lets MIB module objects generically refer to a stored X.509 certificate using a cryptographic hash as a reference pointer πŸͺͺ

6.3. Statistical Counters

The SNMP-TLS-TM-MIB defines counters that give network management stations info about session usage and potential errors a device may be experiencing πŸ“Š

6.4. Configuration Tables

The SNMP-TLS-TM-MIB defines configuration tables that an administrator can use to set up a device for sending and receiving SNMP messages over (D)TLS πŸ› οΈ There are MIB tables that extend the SNMP-TARGET-MIB for configuring (D)TLS certificate usage, and a MIB table for mapping incoming (D)TLS client certificates to SNMPv3 tmSecurityNames πŸ—ΊοΈ

6.4.1. Notifications

The SNMP-TLS-TM-MIB defines notifications that alert management stations when a (D)TLS connection fails because a server's presented certificate didn't meet an expected value (snmpTlstmServerCertificateUnknown), or because cryptographic validation failed (snmpTlstmServerInvalidCertificate) 🚨

6.5. Relationship to Other MIB Modules

Some management objects defined in other MIB modules apply to an entity implementing the TLS Transport Model 🧩 In particular, an entity implementing the SNMP-TLS-TM-MIB is assumed to implement the SNMPv2-MIB [RFC3418], the SNMP-FRAMEWORK-MIB [RFC3411], the SNMP-TARGET-MIB [RFC3413], the SNMP-NOTIFICATION-MIB [RFC3413], and the SNMP-VIEW-BASED-ACM-MIB [RFC3415] πŸ’ž

The SNMP-TLS-TM-MIB module contained in this document is for managing TLS Transport Model information πŸ¦‹

6.5.1. MIB Modules Required for IMPORTS

The SNMP-TLS-TM-MIB module imports items from SNMPv2-SMI [RFC2578], SNMPv2-TC [RFC2579], SNMP-FRAMEWORK-MIB [RFC3411], SNMP-TARGET-MIB [RFC3413], and SNMPv2-CONF [RFC2580] πŸ“₯

7. MIB Module Definition πŸŽ€

SNMP-TLS-TM-MIB DEFINITIONS ::= BEGIN

okay so the actual MIB module is starting to show up here, and the whole thing is giving "carefully engineered" πŸŽ€ every line has to be exact because machines read it, so I kept it verbatim πŸ’…

IMPORTS
    MODULE-IDENTITY, OBJECT-TYPE,
    OBJECT-IDENTITY, mib-2, snmpDomains,
    Counter32, Unsigned32, Gauge32, NOTIFICATION-TYPE
      FROM SNMPv2-SMI                 -- RFC 2578 or any update thereof
    TEXTUAL-CONVENTION, TimeStamp, RowStatus, StorageType,
    AutonomousType
      FROM SNMPv2-TC                  -- RFC 2579 or any update thereof
    MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP
      FROM SNMPv2-CONF                -- RFC 2580 or any update thereof
    SnmpAdminString
      FROM SNMP-FRAMEWORK-MIB         -- RFC 3411 or any update thereof
    snmpTargetParamsName, snmpTargetAddrName
      FROM SNMP-TARGET-MIB            -- RFC 3413 or any update thereof
    ;

snmpTlstmMIB MODULE-IDENTITY
    LAST-UPDATED "201107190000Z"
    ORGANIZATION "ISMS Working Group"
    CONTACT-INFO "WG-EMail:   isms@lists.ietf.org
                  Subscribe:  isms-request@lists.ietf.org

                  Chairs:
                     Juergen Schoenwaelder
                     Jacobs University Bremen
                     Campus Ring 1
                     28725 Bremen
                     Germany
                     +49 421 200-3587
                     j.schoenwaelder@jacobs-university.de

                     Russ Mundy
                     SPARTA, Inc.
                     7110 Samuel Morse Drive
                     Columbia, MD  21046
                     USA

                  Editor:
                     Wes Hardaker
                     SPARTA, Inc.
                     P.O. Box 382
                     Davis, CA  95617
                     USA
                     ietf@hardakers.net
                  "

    DESCRIPTION  "
        The TLS Transport Model MIB

        Copyright (c) 2010-2011 IETF Trust and the persons identified
        as authors of the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject
        to the license terms contained in, the Simplified BSD License
        set forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (http://trustee.ietf.org/license-info)."

       REVISION     "201107190000Z"
       DESCRIPTION  "This version of this MIB module is part of
                     RFC 6353; see the RFC itself for full legal
                     notices.  The only change was to introduce
                     new wording to reflect require changes for
                     IDNA addresses in the SnmpTLSAddress TC."

       REVISION     "201005070000Z"
       DESCRIPTION  "This version of this MIB module is part of
                     RFC 5953; see the RFC itself for full legal
                     notices."

    ::= { mib-2 198 }

-- ************************************************
-- subtrees of the SNMP-TLS-TM-MIB
-- ************************************************

snmpTlstmNotifications OBJECT IDENTIFIER ::= { snmpTlstmMIB 0 }
snmpTlstmIdentities    OBJECT IDENTIFIER ::= { snmpTlstmMIB 1 }
snmpTlstmObjects       OBJECT IDENTIFIER ::= { snmpTlstmMIB 2 }
snmpTlstmConformance   OBJECT IDENTIFIER ::= { snmpTlstmMIB 3 }

-- ************************************************
-- snmpTlstmObjects - Objects
-- ************************************************

snmpTLSTCPDomain OBJECT-IDENTITY
    STATUS      current
    DESCRIPTION
        "The SNMP over TLS via TCP transport domain.  The
        corresponding transport address is of type SnmpTLSAddress.

        The securityName prefix to be associated with the
        snmpTLSTCPDomain is 'tls'.  This prefix may be used by
        security models or other components to identify which secure
        transport infrastructure authenticated a securityName."
    REFERENCE
      "RFC 2579: Textual Conventions for SMIv2"
    ::= { snmpDomains 8 }

snmpDTLSUDPDomain OBJECT-IDENTITY
    STATUS      current
    DESCRIPTION
        "The SNMP over DTLS via UDP transport domain.  The
        corresponding transport address is of type SnmpTLSAddress.

        The securityName prefix to be associated with the
        snmpDTLSUDPDomain is 'dtls'.  This prefix may be used by
        security models or other components to identify which secure
        transport infrastructure authenticated a securityName."
    REFERENCE
      "RFC 2579: Textual Conventions for SMIv2"
    ::= { snmpDomains 9 }

SnmpTLSAddress ::= TEXTUAL-CONVENTION
    DISPLAY-HINT "1a"
    STATUS       current
    DESCRIPTION
        "Represents an IPv4 address, an IPv6 address, or a
         US-ASCII-encoded hostname and port number.

        An IPv4 address must be in dotted decimal format followed by a
        colon ':' (US-ASCII character 0x3A) and a decimal port number
        in US-ASCII.

        An IPv6 address must be a colon-separated format (as described
        in RFC 5952), surrounded by square brackets ('[', US-ASCII
        character 0x5B, and ']', US-ASCII character 0x5D), followed by
        a colon ':' (US-ASCII character 0x3A) and a decimal port number
        in US-ASCII.

        A hostname is always in US-ASCII (as per RFC 1123);
        internationalized hostnames are encoded as A-labels as specified
        in  RFC 5890.  The hostname is followed by a
        colon ':' (US-ASCII character 0x3A) and a decimal port number
        in US-ASCII.  The name SHOULD be fully qualified whenever
        possible.

        Values of this textual convention may not be directly usable
        as transport-layer addressing information, and may require
        run-time resolution.  As such, applications that write them
        must be prepared for handling errors if such values are not
        supported, or cannot be resolved (if resolution occurs at the
        time of the management operation).

        The DESCRIPTION clause of TransportAddress objects that may
        have SnmpTLSAddress values must fully describe how (and
        when) such names are to be resolved to IP addresses and vice
        versa.

        This textual convention SHOULD NOT be used directly in object
        definitions since it restricts addresses to a specific
        format.  However, if it is used, it MAY be used either on its
        own or in conjunction with TransportAddressType or
        TransportDomain as a pair.

        When this textual convention is used as a syntax of an index
        object, there may be issues with the limit of 128
        sub-identifiers specified in SMIv2 (STD 58).  It is RECOMMENDED
        that all MIB documents using this textual convention make
        explicit any limitations on index component lengths that
        management software must observe.  This may be done either by
        including SIZE constraints on the index components or by
        specifying applicable constraints in the conceptual row
        DESCRIPTION clause or in the surrounding documentation."
    REFERENCE
      "RFC 1123: Requirements for Internet Hosts - Application and
                 Support
       RFC 5890: Internationalized Domain Names for Applications (IDNA):
                 Definitions and Document Framework
       RFC 5952: A Recommendation for IPv6 Address Text Representation
      "
    SYNTAX       OCTET STRING (SIZE (1..255))

SnmpTLSFingerprint ::= TEXTUAL-CONVENTION
    DISPLAY-HINT "1x:1x"
    STATUS       current
    DESCRIPTION
       "A fingerprint value that can be used to uniquely reference
       other data of potentially arbitrary length.

       An SnmpTLSFingerprint value is composed of a 1-octet hashing
       algorithm identifier followed by the fingerprint value.  The
       octet value encoded is taken from the IANA TLS HashAlgorithm
       Registry (RFC 5246).  The remaining octets are filled using the
       results of the hashing algorithm.

       This TEXTUAL-CONVENTION allows for a zero-length (blank)
       SnmpTLSFingerprint value for use in tables where the
       fingerprint value may be optional.  MIB definitions or
       implementations may refuse to accept a zero-length value as
       appropriate."
       REFERENCE "RFC 5246: The Transport Layer
                  Security (TLS) Protocol Version 1.2
                  http://www.iana.org/assignments/tls-parameters/
       "
    SYNTAX OCTET STRING (SIZE (0..255))

-- Identities for use in the snmpTlstmCertToTSNTable

snmpTlstmCertToTSNMIdentities OBJECT IDENTIFIER
    ::= { snmpTlstmIdentities 1 }

snmpTlstmCertSpecified OBJECT-IDENTITY
    STATUS        current
    DESCRIPTION  "Directly specifies the tmSecurityName to be used for
                  this certificate.  The value of the tmSecurityName
                  to use is specified in the snmpTlstmCertToTSNData
                  column.  The snmpTlstmCertToTSNData column must
                  contain a non-zero length SnmpAdminString compliant
                  value or the mapping described in this row must be
                  considered a failure."
    ::= { snmpTlstmCertToTSNMIdentities 1 }

snmpTlstmCertSANRFC822Name OBJECT-IDENTITY
    STATUS        current
    DESCRIPTION  "Maps a subjectAltName's rfc822Name to a
                  tmSecurityName.  The local part of the rfc822Name is
                  passed unaltered but the host-part of the name must
                  be passed in lowercase.  This mapping results in a
                  1:1 correspondence between equivalent subjectAltName
                  rfc822Name values and tmSecurityName values except
                  that the host-part of the name MUST be passed in
                  lowercase.

                  Example rfc822Name Field:  FooBar@Example.COM
                  is mapped to tmSecurityName: FooBar@example.com."
    ::= { snmpTlstmCertToTSNMIdentities 2 }

snmpTlstmCertSANDNSName OBJECT-IDENTITY
    STATUS        current
    DESCRIPTION  "Maps a subjectAltName's dNSName to a
                  tmSecurityName after first converting it to all
                  lowercase (RFC 5280 does not specify converting to
                  lowercase so this involves an extra step).  This
                  mapping results in a 1:1 correspondence between
                  subjectAltName dNSName values and the tmSecurityName
                  values."
    REFERENCE "RFC 5280 - Internet X.509 Public Key Infrastructure
                         Certificate and Certificate Revocation
                         List (CRL) Profile."
    ::= { snmpTlstmCertToTSNMIdentities 3 }

snmpTlstmCertSANIpAddress OBJECT-IDENTITY
    STATUS        current
    DESCRIPTION  "Maps a subjectAltName's iPAddress to a
                  tmSecurityName by transforming the binary encoded
                  address as follows:

                  1) for IPv4, the value is converted into a
                     decimal-dotted quad address (e.g., '192.0.2.1').

                  2) for IPv6 addresses, the value is converted into a
                     32-character all lowercase hexadecimal string
                     without any colon separators.

                  This mapping results in a 1:1 correspondence between
                  subjectAltName iPAddress values and the
                  tmSecurityName values.

                  The resulting length of an encoded IPv6 address is
                  the maximum length supported by the View-Based
                  Access Control Model (VACM).  Using both the
                  Transport Security Model's support for transport
                  prefixes (see the SNMP-TSM-MIB's
                  snmpTsmConfigurationUsePrefix object for details)
                  will result in securityName lengths that exceed what
                  VACM can handle."
    ::= { snmpTlstmCertToTSNMIdentities 4 }

okay so picking up right where we left off πŸ’… the SAN-any one is basically the catch-all of the bunch 🧚

snmpTlstmCertSANAny OBJECT-IDENTITY
    STATUS        current
    DESCRIPTION  "Maps any of the following fields using the
                  corresponding mapping algorithms:

                  |------------+----------------------------|
                  | Type       | Algorithm                  |
                  |------------+----------------------------|
                  | rfc822Name | snmpTlstmCertSANRFC822Name |
                  | dNSName    | snmpTlstmCertSANDNSName    |
                  | iPAddress  | snmpTlstmCertSANIpAddress  |
                  |------------+----------------------------|

                  The first matching subjectAltName value found in the
                  certificate of the above types MUST be used when
                  deriving the tmSecurityName.  The mapping algorithm
                  specified in the 'Algorithm' column MUST be used to
                  derive the tmSecurityName.

                  This mapping results in a 1:1 correspondence between
                  subjectAltName values and tmSecurityName values.  The
                  three sub-mapping algorithms produced by this
                  combined algorithm cannot produce conflicting
                  results between themselves."
    ::= { snmpTlstmCertToTSNMIdentities 5 }

snmpTlstmCertCommonName OBJECT-IDENTITY
    STATUS        current

    DESCRIPTION  "Maps a certificate's CommonName to a tmSecurityName
                  after converting it to a UTF-8 encoding.  The usage
                  of CommonNames is deprecated and users are
                  encouraged to use subjectAltName mapping methods
                  instead.  This mapping results in a 1:1
                  correspondence between certificate CommonName values
                  and tmSecurityName values."
    ::= { snmpTlstmCertToTSNMIdentities 6 }

ngl the CommonName one is giving "old but still in the group chat" πŸ™ˆ it's still around, but the people in charge really want you on the subjectAltName methods instead πŸ’–

Next up is the session group πŸ¦‹ these are all counters, so think of them as little tally marks for how every (D)TLS session has been going:

-- The snmpTlstmSession Group

snmpTlstmSession           OBJECT IDENTIFIER ::= { snmpTlstmObjects 1 }

snmpTlstmSessionOpens  OBJECT-TYPE
    SYNTAX       Counter32
    MAX-ACCESS   read-only
    STATUS       current
    DESCRIPTION
       "The number of times an openSession() request has been executed
       as a (D)TLS client, regardless of whether it succeeded or
       failed."
    ::= { snmpTlstmSession 1 }

snmpTlstmSessionClientCloses  OBJECT-TYPE
    SYNTAX       Counter32
    MAX-ACCESS   read-only
    STATUS       current
    DESCRIPTION
        "The number of times a closeSession() request has been
        executed as a (D)TLS client, regardless of whether it
        succeeded or failed."
    ::= { snmpTlstmSession 2 }

snmpTlstmSessionOpenErrors  OBJECT-TYPE
    SYNTAX       Counter32
    MAX-ACCESS   read-only
    STATUS       current
    DESCRIPTION
        "The number of times an openSession() request failed to open a
        session as a (D)TLS client, for any reason."
    ::= { snmpTlstmSession 3 }

snmpTlstmSessionAccepts  OBJECT-TYPE
    SYNTAX       Counter32
    MAX-ACCESS   read-only
    STATUS       current
    DESCRIPTION
       "The number of times a (D)TLS server has accepted a new
       connection from a client and has received at least one SNMP
       message through it."
    ::= { snmpTlstmSession 4 }

snmpTlstmSessionServerCloses  OBJECT-TYPE
    SYNTAX       Counter32
    MAX-ACCESS   read-only
    STATUS       current
    DESCRIPTION
        "The number of times a closeSession() request has been
        executed as a (D)TLS server, regardless of whether it
        succeeded or failed."
    ::= { snmpTlstmSession 5 }

snmpTlstmSessionNoSessions  OBJECT-TYPE
    SYNTAX       Counter32
    MAX-ACCESS   read-only
    STATUS       current
    DESCRIPTION
        "The number of times an outgoing message was dropped because
        the session associated with the passed tmStateReference was no
        longer (or was never) available."
    ::= { snmpTlstmSession 6 }

snmpTlstmSessionInvalidClientCertificates OBJECT-TYPE
    SYNTAX       Counter32
    MAX-ACCESS   read-only
    STATUS       current
    DESCRIPTION
        "The number of times an incoming session was not established
        on a (D)TLS server because the presented client certificate
        was invalid.  Reasons for invalidation include, but are not
        limited to, cryptographic validation failures or lack of a
        suitable mapping row in the snmpTlstmCertToTSNTable."
    ::= { snmpTlstmSession 7 }

snmpTlstmSessionUnknownServerCertificate OBJECT-TYPE
    SYNTAX       Counter32
    MAX-ACCESS   read-only
    STATUS       current
    DESCRIPTION
        "The number of times an outgoing session was not established
         on a (D)TLS client because the server certificate presented
         by an SNMP over (D)TLS server was invalid because no
         configured fingerprint or Certification Authority (CA) was
         acceptable to validate it.
         This may result because there was no entry in the
         snmpTlstmAddrTable or because no path could be found to a
         known CA."
    ::= { snmpTlstmSession 8 }

snmpTlstmSessionInvalidServerCertificates OBJECT-TYPE
    SYNTAX       Counter32
    MAX-ACCESS   read-only
    STATUS       current
    DESCRIPTION
        "The number of times an outgoing session was not established
         on a (D)TLS client because the server certificate presented
         by an SNMP over (D)TLS server could not be validated even if
         the fingerprint or expected validation path was known.  That
         is, a cryptographic validation error occurred during
         certificate validation processing.

        Reasons for invalidation include, but are not
        limited to, cryptographic validation failures."
    ::= { snmpTlstmSession 9 }

snmpTlstmSessionInvalidCaches OBJECT-TYPE
    SYNTAX       Counter32
    MAX-ACCESS   read-only
    STATUS       current
    DESCRIPTION
        "The number of outgoing messages dropped because the
        tmStateReference referred to an invalid cache."
    ::= { snmpTlstmSession 10 }

okay the server-vs-client split in these is literally the whole vibe 🫢 the same kind of "didn't work" gets its own tally depending on which side of the connection you're on πŸ‘‘

Now the configuration objects 🌸 this part is where the certificate-to-name mapping lives, and the table is the main event ✨

-- Configuration Objects

snmpTlstmConfig             OBJECT IDENTIFIER ::= { snmpTlstmObjects 2 }

-- Certificate mapping

snmpTlstmCertificateMapping OBJECT IDENTIFIER ::= { snmpTlstmConfig 1 }

snmpTlstmCertToTSNCount OBJECT-TYPE
    SYNTAX      Gauge32
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "A count of the number of entries in the
        snmpTlstmCertToTSNTable."
    ::= { snmpTlstmCertificateMapping 1 }

snmpTlstmCertToTSNTableLastChanged OBJECT-TYPE
    SYNTAX      TimeStamp
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The value of sysUpTime.0 when the snmpTlstmCertToTSNTable was
        last modified through any means, or 0 if it has not been
        modified since the command responder was started."
    ::= { snmpTlstmCertificateMapping 2 }

snmpTlstmCertToTSNTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF SnmpTlstmCertToTSNEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "This table is used by a (D)TLS server to map the (D)TLS
        client's presented X.509 certificate to a tmSecurityName.

        On an incoming (D)TLS/SNMP connection, the client's presented
        certificate must either be validated based on an established
        trust anchor, or it must directly match a fingerprint in this
        table.  This table does not provide any mechanisms for
        configuring the trust anchors; the transfer of any needed
        trusted certificates for path validation is expected to occur
        through an out-of-band transfer.

        Once the certificate has been found acceptable (either by path
        validation or directly matching a fingerprint in this table),
        this table is consulted to determine the appropriate
        tmSecurityName to identify with the remote connection.  This
        is done by considering each active row from this table in
        prioritized order according to its snmpTlstmCertToTSNID value.
        Each row's snmpTlstmCertToTSNFingerprint value determines
        whether the row is a match for the incoming connection:

            1) If the row's snmpTlstmCertToTSNFingerprint value
               identifies the presented certificate, then consider the
               row as a successful match.

            2) If the row's snmpTlstmCertToTSNFingerprint value
               identifies a locally held copy of a trusted CA
               certificate and that CA certificate was used to
               validate the path to the presented certificate, then
               consider the row as a successful match.

        Once a matching row has been found, the
        snmpTlstmCertToTSNMapType value can be used to determine how
        the tmSecurityName to associate with the session should be
        determined.  See the snmpTlstmCertToTSNMapType column's
        DESCRIPTION for details on determining the tmSecurityName
        value.  If it is impossible to determine a tmSecurityName from
        the row's data combined with the data presented in the
        certificate, then additional rows MUST be searched looking for
        another potential match.  If a resulting tmSecurityName mapped
        from a given row is not compatible with the needed
        requirements of a tmSecurityName (e.g., VACM imposes a
        32-octet-maximum length and the certificate derived
        securityName could be longer), then it must be considered an
        invalid match and additional rows MUST be searched looking for
        another potential match.

        If no matching and valid row can be found, the connection MUST
        be closed and SNMP messages MUST NOT be accepted over it.

        Missing values of snmpTlstmCertToTSNID are acceptable and
        implementations should continue to the next highest numbered
        row.  It is recommended that administrators skip index values
        to leave room for the insertion of future rows (for example,
        use values of 10 and 20 when creating initial rows).

        Users are encouraged to make use of certificates with
        subjectAltName fields that can be used as tmSecurityNames so
        that a single root CA certificate can allow all child
        certificate's subjectAltName to map directly to a
        tmSecurityName via a 1:1 transformation.  However, this table
        is flexible to allow for situations where existing deployed
        certificate infrastructures do not provide adequate
        subjectAltName values for use as tmSecurityNames.
        Certificates may also be mapped to tmSecurityNames using the
        CommonName portion of the Subject field.  However, the usage
        of the CommonName field is deprecated and thus this usage is
        NOT RECOMMENDED.  Direct mapping from each individual
        certificate fingerprint to a tmSecurityName is also possible
        but requires one entry in the table per tmSecurityName and
        requires more management operations to completely configure a
        device."
    ::= { snmpTlstmCertificateMapping 3 }

snmpTlstmCertToTSNEntry OBJECT-TYPE
    SYNTAX      SnmpTlstmCertToTSNEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A row in the snmpTlstmCertToTSNTable that specifies a mapping
        for an incoming (D)TLS certificate to a tmSecurityName to use
        for a connection."
    INDEX   { snmpTlstmCertToTSNID }
    ::= { snmpTlstmCertToTSNTable 1 }

SnmpTlstmCertToTSNEntry ::= SEQUENCE {
    snmpTlstmCertToTSNID           Unsigned32,
    snmpTlstmCertToTSNFingerprint  SnmpTLSFingerprint,
    snmpTlstmCertToTSNMapType      AutonomousType,
    snmpTlstmCertToTSNData         OCTET STRING,
    snmpTlstmCertToTSNStorageType  StorageType,
    snmpTlstmCertToTSNRowStatus    RowStatus
}
the table is basically a priority list, bestie πŸŽ€ rows get checked in order by their ID, so skipping numbers (like 10 and 20) leaves you room to slide new rows in later πŸ“

and yes the matching rules are super particular, so the fingerprint check is the first gatekeeper and then the mapping has to actually work too πŸ˜­πŸ¦‹

okay bestie, this is where the cert-to-name table gets its columns, and they are giving main character energy πŸ’…πŸŽ€

snmpTlstmCertToTSNID OBJECT-TYPE
    SYNTAX      Unsigned32 (1..4294967295)
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A unique, prioritized index for the given entry.  Lower
        numbers indicate a higher priority."
    ::= { snmpTlstmCertToTSNEntry 1 }

snmpTlstmCertToTSNFingerprint OBJECT-TYPE
    SYNTAX      SnmpTLSFingerprint (SIZE(1..255))
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "A cryptographic hash of an X.509 certificate.  The results of
        a successful matching fingerprint to either the trusted CA in
        the certificate validation path or to the certificate itself
        is dictated by the snmpTlstmCertToTSNMapType column."
    ::= { snmpTlstmCertToTSNEntry 2 }

snmpTlstmCertToTSNMapType OBJECT-TYPE
    SYNTAX      AutonomousType
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "Specifies the mapping type for deriving a tmSecurityName from
        a certificate.  Details for mapping of a particular type SHALL
        be specified in the DESCRIPTION clause of the OBJECT-IDENTITY
        that describes the mapping.  If a mapping succeeds it will
        return a tmSecurityName for use by the TLSTM model and
        processing stops.

        If the resulting mapped value is not compatible with the
        needed requirements of a tmSecurityName (e.g., VACM imposes a
        32-octet-maximum length and the certificate derived
        securityName could be longer), then future rows MUST be
        searched for additional snmpTlstmCertToTSNFingerprint matches
        to look for a mapping that succeeds.

        Suitable values for assigning to this object that are defined
        within the SNMP-TLS-TM-MIB can be found in the
        snmpTlstmCertToTSNMIdentities portion of the MIB tree."
    DEFVAL { snmpTlstmCertSpecified }
    ::= { snmpTlstmCertToTSNEntry 3 }

snmpTlstmCertToTSNData OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE(0..1024))
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "Auxiliary data used as optional configuration information for
        a given mapping specified by the snmpTlstmCertToTSNMapType
        column.  Only some mapping systems will make use of this
        column.  The value in this column MUST be ignored for any
        mapping type that does not require data present in this
        column."
    DEFVAL { "" }
    ::= { snmpTlstmCertToTSNEntry 4 }

snmpTlstmCertToTSNStorageType OBJECT-TYPE
    SYNTAX       StorageType
    MAX-ACCESS   read-create
    STATUS       current
    DESCRIPTION
        "The storage type for this conceptual row.  Conceptual rows
        having the value 'permanent' need not allow write-access to
        any columnar objects in the row."
    DEFVAL      { nonVolatile }
    ::= { snmpTlstmCertToTSNEntry 5 }

snmpTlstmCertToTSNRowStatus OBJECT-TYPE
    SYNTAX      RowStatus
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "The status of this conceptual row.  This object may be used
        to create or remove rows from this table.

        To create a row in this table, an administrator must set this
        object to either createAndGo(4) or createAndWait(5).

        Until instances of all corresponding columns are appropriately
        configured, the value of the corresponding instance of the
        snmpTlstmParamsRowStatus column is notReady(3).

        In particular, a newly created row cannot be made active until
        the corresponding snmpTlstmCertToTSNFingerprint,
        snmpTlstmCertToTSNMapType, and snmpTlstmCertToTSNData columns
        have been set.

        The following objects may not be modified while the
        value of this object is active(1):
            - snmpTlstmCertToTSNFingerprint
            - snmpTlstmCertToTSNMapType
            - snmpTlstmCertToTSNData
        An attempt to set these objects while the value of
        snmpTlstmParamsRowStatus is active(1) will result in
        an inconsistentValue error."
    ::= { snmpTlstmCertToTSNEntry 6 }

Next up is the params table, which maps tmSecurityNames to certificates for the SNMP-TARGET-MIB πŸ§šπŸ’œ

-- Maps tmSecurityNames to certificates for use by the SNMP-TARGET-MIB

snmpTlstmParamsCount OBJECT-TYPE
    SYNTAX      Gauge32
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "A count of the number of entries in the snmpTlstmParamsTable."
    ::= { snmpTlstmCertificateMapping 4 }

snmpTlstmParamsTableLastChanged OBJECT-TYPE
    SYNTAX      TimeStamp
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The value of sysUpTime.0 when the snmpTlstmParamsTable
        was last modified through any means, or 0 if it has not been
        modified since the command responder was started."
    ::= { snmpTlstmCertificateMapping 5 }

snmpTlstmParamsTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF SnmpTlstmParamsEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "This table is used by a (D)TLS client when a (D)TLS
        connection is being set up using an entry in the
        SNMP-TARGET-MIB.  It extends the SNMP-TARGET-MIB's
        snmpTargetParamsTable with a fingerprint of a certificate to
        use when establishing such a (D)TLS connection."
    ::= { snmpTlstmCertificateMapping 6 }

snmpTlstmParamsEntry OBJECT-TYPE
    SYNTAX      SnmpTlstmParamsEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A conceptual row containing a fingerprint hash of a locally
        held certificate for a given snmpTargetParamsEntry.  The
        values in this row should be ignored if the connection that
        needs to be established, as indicated by the SNMP-TARGET-MIB
        infrastructure, is not a certificate and (D)TLS based
        connection.  The connection SHOULD NOT be established if the
        certificate fingerprint stored in this entry does not point to
        a valid locally held certificate or if it points to an
        unusable certificate (such as might happen when the
        certificate's expiration date has been reached)."
    INDEX    { IMPLIED snmpTargetParamsName }
    ::= { snmpTlstmParamsTable 1 }

SnmpTlstmParamsEntry ::= SEQUENCE {
    snmpTlstmParamsClientFingerprint SnmpTLSFingerprint,
    snmpTlstmParamsStorageType       StorageType,
    snmpTlstmParamsRowStatus         RowStatus
}

snmpTlstmParamsClientFingerprint OBJECT-TYPE
    SYNTAX      SnmpTLSFingerprint
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "This object stores the hash of the public portion of a
        locally held X.509 certificate.  The X.509 certificate, its
        public key, and the corresponding private key will be used
        when initiating a (D)TLS connection as a (D)TLS client."
    ::= { snmpTlstmParamsEntry 1 }

snmpTlstmParamsStorageType OBJECT-TYPE
    SYNTAX       StorageType
    MAX-ACCESS   read-create
    STATUS       current
    DESCRIPTION
        "The storage type for this conceptual row.  Conceptual rows
        having the value 'permanent' need not allow write-access to
        any columnar objects in the row."
    DEFVAL      { nonVolatile }
    ::= { snmpTlstmParamsEntry 2 }

snmpTlstmParamsRowStatus OBJECT-TYPE
    SYNTAX      RowStatus
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION

        "The status of this conceptual row.  This object may be used
        to create or remove rows from this table.

        To create a row in this table, an administrator must set this
        object to either createAndGo(4) or createAndWait(5).

        Until instances of all corresponding columns are appropriately
        configured, the value of the corresponding instance of the
        snmpTlstmParamsRowStatus column is notReady(3).

        In particular, a newly created row cannot be made active until
        the corresponding snmpTlstmParamsClientFingerprint column has
        been set.

        The snmpTlstmParamsClientFingerprint object may not be modified
        while the value of this object is active(1).

        An attempt to set these objects while the value of
        snmpTlstmParamsRowStatus is active(1) will result in
        an inconsistentValue error."
    ::= { snmpTlstmParamsEntry 3 }

Last stop for this part is the address table, which is where the server gets checked to make sure it's the right one πŸ‘‘πŸŒˆ

snmpTlstmAddrCount OBJECT-TYPE
    SYNTAX      Gauge32
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "A count of the number of entries in the snmpTlstmAddrTable."
    ::= { snmpTlstmCertificateMapping 7 }

snmpTlstmAddrTableLastChanged OBJECT-TYPE
    SYNTAX      TimeStamp
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The value of sysUpTime.0 when the snmpTlstmAddrTable
        was last modified through any means, or 0 if it has not been
        modified since the command responder was started."
    ::= { snmpTlstmCertificateMapping 8 }

snmpTlstmAddrTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF SnmpTlstmAddrEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "This table is used by a (D)TLS client when a (D)TLS
        connection is being set up using an entry in the
        SNMP-TARGET-MIB.  It extends the SNMP-TARGET-MIB's
        snmpTargetAddrTable so that the client can verify that the
        correct server has been reached.  This verification can use
        either a certificate fingerprint, or an identity
        authenticated via certification path validation.

        If there is an active row in this table corresponding to the
        entry in the SNMP-TARGET-MIB that was used to establish the
        connection, and the row's snmpTlstmAddrServerFingerprint
        column has non-empty value, then the server's presented
        certificate is compared with the
        snmpTlstmAddrServerFingerprint value (and the
        snmpTlstmAddrServerIdentity column is ignored).  If the
        fingerprint matches, the verification has succeeded.  If the
        fingerprint does not match, then the connection MUST be
        closed.

        If the server's presented certificate has passed
        certification path validation [RFC5280] to a configured
        trust anchor, and an active row exists with a zero-length
        snmpTlstmAddrServerFingerprint value, then the
        snmpTlstmAddrServerIdentity column contains the expected
        host name.  This expected host name is then compared against
        the server's certificate as follows:

          - Implementations MUST support matching the expected host
          name against a dNSName in the subjectAltName extension
          field and MAY support checking the name against the
          CommonName portion of the subject distinguished name.

          - The '*' (ASCII 0x2a) wildcard character is allowed in the
          dNSName of the subjectAltName extension (and in common
          name, if used to store the host name), but only as the
          left-most (least significant) DNS label in that value.
          This wildcard matches any left-most DNS label in the
          server name.  That is, the subject *.example.com matches
          the server names a.example.com and b.example.com, but does
          not match example.com or a.b.example.com.  Implementations
          MUST support wildcards in certificates as specified above,
          but MAY provide a configuration option to disable them.

          - If the locally configured name is an internationalized
          domain name, conforming implementations MUST convert it to
          the ASCII Compatible Encoding (ACE) format for performing
          comparisons, as specified in Section 7 of [RFC5280].

        If the expected host name fails these conditions then the
        connection MUST be closed.

        If there is no row in this table corresponding to the entry
        in the SNMP-TARGET-MIB and the server can be authorized by
        another, implementation-dependent means, then the connection
        MAY still proceed."

    ::= { snmpTlstmCertificateMapping 9 }
snmpTlstmAddrEntry OBJECT-TYPE
    SYNTAX      SnmpTlstmAddrEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A conceptual row containing a copy of a certificate's
        fingerprint for a given snmpTargetAddrEntry.  The values in
        this row should be ignored if the connection that needs to be
        established, as indicated by the SNMP-TARGET-MIB
        infrastructure, is not a (D)TLS based connection.  If an
        snmpTlstmAddrEntry exists for a given snmpTargetAddrEntry, then
        the presented server certificate MUST match or the connection
        MUST NOT be established.  If a row in this table does not
        exist to match an snmpTargetAddrEntry row, then the connection
        SHOULD still proceed if some other certificate validation path
        algorithm (e.g., RFC 5280) can be used."
    INDEX    { IMPLIED snmpTargetAddrName }
    ::= { snmpTlstmAddrTable 1 }

SnmpTlstmAddrEntry ::= SEQUENCE {
    snmpTlstmAddrServerFingerprint    SnmpTLSFingerprint,
    snmpTlstmAddrServerIdentity       SnmpAdminString,
    snmpTlstmAddrStorageType          StorageType,
    snmpTlstmAddrRowStatus            RowStatus
}

snmpTlstmAddrServerFingerprint OBJECT-TYPE
    SYNTAX      SnmpTLSFingerprint
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "A cryptographic hash of a public X.509 certificate.  This
        object should store the hash of the public X.509 certificate
        that the remote server should present during the (D)TLS
        connection setup.  The fingerprint of the presented
        certificate and this hash value MUST match exactly or the
        connection MUST NOT be established."
    DEFVAL { "" }
    ::= { snmpTlstmAddrEntry 1 }

snmpTlstmAddrServerIdentity OBJECT-TYPE
    SYNTAX      SnmpAdminString
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "The reference identity to check against the identity
        presented by the remote system."
    DEFVAL { "" }
    ::= { snmpTlstmAddrEntry 2 }

snmpTlstmAddrStorageType OBJECT-TYPE
    SYNTAX       StorageType
    MAX-ACCESS   read-create
    STATUS       current
    DESCRIPTION
        "The storage type for this conceptual row.  Conceptual rows
        having the value 'permanent' need not allow write-access to
        any columnar objects in the row."
    DEFVAL      { nonVolatile }
    ::= { snmpTlstmAddrEntry 3 }


snmpTlstmAddrRowStatus OBJECT-TYPE
    SYNTAX      RowStatus
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "The status of this conceptual row.  This object may be used
        to create or remove rows from this table.

        To create a row in this table, an administrator must set this
        object to either createAndGo(4) or createAndWait(5).

        Until instances of all corresponding columns are
        appropriately configured, the value of the
        corresponding instance of the snmpTlstmAddrRowStatus
        column is notReady(3).

        In particular, a newly created row cannot be made active until
        the corresponding snmpTlstmAddrServerFingerprint column has been
        set.

        Rows MUST NOT be active if the snmpTlstmAddrServerFingerprint
        column is blank and the snmpTlstmAddrServerIdentity is set to
        '*' since this would insecurely accept any presented
        certificate.

        The snmpTlstmAddrServerFingerprint object may not be modified
        while the value of this object is active(1).

        An attempt to set these objects while the value of
        snmpTlstmAddrRowStatus is active(1) will result in
        an inconsistentValue error."
    ::= { snmpTlstmAddrEntry 4 }

-- ************************************************
--  snmpTlstmNotifications - Notifications Information
-- ************************************************

snmpTlstmServerCertificateUnknown NOTIFICATION-TYPE
    OBJECTS { snmpTlstmSessionUnknownServerCertificate }
    STATUS  current
    DESCRIPTION
        "Notification that the server certificate presented by an SNMP
         over (D)TLS server was invalid because no configured
         fingerprint or CA was acceptable to validate it.  This may be
         because there was no entry in the snmpTlstmAddrTable or
         because no path could be found to known Certification
         Authority.

         To avoid notification loops, this notification MUST NOT be
         sent to servers that themselves have triggered the
         notification."
    ::= { snmpTlstmNotifications 1 }

snmpTlstmServerInvalidCertificate NOTIFICATION-TYPE
    OBJECTS { snmpTlstmAddrServerFingerprint,
              snmpTlstmSessionInvalidServerCertificates}
    STATUS  current
    DESCRIPTION
        "Notification that the server certificate presented by an SNMP
         over (D)TLS server could not be validated even if the
         fingerprint or expected validation path was known.  That is, a
         cryptographic validation error occurred during certificate
         validation processing.

         To avoid notification loops, this notification MUST NOT be
         sent to servers that themselves have triggered the
         notification."
    ::= { snmpTlstmNotifications 2 }

-- ************************************************
-- snmpTlstmCompliances - Conformance Information
-- ************************************************
snmpTlstmCompliances OBJECT IDENTIFIER ::= { snmpTlstmConformance 1 }

snmpTlstmGroups OBJECT IDENTIFIER ::= { snmpTlstmConformance 2 }

-- ************************************************
-- Compliance statements
-- ************************************************

snmpTlstmCompliance MODULE-COMPLIANCE
    STATUS      current
    DESCRIPTION
        "The compliance statement for SNMP engines that support the
        SNMP-TLS-TM-MIB"
    MODULE
        MANDATORY-GROUPS { snmpTlstmStatsGroup,
                           snmpTlstmIncomingGroup,
                           snmpTlstmOutgoingGroup,
                           snmpTlstmNotificationGroup }
    ::= { snmpTlstmCompliances 1 }

-- ************************************************
-- Units of conformance
-- ************************************************
snmpTlstmStatsGroup OBJECT-GROUP
    OBJECTS {
        snmpTlstmSessionOpens,
        snmpTlstmSessionClientCloses,
        snmpTlstmSessionOpenErrors,
        snmpTlstmSessionAccepts,
        snmpTlstmSessionServerCloses,
        snmpTlstmSessionNoSessions,
        snmpTlstmSessionInvalidClientCertificates,
        snmpTlstmSessionUnknownServerCertificate,
        snmpTlstmSessionInvalidServerCertificates,
        snmpTlstmSessionInvalidCaches
    }
    STATUS      current
    DESCRIPTION
        "A collection of objects for maintaining
        statistical information of an SNMP engine that
        implements the SNMP TLS Transport Model."
    ::= { snmpTlstmGroups 1 }

snmpTlstmIncomingGroup OBJECT-GROUP
    OBJECTS {
        snmpTlstmCertToTSNCount,
        snmpTlstmCertToTSNTableLastChanged,
        snmpTlstmCertToTSNFingerprint,
        snmpTlstmCertToTSNMapType,
        snmpTlstmCertToTSNData,
        snmpTlstmCertToTSNStorageType,
        snmpTlstmCertToTSNRowStatus
    }
    STATUS      current
    DESCRIPTION
        "A collection of objects for maintaining
        incoming connection certificate mappings to
        tmSecurityNames of an SNMP engine that implements the
        SNMP TLS Transport Model."
    ::= { snmpTlstmGroups 2 }

snmpTlstmOutgoingGroup OBJECT-GROUP
    OBJECTS {
        snmpTlstmParamsCount,
        snmpTlstmParamsTableLastChanged,
        snmpTlstmParamsClientFingerprint,
        snmpTlstmParamsStorageType,
        snmpTlstmParamsRowStatus,
        snmpTlstmAddrCount,
        snmpTlstmAddrTableLastChanged,
        snmpTlstmAddrServerFingerprint,
        snmpTlstmAddrServerIdentity,
        snmpTlstmAddrStorageType,
        snmpTlstmAddrRowStatus
    }
    STATUS      current
    DESCRIPTION
        "A collection of objects for maintaining
        outgoing connection certificates to use when opening
        connections as a result of SNMP-TARGET-MIB settings."
    ::= { snmpTlstmGroups 3 }

snmpTlstmNotificationGroup NOTIFICATION-GROUP
    NOTIFICATIONS {
        snmpTlstmServerCertificateUnknown,
        snmpTlstmServerInvalidCertificate
    }
    STATUS current
    DESCRIPTION
        "Notifications"
    ::= { snmpTlstmGroups 4 }

END

8. Operational Considerations ✨

okay bestie, this section is all about what it's like to actually run TLSTM out in the real world πŸŒπŸ’… it talks about the different operational sides of deploying it, so buckle up πŸŽ€

8.1. Sessions πŸ¦‹

so a session is basically a security association between two TLSTM instances 🀝 every TLSTM implementation keeps state info for its sessions, and that info gets created and destroyed as sessions open and close πŸ’– a "broken" session is when one side is still up but the other side is down πŸ’€ this can happen if one side goes down abruptly, like a reboot or a power outage ⚑ so whenever it's possible, implementations SHOULD provide graceful session termination by using TLS disconnect messages 🫢 implementations SHOULD also have a system for spotting "broken" sessions, using heartbeats [HEARTBEAT] or some other detection mechanism πŸ‘€

and then there's the lifetime thing πŸ•°οΈ implementations SHOULD limit how long established sessions last, depending on the algorithms used to generate the master session secret, the privacy and integrity algorithms protecting messages, the environment of the session, how much data gets transferred, and how sensitive the data is πŸ” it's giving careful planning, periodt πŸ’…

8.2. Notification Receiver Credential Selection πŸŽ€

okay so when an SNMP engine needs to set up an outgoing session for notifications, the snmpTargetParamsTable has an entry for the target's snmpTargetParamsSecurityName πŸ“‹ servers that want to support multiple principals on one port SHOULD use the Server Name Indication extension from Section 3.1 of [RFC4366] 🌸 without SNI, the receiving SNMP engine (the server) won't know which (D)TLS certificate to offer the client, so the tmSecurityName identity authentication won't succeed 😭

another option is keeping a one-to-one mapping between certificates and incoming ports for notification receivers 🧚 the notification originator can handle this by configuring the snmpTargetAddrTable (snmpTargetAddrTDomain and snmpTargetAddrTAddress), and the receiving SNMP engine has to monitor multiple incoming static ports based on which principals can receive notifications πŸ“

last but not least, implementations MAY also pick a single Notification Receiver Principal to receive all incoming notifications, or choose an implementation-specific way of selecting which server certificate to present to clients πŸ‘‘

8.3. contextEngineID Discovery πŸ’œ

so SNMPv3 needs an application to know the identifier (snmpEngineID) of the remote SNMP protocol engine if it wants to retrieve or manipulate objects on that remote SNMP entity 🧐

[RFC5343] brings in a well-known localEngineID and a discovery mechanism that lets you learn a remote SNMP protocol engine's snmpEngineID 🌈 implementations are RECOMMENDED to support and use the contextEngineID discovery mechanism defined in [RFC5343] ✨ main character energy, no cap 🫢

8.4. Transport Considerations πŸš—

Okay so this doc is all about how SNMP rides over TLS and DTLS, but those two are built on top of other transports, TCP and UDP 🫢 Those base protocols have their own operational stuff that you literally must take into consideration when you pick a (D)TLS-based protocol, like how it performs on degraded or limited networks. Summarising all of that here is out of scope, so bestie, go check the base protocol documents for the details on MTU size, fragmentation, performance in lossy networks, and so on 🌸

9. Security Considerations πŸ”

Okay this section is SERIOUS but also kind of iconic, so let's go πŸ’… This doc describes a transport model that lets SNMP use (D)TLS security services. The security threats, and how the (D)TLS transport model mitigates them, are covered in detail all throughout this document ✨ Security considerations for DTLS are in [RFC4347], and security considerations for TLS are described in Section 11 and Appendices D, E, and F of TLS 1.2 [RFC5246]. When it runs over a connectionless transport like UDP, DTLS is more vulnerable to denial-of-service attacks from spoofed IP addresses 😭 Check Section 4.2 for how the cookie exchange is used to deal with this issue.

9.1. Certificates, Authentication, and Authorization πŸŽ€

Implementations are responsible for providing a security certificate installation and configuration mechanism. Implementations SHOULD support certificate revocation lists πŸ”₯

(D)TLS provides for authentication of the identity of both the (D)TLS server and the (D)TLS client 🫢 Access to MIB objects for the authenticated principal MUST be enforced by an access control subsystem (e.g., the VACM). No skipping this part, periodt πŸ’€

Authentication of the command generator principal's identity matters a LOT when you're using the SNMP access control subsystem, because it makes sure only authorized principals can reach potentially sensitive data πŸ‘‘ The authenticated identity from the command generator principal's certificate gets mapped to an SNMP model-independent securityName for use with SNMP access control.

Here's the tea 🍡 The (D)TLS handshake only proves the certificate of the authenticated identity was signed by a configured accepted Certification Authority. (D)TLS has no way to further authorize or reject access based on that identity, so an Access Control Model (such as the VACM) handles access control and authorization of a command generator's requests to a command responder, and a notification receiver's authorization to receive Notifications from a notification originator. BUT, to avoid man-in-the-middle attacks, both ends of the (D)TLS-based connection MUST check the certificate the other side presents against what was expected πŸ™ˆ For example, command generators must check that the command responder presented and authenticated itself with an X.509 certificate that was expected. If they don't, an impostor could, at a minimum, present false data, receive sensitive information, and/or make you believe configuration was actually received and acted upon. Authenticating and verifying the identity of the (D)TLS server and the (D)TLS client for all operations is what keeps the SNMP engine providing MIB data authentic πŸ¦‹

The instructions in the DESCRIPTION clause of the snmpTlstmCertToTSNTable object must be followed exactly. It's also important that the rows of the table get searched in prioritized order, starting with the row that has the lowest numbered snmpTlstmCertToTSNID value 🧚

9.2. (D)TLS Security Considerations 🌈

This section talks about security considerations that are specific to using (D)TLS πŸ’–

9.2.1. TLS Version Requirements πŸ“œ

Implementations of TLS typically support multiple versions of the Transport Layer Security protocol, plus the older Secure Sockets Layer (SSL) protocol. Because of known security vulnerabilities, TLSTM clients and servers MUST NOT request, offer, or use SSL 2.0 🚫 See Appendix E.2 of [RFC5246] for the full details.

9.2.2. Perfect Forward Secrecy ✨

Using Perfect Forward Secrecy is RECOMMENDED πŸ” (D)TLS can provide it with appropriately selected cipher_suites, as discussed in Appendix F of [RFC5246].

9.3. Use with SNMPv1/SNMPv2c Messages πŸ“¨

The SNMPv1 and SNMPv2c message processing described in [RFC3584] (BCP 74) always selects the SNMPv1 or SNMPv2c Security Models, respectively. Both of these, plus the User-based Security Model that's typically used with SNMPv3, derive the securityName and securityLevel from the SNMP message that was received, even when the message came over a secure transport 😀 So access control decisions are made based on the contents of the SNMP message, NOT the authenticated identity and securityLevel that the TLS Transport Model provided. Not ideal, bestie πŸ’€

It is RECOMMENDED that only SNMPv3 messages using the Transport Security Model (TSM) or another secure-transport aware security model get sent over the TLSTM transport πŸ¦‹

Using a non-transport-aware Security Model with a secure Transport Model is NOT RECOMMENDED πŸ™…β€β™€οΈ See [RFC5590], Section 7.1 for more details on how security-aware transports and non-transport-aware security models can coexist.

9.4. MIB Module Security πŸ›‘οΈ

There are a bunch of management objects in this MIB module with a MAX-ACCESS clause of read-write and/or read-create. These objects may be considered sensitive or vulnerable in some network environments. Supporting SET operations in a non-secure environment without proper protection can seriously mess with network operations 😭 These are the tables and objects, plus their sensitivity and vulnerability:

  • The snmpTlstmParamsTable can be used to change the outgoing X.509 certificate used to establish a (D)TLS connection. Changes to objects in this table need to be adequately authenticated, because modifying them has profound impacts on the security of outbound connections from the device. Since knowledge of authorization rules and certificate usage mechanisms may be considered sensitive, protecting SNMP traffic from disclosure via encryption is also highly recommended πŸ”’
  • The snmpTlstmAddrTable can be used to change the expectations of the certificates presented by a remote (D)TLS server. Changes to objects in this table need to be adequately authenticated, because modifying them has profound impacts on the security of outbound connections from the device. Since knowledge of authorization rules and certificate usage mechanisms may be considered sensitive, protecting SNMP traffic from disclosure via encryption is also highly recommended 🫣
  • The snmpTlstmCertToTSNTable is used to specify the mapping of incoming X.509 certificates to tmSecurityNames, which eventually get mapped to an SNMPv3 securityName. Changes to objects in this table need to be adequately authenticated, because modifying them has profound impacts on the security of incoming connections to the device. Since knowledge of authorization rules and certificate usage mechanisms may be considered sensitive, protecting SNMP traffic from disclosure via encryption is also highly recommended. When this table has a significant number of rows, it may affect system performance when accepting new (D)TLS connections 🐒

Some of the readable objects in this MIB module (the ones with a MAX-ACCESS other than not-accessible) may be considered sensitive or vulnerable in some network environments. So it's important to control even GET and/or NOTIFY access to these objects, and possibly even encrypt their values when sending them over the network via SNMP πŸ‘€ These are the tables and objects, plus their sensitivity and vulnerability:

  • This MIB contains a collection of counters that monitor the (D)TLS connections being established with a device. Since knowledge of connection and certificate usage mechanisms may be considered sensitive, protecting SNMP traffic from disclosure via encryption is highly recommended πŸ“

SNMP versions prior to SNMPv3 did not include adequate security. Even if the network itself is secure (for example, by using IPsec), there is still no control over who on that secure network is allowed to access and GET/SET (read/change/create/delete) the objects in this MIB module. Yikes πŸ’€

It is RECOMMENDED that implementers consider the security features provided by the SNMPv3 framework (see [RFC3410], Section 8), including full support for the SNMPv3 cryptographic mechanisms for authentication and privacy πŸ”

Further, deploying SNMP versions prior to SNMPv3 is NOT RECOMMENDED. Instead, it is RECOMMENDED to deploy SNMPv3 and enable cryptographic security ✨ Then it's a customer/operator responsibility to make sure the SNMP entity giving access to an instance of this MIB module is properly configured, so the objects are only accessible to principals (users) who have legitimate rights to GET or SET (change/create/delete) them πŸ‘‘

10. IANA Considerations πŸ—‚οΈ

IANA has assigned:

  1. Two TCP/UDP port numbers from the "Registered Ports" range of the Port Numbers registry, with the following keywords:
Keyword         Decimal      Description       References
-------         -------      -----------       ----------
snmptls         10161/tcp    SNMP-TLS          [RFC6353]
snmpdtls        10161/udp    SNMP-DTLS         [RFC6353]
snmptls-trap    10162/tcp    SNMP-Trap-TLS     [RFC6353]
snmpdtls-trap   10162/udp    SNMP-Trap-DTLS    [RFC6353]

These are the default ports for receipt of SNMP command messages (snmptls and snmpdtls) and SNMP notification messages (snmptls-trap and snmpdtls-trap) over a TLS Transport Model as defined in this document πŸ¦‹

  1. An SMI number (8) under snmpDomains for the snmpTLSTCPDomain object identifier πŸ”’
  2. An SMI number (9) under snmpDomains for the snmpDTLSUDPDomain object identifier πŸ”’
  3. An SMI number (198) under mib-2, for the MIB module in this document πŸ”’
  4. "tls" as the corresponding prefix for the snmpTLSTCPDomain in the SNMP Transport Domains registry 🏷️
  5. "dtls" as the corresponding prefix for the snmpDTLSUDPDomain in the SNMP Transport Domains registry 🏷️

11. Acknowledgements πŸ’Œ

This document closely follows and copies the Secure Shell Transport Model for SNMP documented by David Harrington and Joseph Salowey in [RFC5592] 🫢

This document was reviewed by the following people, who gave useful comments (in alphabetical order): Andy Donati, Pasi Eronen, David Harrington, Jeffrey Hutzelman, Alan Luchuk, Michael Peck, Tom Petch, Randy Presuhn, Ray Purvis, Peter Saint-Andre, Joseph Salowey, Juergen Schoenwaelder, Dave Shield, and Robert Story 🌟

This work was supported in part by the United States Department of Defense. Large portions of this document are based on work by General Dynamics C4 Systems and the following individuals: Brian Baril, Kim Bryant, Dana Deluca, Dan Hanson, Tim Huemiller, John Holzhauer, Colin Hoogeboom, Dave Kornbau, Chris Knaian, Dan Knaul, Charles Limoges, Steve Moccaldi, Gerardo Orlando, and Brandon Yip πŸ’œ

12. References πŸ“š

12.1. Normative References

okay so this is the list of stuff the spec straight up needs you to have read first πŸ“šπŸ’… no skipping, bestie

[RFC1123]    Braden, R., "Requirements for Internet Hosts -
             Application and Support", STD 3, RFC 1123, October 1989.

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

[RFC2578]    McCloghrie, K., Ed., Perkins, D., Ed., and J.
             Schoenwaelder, Ed., "Structure of Management Information
             Version 2 (SMIv2)", STD 58, RFC 2578, April 1999.

[RFC2579]    McCloghrie, K., Ed., Perkins, D., Ed., and J.
             Schoenwaelder, Ed., "Textual Conventions for SMIv2",
             STD 58, RFC 2579, April 1999.

[RFC2580]    McCloghrie, K., Perkins, D., and J. Schoenwaelder,
             "Conformance Statements for SMIv2", STD 58, RFC 2580,
             April 1999.

[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.

[RFC3413]    Levi, D., Meyer, P., and B. Stewart, "Simple Network
             Management Protocol (SNMP) Applications", STD 62,
             RFC 3413, 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.

[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.

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

[RFC3584]    Frye, R., Levi, D., Routhier, S., and B. Wijnen,
             "Coexistence between Version 1, Version 2, and Version 3
             of the Internet-standard Network Management Framework",
             BCP 74, RFC 3584, August 2003.

[RFC4347]    Rescorla, E. and N. Modadugu, "Datagram Transport Layer
             Security", RFC 4347, April 2006.

[RFC4366]    Blake-Wilson, S., Nystrom, M., Hopwood, D., Mikkelsen,
             J., and T. Wright, "Transport Layer Security (TLS)
             Extensions", RFC 4366, April 2006.

[RFC5246]    Dierks, T. and E. Rescorla, "The Transport Layer
             Security (TLS) Protocol Version 1.2", RFC 5246,
             August 2008.

[RFC5280]    Cooper, D., Santesson, S., Farrell, S., Boeyen, S.,
             Housley, R., and W. Polk, "Internet X.509 Public Key
             Infrastructure Certificate and Certificate Revocation
             List (CRL) Profile", RFC 5280, May 2008.

[RFC5590]    Harrington, D. and J. Schoenwaelder, "Transport
             Subsystem for the Simple Network Management Protocol
             (SNMP)", RFC 5590, June 2009.

[RFC5591]    Harrington, D. and W. Hardaker, "Transport Security
             Model for the Simple Network Management Protocol
             (SNMP)", RFC 5591, June 2009.

[RFC5952]    Kawamura, S. and M. Kawashima, "A Recommendation for
             IPv6 Address Text Representation", RFC 5952,
             August 2010.

12.2. Informative References

these ones are the extra reading 🌸 helpful for context, not strictly required to get the core ideas

[HEARTBEAT]  Seggelmann, R., Tuexen, M., and M. Williams, "Transport
             Layer Security (TLS) and Datagram Transport Layer
             Security (DTLS) Heartbeat Extension", Work in Progress,
             July 2011.

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

[RFC5343]    Schoenwaelder, J., "Simple Network Management Protocol
             (SNMP) Context EngineID Discovery", RFC 5343,
             September 2008.

[RFC5592]    Harrington, D., Salowey, J., and W. Hardaker, "Secure
             Shell Transport Model for the Simple Network Management
             Protocol (SNMP)", RFC 5592, June 2009.

[RFC5890]    Klensin, J., "Internationalized Domain Names for
             Applications (IDNA): Definitions and Document
             Framework", RFC 5890, August 2010.

[RFC5953]    Hardaker, W., "Transport Layer Security (TLS) Transport
             Model for the Simple Network Management Protocol
             (SNMP)", RFC 5953, August 2010.

Appendix A. Target and Notification Configuration Example ✨

this appendix is a bunch of worked examples πŸŽ€ it walks through setting up config for the SNMP-TLS-TM-MIB, the SNMP-TARGET-MIB, the NOTIFICATION-MIB, and the SNMP-VIEW-BASED-ACM-MIB. super handy to see how it all clicks together

A.1. Configuring a Notification Originator

first up, adding "Joe Cool" to the "administrators" group 😎

vacmSecurityModel              = 4 (TSM)
vacmSecurityName               = "Joe Cool"
vacmGroupName                  = "administrators"
vacmSecurityToGroupStorageType = 3 (nonVolatile)
vacmSecurityToGroupStatus      = 4 (createAndGo)

next, the snmpTlstmAddrTable gets set up to use certificate path validation πŸ” and to require the remote notification receiver to present a certificate for the "server.example.org" identity. very strict, very iconic

snmpTargetAddrName             =  "toNRAddr"
snmpTlstmAddrServerFingerprint =  ""
snmpTlstmAddrServerIdentity    =  "server.example.org"
snmpTlstmAddrStorageType       =  3         (nonVolatile)
snmpTlstmAddrRowStatus         =  4         (createAndGo)

then the snmpTargetAddrTable sends notifications over TLS/TCP to the snmptls-trap port at 192.0.2.1 πŸ¦‹

snmpTargetAddrName              = "toNRAddr"
snmpTargetAddrTDomain           = snmpTLSTCPDomain
snmpTargetAddrTAddress          = "192.0.2.1:10162"
snmpTargetAddrTimeout           = 1500
snmpTargetAddrRetryCount        = 3
snmpTargetAddrTagList           = "toNRTag"
snmpTargetAddrParams            = "toNR"     (MUST match below)
snmpTargetAddrStorageType       = 3          (nonVolatile)
snmpTargetAddrRowStatus         = 4          (createAndGo)

and the snmpTargetParamsTable is what actually sends the notifications to "Joe Cool" πŸ’Œ using authPriv SNMPv3 notifications through the TransportSecurityModel [RFC5591]

snmpTargetParamsName            = "toNR"     (must match above)
snmpTargetParamsMPModel         = 3 (SNMPv3)
snmpTargetParamsSecurityModel   = 4 (TransportSecurityModel)
snmpTargetParamsSecurityName    = "Joe Cool"
snmpTargetParamsSecurityLevel   = 3          (authPriv)
snmpTargetParamsStorageType     = 3          (nonVolatile)
snmpTargetParamsRowStatus       = 4          (createAndGo)

A.2. Configuring TLSTM to Utilize a Simple Derivation of tmSecurityName

this one maps a validated client certificate πŸͺͺ (found by its public X.509 hash fingerprint) to a tmSecurityName, using the subjectAltName part of the certificate. the cert does the naming work for you

snmpTlstmCertToTSNID          = 1
                                (chosen by ordering preference)
snmpTlstmCertToTSNFingerprint = HASH (appropriate fingerprint)
snmpTlstmCertToTSNMapType     = snmpTlstmCertSANAny
snmpTlstmCertToTSNData        = ""  (not used)
snmpTlstmCertToTSNStorageType = 3   (nonVolatile)
snmpTlstmCertToTSNRowStatus   = 4   (createAndGo)

ngl this is a "read the room first" kind of setup πŸ‘€ this type of configuration should only be used when the naming conventions of the (possibly multiple) Certification Authorities are well understood, so two different principals cannot inadvertently be identified by the same derived tmSecurityName. no accidental identity mix-ups allowed πŸ™…β€β™€οΈ

A.3. Configuring TLSTM to Utilize Table-Driven Certificate Mapping

this time the snmpTlstmCertToTSNTable maps that same kind of validated client certificate (again found by its public X.509 hash fingerprint) to a tmSecurityName that's written out directly: "Joe Cool" 🧚

snmpTlstmCertToTSNID           = 2
                                 (chosen by ordering preference)
snmpTlstmCertToTSNFingerprint  = HASH (appropriate fingerprint)
snmpTlstmCertToTSNMapType      = snmpTlstmCertSpecified
snmpTlstmCertToTSNSecurityName = "Joe Cool"
snmpTlstmCertToTSNStorageType  = 3  (nonVolatile)
snmpTlstmCertToTSNRowStatus    = 4  (createAndGo)

Author's Address πŸ’œ

Wes Hardaker
SPARTA, Inc.
P.O. Box 382
Davis, CA  95617
USA

Phone: +1 530 792 1913
EMail: ietf@hardakers.net
πŸ“¦ where this page comes from