7. 安全考虑事项 (Security Considerations)
[RFC7252] Section 11 中的 CoAP specification 安全考虑事项适用.
observing resources 可能显著增加 amplification attacks 的负面影响. 也就是说, notifications messages 不仅可能比 request message 大得多, 该协议的性质还可能导致生成大量 notifications. 因此, 在没有 client authentication 的情况下, server MUST 严格限制在收到确认 client 对 data 的实际 interest 的 acknowledgements 之间发送的 notifications 数量; 即, 在 non-confirmable messages 中发送的任何 notifications MUST 与 confirmable messages 交错. 注意, 如果 confirmable messages 足够可预测, attacker 仍可能 spoof acknowledgements.
该协议采用 best-effort 方法, 以保持 client 观察到的 state 与 server 上的实际 resource state 同步. 这可能导致 client 和 server 有时不同步. 根据 observed resource 的敏感性, 基于旧 state 操作可能成为 security threat. 因此, client 必须谨慎, 不要在 representation 的 Max-Age 过期后继续使用它, server 也必须将 Max-Age Option 设置为合理值.
与任何创建 state 的协议一样, attackers 可能尝试耗尽 server 可用于维护每个 resource observers list 的资源. Servers 可能希望对这种 state creation 应用 access controls. 作为 degraded behavior, 如果 server 不愿或无法将 client 添加到某个 resource 的 observers list 中, 包括 system resources 已耗尽或接近耗尽时, 它始终可以回退为将 request 作为普通 GET request (不带 Observe Option) 处理.
Intermediaries 必须谨慎, 以确保 notifications 不能被用来创建 loop. 打破任何 loops 的一种简单方法是在 intermediaries 中使用 caches 来转发 notifications.
Resources 可以通过由 Datagram Transport Layer Security (DTLS) 保护的 CoAP 被 observed, 使用 RFC 7252 Section 9 中描述的任何 security modes. DTLS 的使用由 "coaps" URI scheme 指示. 由带 Observe Option 的 GET request 产生的所有 notifications MUST 在与该 request 相同 connection 的同一 epoch 内返回.