SNMPv3基于用户的安全模型USM(1)

2024-05-04 14:58
文章标签 安全 模型 用户 usm snmpv3

本文主要是介绍SNMPv3基于用户的安全模型USM(1),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

转载:http://blog.csdn.net/fw0124/article/details/8557029

SNMPv3使用了基于用户的安全模型USM.
- RFC 3411 Architecture for SNMP Frameworks http://www.ietf.org/rfc/rfc3411.txt
- RFC 3414 User-based Security Model (USM) http://www.ietf.org/rfc/rfc3414.txt

 

SNMP Entity
RFC3411里面定义在一个SNMPv3 entity里面包括以下部分。

1) Dispatcher
1个SNMP entity里面只有1个Dispatcher,负责消息的收发。

2) Message Processing Subsystem
在SNMP-FRAMEWORK-MIB里面定义了如下几种消息处理模式
SnmpMessageProcessingModel
                     0  reserved for SNMPv1
                     1  reserved for SNMPv2c
                     2  reserved for SNMPv2u and SNMPv2*
                     3  reserved for SNMPv3

3) Security Subsystem
在SNMP-FRAMEWORK-MIB里面定义了如下几种安全模式
SnmpSecurityModel
                     0  reserved for 'any'
                     1  reserved for SNMPv1
                     2  reserved for SNMPv2c
                     3  User-Based Security Model (USM)

定义了如下几种安全级别
SnmpSecurityLevel
                     noAuthNoPriv(1),   --无认证无加密
                     authNoPriv(2),       --有认证无加密
                     authPriv(3)            --有认证有加密
      
4) Access Control Subsystem

5) Applications
包括
      -  command generators, which monitor and manipulate management data,
      -  command responders, which provide access to management data,
      -  notification originators, which initiate asynchronous messages,
      -  notification receivers, which process asynchronous messages,
      -  proxy forwarders, which forward messages between entities.

 

SNMP Context
An SNMP context, or just "context" for short, is a collection of  management information accessible by an SNMP entity.
An SNMP  entity potentially has access to many contexts. The combination of a contextEngineID and a contextName unambiguously identifies a context within an administrative domain.
SNMP context可以看作是管理信息的一个集合。
一个SNMP entity里面可以访问多个SNMP context。
contextEngineID和contextName结合起来识别一个特定的SNMP context。
 


USM
1) Authentication Protocol
支持HMAC-MD5-96 和 HMAC-SHA-96两种认证协议。
*HMAC算法->http://blog.csdn.net/fw0124/article/details/8473858
*HMAC-MD5-96表示HMAC算法使用MD5作为杂凑函数,输出结果使用前96位(MD5输出结果128)。
*HMAC-SHA1-96表示HMAC算法使用SHA1作为杂凑函数,输出结果使用前96位(SHA1输出结果160位)。

2) authKey
用于HMAC认证的用户密钥。
实际上使用的HMAC密钥是此用户密钥和engineID经过计算得出的,这个过程称为localize。

3) Privacy Protocol
支持CBC-DES和CFB-AES两种加密方法。
*分组加密模式->http://blog.csdn.net/fw0124/article/details/8472560
*CBC-DES表示使用CBC加密模式,DES加密算法。
*CFB-AES表示使用CFB加密模式,AES加密算法。

4) privKey
用于加密的用户密钥。
实际上使用的加密密钥是此用户密钥和engineID经过计算得出的,这个过程称为localize。

5) 防止消息延迟或者重放攻击/protect against the threat of message delay or replay
-在request里面包含msgID,response里面必须返回这个msgID,否则此reponse会被丢弃。
-在request里面包含engineBoots和engineTime,agent会检查它们是否在150秒的时间窗口内。
*engineBoots表示SNMP engine的reboot次数
*engineTime表示上次reboot之后经过的秒数

6) 时间同步/Time Synchronization
Time synchronization, required by a non-authoritative SNMP engine in order to proceed with authentic communications, has occurred when the non-authoritative SNMP engine has obtained a local notion of the authoritative SNMP engine's values of snmpEngineBoots and snmpEngineTime from the authoritative SNMP engine.  These values must be (and remain) within the authoritative SNMP engine's Time Window. So the local notion of the authoritative SNMP engine's values must be kept loosely synchronized with the values stored  at the authoritative SNMP engine. 
In addition to keeping a local  copy of snmpEngineBoots and snmpEngineTime from the authoritative SNMP engine, a non-authoritative SNMP engine must also keep one local variable, latestReceivedEngineTime.  This value records the highest value of snmpEngineTime that was received by the non-authoritative SNMP engine from the authoritative SNMP engine.
A non-authoritative SNMP engine must keep local notions of these values (snmpEngineBoots, snmpEngineTime and latestReceivedEngineTime)  for each authoritative SNMP engine with which it wishes to
 communicate.  Since each authoritative SNMP engine is uniquely and unambiguously identified by its value of snmpEngineID, the  non-authoritative SNMP engine may use this value as a key in order to cache its local notions of these values.
 首先有两个概念需要搞清楚。
 - authoritative SNMP engine, 可以理解为snmp agent.
 - non-authoritative SNMP engine, 可以理解为snmp NMS(network management station)
 时间同步由non-authoritative SNMP engine发起,以获得authoritative SNMP engine的snmpEngineBoots和snmpEngineTime并存于本地,另外本地还保存latestReceivedEngineTime这个变量,它是最近一次收到authoritative SNMP engine发来的消息中的snmpEngineTime。
 对于authoritative SNMP engine,如果收到的消息中包含的engineBoots不等于自身的engineBoots,或者engineBoots相等但是收到的engineTime处于时间窗口外,也就是自身的engineTime+/-150秒之外,就会产生一个notInTimeWindow的错误,并增加usmStatsNotInTimeWindows的统计counter, 然后生成一个包含usmStatsNotInTimeWindows的report返回给调用方。
 对于non-authoritative SNMP engine,如果收到的消息中包含的engineBoots大于自身的engineBoots,或者engineBoots相等但是收到的engineTime大于latestReceivedEngineTime,那么需要更新保存于本地的engineBoots, engineTime和latestReceivedEngineTime。如果收到的消息中包含的engineBoots小于自身的engineBoots,或者engineBoots相等但是收到的engineTime小于自身的engineTime-150秒,就会认为这个消息处于时间窗口外。


