5. 确定和使用维护知识
在使用认证 (authentication) 服务时, 可能需要执行两项 "维护" 任务: 时钟同步 (clock synchronization) 和密钥更新 (secret update). 这些任务应当透明地执行, 独立于管理应用程序, 并且无需用户或管理员干预. 为了透明地运行, SNMP 协议引擎必须维护 "维护知识 (maintenance knowledge)" (即关于使用哪些团体 (party) 和上下文 (context) 的知识). 在运行时确定这种维护知识, 而不是由管理员直接配置它, 是有益的.
实现这一点的一种方法如下: 当 SNMP 协议引擎首次确定它将与另一个 SNMPv2 实体通信时, 在实际通信开始之前, 该引擎先查询其本地团体数据库, 然后询问其对等端 (peer).
请注意, 采用这种方法时, 与某个团体相关联的时钟同步知识和密钥更新知识都可以表示为一个访问控制条目 (access control entry) (或指向它的指针). 还请注意, 一旦某个实现计算出这些知识, 它可以选择在重启之后仍保留这些知识.
5.1. 同步知识的确定
要确定用于时钟同步的维护知识:
(1) The SNMP protocol engine examines each active, non-local,
noAuth party.
So, this would be party #1.
(2) For each such party, P, all access control entries having
that party as its aclTarget, and allowing the get-bulk
operation, are identified.
So, for party #1, this would be acl #1.
(3) For each such access control entry, A, at least one
active, non-local, md5Auth party, Q, must be present
which meets the following criteria:
- the transport domain and address of P and Q are
identical;
- an access control entry, B, exists having either: Q as
its aclTarget and a local party, R, as its aclSubject,
or, Q as its aclSubject and a local party, R, as its
aclTarget; and,
- no clock synchronization knowledge is known for R.
So, for acl #1, party #3 is identified as having the same
transport domain and address as party #1, and being
present as the aclTarget in acl #2, which has local party
#4 as the aclSubject.
(4) Whenever such a party, Q, is present, then all instances
of the "partyAuthProtocol" and "partyAuthClock" objects
are retrieved via the get-bulk operator using the parties
and context identified by the access control entry, A.
So, party #1, party #2, and context #1 would be used to
sweep these two columns on the agent.
(5) Only those instances corresponding to parties in the
local database, which have no clock synchronization
knowledge, and are local mdAuth parties, are examined.
So, only instances corresponding to party #4 are
examined.
(6) For each instance of "partyAuthProtocol", if the
corresponding value does not match the value in the local
database, then a configuration error is signalled, and
the corresponding party is marked as being unavailable
for maintenance knowledge.
So, we make sure that the manager and the agent agree
that party #4 is an md5Auth party.
(7) For each instance of "partyAuthClock", if the
corresponding value is greater than the value in the
local database, then the authentication clock of the
party is warped according to the procedures defined in
Section 5.3 of [3]. Regardless, A is recorded as the
clock synchronization knowledge for the corresponding
party.
So, if the column sweep returns information for party #4,
then party #4's authentication clock is advanced if
necessary, and the clock synchronization knowledge for
party #4 is recorded as acl #1.
5.2. 时钟同步知识的使用
当没有收到对某项认证操作的响应时, SNMP 协议引擎可能会怀疑原因是源团体 (source party) 存在时钟同步问题 [3]. 在作出这一判断时, SNMP 协议引擎可以采用不同的准则. 例如: 对于检索操作, 可以使用指数退避算法 (exponential back-off algorithm) 重试该操作; 相反, 对于修改操作, 则不会自动重试.
当怀疑某个源团体 S 的时钟不同步时, 如果存在关于 S 的时钟同步知识, 则使用该知识执行上述步骤 4 至 7, 这应当检索与 S 相对应的 "partyAuthProtocol" 和 "partyAuthClock" 对象的实例 (也可能包括其他团体的实例). 如果无法确定这些对象的相关信息, 则将 S 标记为不再具有时钟同步知识. 否则, 如果 "partyAuthClock" 对应实例的值大于本地数据库中的值, 则按照 [3] 第 5.3 节中定义的规程调整该团体的认证时钟, 并在适当的情况下重试原操作.
因此, 如果来自团体 #4 的通信超时, 则会自动启动一次列扫描 (column sweep), 使用 acl #1 (团体 #1, 团体 #2, 上下文 #1).
当怀疑某个源团体 S 的时钟不同步, 并且不存在关于 S 的时钟同步知识时, 可以使用上述完整算法. 在这种情况下, 如果能够确定关于 S 的时钟同步知识, 并因此按照 [3] 第 5.3 节中定义的规程调整本地数据库中 S 的 "partyAuthClock" 值, 则在适当的情况下重试原操作.
5.3. 密钥更新知识的确定
要确定用于密钥更新的维护知识:
(1) The SNMP protocol engine examines each active, non-local,
md5Auth party.
So, this would be party #3.
(2) For each such party, P, all access control entries having
that party as its aclTarget, and allowing the get-bulk
and set operations, are identified.
So, for party #3, this would be acl #2.
(3) For each such access control entry, A, at least one
active, non-local, md5Auth party, Q, must be present
which meets the following criteria:
- the transport domain and address of P and Q are
identical;
- an access control entry, B, exists having either: Q as
its aclTarget and a local party, R, as its aclSubject,
or, Q as its aclSubject and a local party, R, as its
aclTarget; and,
- no secret update knowledge is known for R.
So, for acl #2, party #3 is (redundantly) identified as
having the same transport domain and address as party #3,
and being present as the aclTarget in acl #2, which has
local party #4 as the aclSubject.
(4) Whenever such a party, Q, is present, then all instances
of the "partyAuthProtocol", "partyAuthClock", and
"partyAuthPrivate" objects are retrieved via the get-bulk
operator using the parties and context identified by the
access control entry, A.
So, party #3, party #4, and context #2 would be used to
sweep these three columns on the agent.
(5) Only those instances corresponding to parties in the
local database, which have no secret update knowledge,
and are md5Auth parties, are examined.
So, only instances corresponding to parties #3 and #4 are
examined.
(6) For each instance of "partyAuthProtocol", if the
corresponding value does not match the value in the local
database, then a configuration error is signalled, and
this party is marked as being unavailable for maintenance
knowledge.
So, we make sure that the manager and the agent agree
that both party #3 and #4 are md5Auth parties.
(7) For each instance of "partyAuthPrivate", if a
corresponding instance of "partyAuthClock" was also
returned, then A is recorded as the secret update
knowledge for this party.
So, if the column sweep returned information on party #3,
then the clock synchronization knowledge for party #3
would be recorded as acl #2. Further, if the column
sweep returned information on party #4, then the clock
synchronization knowledge for party #4 would be recorded
as acl #2.
5.4. 密钥更新知识的使用
当 SNMP 协议引擎确定某个团体 S 的认证时钟正接近上限, 并且存在关于 S 的密钥更新知识时, 则按照 [3] 第 5.4 节中定义的规程, 使用该知识修改 S 的当前密钥并重置 S 的认证时钟.
因此, 每当 SNMP 协议引擎决定更新团体 #4 的密钥时, 它都可以自动使用 acl #2 (团体 #3, 团体 #4, 上下文 #2) 来完成此目的.