3. 过程元素
-
过程元素
本节描述实现基于视图的访问控制模型的访问控制模块在按应用 (例如 Command Responder 或 Notification Originator 应用) 请求检查访问权限时遵循的过程. 抽象服务原语为:
statusInformation = -- success or errorIndication isAccessAllowed( securityModel -- Security Model in use securityName -- principal who wants access securityLevel -- Level of Security viewType -- read, write, or notify view contextName -- context containing variableName variableName -- OID for the managed object )
抽象数据元素为:
statusInformation - 以下之一: accessAllowed - 找到 MIB view, 且授予访问. notInView - 找到 MIB view, 但拒绝访问. variableName 不在指定 viewType 的已配置 MIB view 中 (例如 vacmAccessTable 中的相关条目). noSuchView - 未找到 MIB view, 因为没有为指定 viewType 配置视图 (例如 vacmAccessTable 中的相关条目). noSuchContext - 未找到 MIB view, 因为 vacmContextTable 中没有 指定 contextName 的条目. noGroupName - 未找到 MIB view, 因为 vacmSecurityToGroupTable 中没有为 securityModel 和 securityName 的指定组合 配置条目. noAccessEntry - 未找到 MIB view, 因为 vacmAccessTable 中没有为 contextName,groupName (来自 vacmSecurityToGroupTable), securityModel 和 securityLevel 的指定组合配置条目. otherError - 失败, 出现未定义错误. securityModel - 请求访问所依据的安全模型. securityName - 代表其请求访问的主体. securityLevel - 请求访问所依据的安全级别. viewType - 要检查的视图 (read, write 或 notify). contextName - 请求访问所在的上下文. variableName - 请求访问的对象实例.
3.1. isAccessAllowed 过程概述
下图展示基于视图的访问控制模型如何作出访问控制决策.
+--------------------------------------------------------------------+ | | | +-> securityModel -+ | | | (a) | | | who -+ +-> groupName ----+ | | (1) | | (x) | | | +-> securityName --+ | | | (b) | | | | | | where -> contextName ---------------------+ | | (2) (e) | | | | | | | | | +-> securityModel -------------------+ | | | (a) | | | how -+ +-> viewName -+ | | (3) | | (y) | | | +-> securityLevel -------------------+ | | | (c) | +-> yes/no | | | | decision | | why ---> viewType (read/write/notify) ----+ | (z) | | (4) (d) | | | | | | what --> object-type ------+ | | | (5) (m) | | | | +-> variableName (OID) ------+ | | | (f) | | which -> object-instance --+ | | (6) (n) | | | +--------------------------------------------------------------------+
isAccessAllowed 决策的作出方式.
-
isAccessAllowed 服务的输入为:
(a) securityModel -- 正在使用的安全模型 (b) securityName -- 想要访问的主体 (c) securityLevel -- 安全级别 (d) viewType -- read,write 或 notify 视图 (e) contextName -- 包含 variableName 的上下文 (f) variableName -- 托管对象的 OID -- 它由以下部分组成: - object-type (m) - object-instance (n)
-
由 securityModel (a) 和 securityName (b) 表示的部分 "who" (1), 用作 vacmSecurityToGroupTable 的索引 (a,b), 以找到一个产生组的单个条目, 该组由 groupName (x) 表示.
-
由 contextName (e) 表示的 "where" (2),由上一步中的 groupName (x) 表示的 "who", 以及由 securityModel (a) 和 securityLevel (c) 表示的 "how" (3), 用作 vacmAccessTable 的索引 (e,x,a,c), 以找到包含三个 MIB view 的单个条目.
-
由 viewType (d) 表示的 "why" (4), 用于从上一步选定的 vacmAccessEntry 中选择适当的 MIB view, 该视图由 viewName (y) 表示. 此 viewName (y) 是 vacmViewTreeFamilyTable 的索引, 并选择一组条目, 这些条目定义哪些 variableName 被包含在由 viewName (y) 标识的 MIB view 中或从中排除.
-
随后检查由 variableName (f) 表示的管理数据类型 "what" (5) 和特定实例 "which" (6) 是否位于 MIB view 中, 即 yes/no 决策 (z).
3.2. 处理 isAccessAllowed 服务请求
本节描述实现基于视图的访问控制模型的访问控制模块每次收到 isAccessAllowed 请求时遵循的过程.
-
查询 vacmContextTable 以获取由 contextName 标识的 SNMP 上下文信息. 如果表中不存在关于此 SNMP 上下文的信息, 则向调用模块返回 errorIndication (noSuchContext).
-
查询 vacmSecurityToGroupTable, 以将 securityModel 和 securityName 映射到 groupName. 如果表中不存在关于此组合的信息, 则向调用模块返回 errorIndication (noGroupName).
-
查询 vacmAccessTable 以获取关于 groupName,contextName,securityModel 和 securityLevel 的信息. 如果表中不存在关于此组合的信息, 则向调用模块返回 errorIndication (noAccessEntry).
-
a) 如果 viewType 为 "read", 则使用 read view 检查访问权限.
b) 如果 viewType 为 "write", 则使用 write view 检查访问权限.
c) 如果 viewType 为 "notify", 则使用 notify view 检查访问权限.
如果要使用的视图为空视图 (零长度 viewName), 则向调用模块返回 errorIndication (noSuchView).
-
a) 如果没有为指定 viewType 配置视图, 则向调用模块返回 errorIndication (noSuchView).
b) 如果指定 variableName (对象实例) 不在 MIB view 中 (见第 4 节中 vacmViewTreeFamilyTable 的 DESCRIPTION 子句), 则向调用模块返回 errorIndication (notInView).
否则,
c) 指定 variableName 位于 MIB view 中. 向调用模块返回成功的 statusInformation (accessAllowed).