这篇关于SNMPv3基于用户的安全模型USM(1)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/959471

相关文章

Java的IO模型、Netty原理解析

《Java的IO模型、Netty原理解析》Java的I/O是以流的方式进行数据输入输出的,Java的类库涉及很多领域的IO内容:标准的输入输出,文件的操作、网络上的数据传输流、字符串流、对象流等,这篇... 目录1.什么是IO2.同步与异步、阻塞与非阻塞3.三种IO模型BIO(blocking I/O)NI

基于Flask框架添加多个AI模型的API并进行交互

《基于Flask框架添加多个AI模型的API并进行交互》:本文主要介绍如何基于Flask框架开发AI模型API管理系统,允许用户添加、删除不同AI模型的API密钥,感兴趣的可以了解下... 目录1. 概述2. 后端代码说明2.1 依赖库导入2.2 应用初始化2.3 API 存储字典2.4 路由函数2.5 应

最新Spring Security实战教程之Spring Security安全框架指南

《最新SpringSecurity实战教程之SpringSecurity安全框架指南》SpringSecurity是Spring生态系统中的核心组件,提供认证、授权和防护机制,以保护应用免受各种安... 目录前言什么是Spring Security?同类框架对比Spring Security典型应用场景传统

mysql删除无用用户的方法实现

《mysql删除无用用户的方法实现》本文主要介绍了mysql删除无用用户的方法实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧... 1、删除不用的账户(1) 查看当前已存在账户mysql> select user,host,pa

C#集成DeepSeek模型实现AI私有化的流程步骤(本地部署与API调用教程)

《C#集成DeepSeek模型实现AI私有化的流程步骤(本地部署与API调用教程)》本文主要介绍了C#集成DeepSeek模型实现AI私有化的方法,包括搭建基础环境,如安装Ollama和下载DeepS... 目录前言搭建基础环境1、安装 Ollama2、下载 DeepSeek R1 模型客户端 ChatBo

SpringBoot快速接入OpenAI大模型的方法(JDK8)

《SpringBoot快速接入OpenAI大模型的方法(JDK8)》本文介绍了如何使用AI4J快速接入OpenAI大模型,并展示了如何实现流式与非流式的输出,以及对函数调用的使用,AI4J支持JDK8... 目录使用AI4J快速接入OpenAI大模型介绍AI4J-github快速使用创建SpringBoot

0基础租个硬件玩deepseek,蓝耘元生代智算云|本地部署DeepSeek R1模型的操作流程

《0基础租个硬件玩deepseek,蓝耘元生代智算云|本地部署DeepSeekR1模型的操作流程》DeepSeekR1模型凭借其强大的自然语言处理能力,在未来具有广阔的应用前景,有望在多个领域发... 目录0基础租个硬件玩deepseek,蓝耘元生代智算云|本地部署DeepSeek R1模型,3步搞定一个应

TP-Link PDDNS服将于务6月30日正式停运:用户需转向第三方DDNS服务

《TP-LinkPDDNS服将于务6月30日正式停运:用户需转向第三方DDNS服务》近期,路由器制造巨头普联(TP-Link)在用户群体中引发了一系列重要变动,上个月,公司发出了一则通知,明确要求所... 路由器厂商普联(TP-Link)上个月发布公告要求所有用户必须完成实名认证后才能继续使用普联提供的 D

Deepseek R1模型本地化部署+API接口调用详细教程(释放AI生产力)

《DeepseekR1模型本地化部署+API接口调用详细教程(释放AI生产力)》本文介绍了本地部署DeepSeekR1模型和通过API调用将其集成到VSCode中的过程,作者详细步骤展示了如何下载和... 目录前言一、deepseek R1模型与chatGPT o1系列模型对比二、本地部署步骤1.安装oll

Spring AI Alibaba接入大模型时的依赖问题小结

《SpringAIAlibaba接入大模型时的依赖问题小结》文章介绍了如何在pom.xml文件中配置SpringAIAlibaba依赖,并提供了一个示例pom.xml文件,同时,建议将Maven仓... 目录(一)pom.XML文件:(二)application.yml配置文件(一)pom.xml文件:首