IDP 传感器配置
IDP 传感器配置允许管理员配置用于优化 SRX 系列防火墙上 IDP 性能的设置。它说明了如何限制内存和会话使用量,控制超出资源时的流量丢弃,以及配置 IDP 智能旁路以管理高 CPU 使用率。它还包括故障转移期间的处理条件。
尽管无法使用 IDP 签名数据库创建应用程序签名,但可以配置传感器设置以限制运行应用程序标识的会话数,并限制应用程序标识的内存使用量。
有关更多信息,请参阅以下主题:
了解 IDP 传感器配置设置
传感器配置选项用于:
在接近 IDP 会话容量和内存限制时记录运行情况。
分析 IDP 丢弃的流量和超出限制时的应用标识。
尽管无法使用 IDP 签名数据库创建应用程序签名,但可以配置传感器设置以限制运行应用程序标识的会话数,并限制应用程序标识的内存使用量。
您可以配置可用于保存数据包以用于识别一个 TCP 或 UDP 会话的应用程序的最大内存字节量。还可以为应用程序标识配置全局内存使用限制。当系统达到会话的指定内存限制后,将对会话禁用应用程序识别。但是,IDP 继续匹配模式。匹配的应用程序将保存到缓存中,以便下一个会话可以使用它。这样可以保护系统免受攻击者的侵害,攻击者试图通过故意发送大型客户端到服务器数据包来绕过应用程序识别。
max-tcp-session-packet-memory- 要为 IDP 应用程序标识服务配置内存和会话限制,请运行命令 set security idp sensor-configuration application-identification max-tcp-session-packet-memory 5000 。
memory-limit-percent- 要为系统中可用的数据平面设置内存限制百分比(可用于 IDP 分配),请运行命令 set security idp sensor-configuration global memory-limit-percent 。支持的百分比值为 10 到 90。
drop-if-no-policy-loaded- 在启动时,如果尚未加载 IDP 策略,则默认情况下 IDP 会忽略流量。该
drop-if-no-policy-loaded
选项会更改此行为,以便在加载 IDP 策略之前丢弃所有会话。命令输出的以下计数器
show security idp counters flow
分析由于drop-if-no-policy-loaded
选项而丢弃的流量:Sessions dropped due to no policy 0
drop-on-failover默认情况下,IDP 会忽略 SRX 系列机箱群集部署中的故障切换会话。该
drop-on-failover
选项会更改此行为,并在发生对辅助节点的故障切换时自动丢弃正在对主节点进行检查的会话。命令输出的以下计数器
show security idp counters flow
分析由于drop-on-failover
选项而丢弃的故障转移流量:Fail-over sessions dropped 0
drop-on-limit- 默认情况下,如果超过 IDP 会话限制或资源限制,会话不会中断。在这种情况下,仅当设备的会话容量或资源耗尽时,IDP 和其他会话才会被丢弃。该
drop-on-limit
选项会更改此行为,并在超过资源限制时丢弃会话。命令输出的以下计数器
show security idp counters flow
分析由于drop-on-limit
选项而丢弃的 IDP 流量:SM Sessions encountered memory failures 0 SM Packets on sessions with memory failures 0 SM Sessions dropped 0 Both directions flows ignored 0 IDP Stream Sessions dropped due to memory failure 0 IDP Stream Sessions ignored due to memory failure 0 IDP Stream Sessions closed due to memory failure 0 Number of times Sessions exceed high mark 0 Number of times Sessions drop below low mark 0 Memory of Sessions exceeds high mark 0 Memory of Sessions drops below low mark 0
命令输出的以下计数器
show security idp counters application-identification
分析由于drop-on-limit
选项而丢弃的应用程序标识流量:AI-session dropped due to malloc failure before session create 0 AI-Sessions dropped due to malloc failure after create 0 AI-Packets received on sessions marked for drop due to malloc failure 0
以下选项用于触发有关当前运行条件的信息性日志消息。设置后,无论是否设置选项
drop-on-limit
,都会触发日志消息。max-sessions-offset- 该
max-sessions-offset
选项设置最大 IDP 会话限制的偏移量。当 IDP 会话数超过最大会话限制时,将记录一条警告,指出存在可能丢弃 IDP 会话的情况。当 IDP 会话数降至最大 IDP 会话限制减去偏移值以下时,将记录一条消息,指出情况已恢复正常。Jul 19 04:38:13 4.0.0.254 RT_IDP: IDP_SESSION_LOG_EVENT: IDP: at 1374233893, FPC 4 PIC 1 IDP total sessions pass through high mark 100000. IDP may drop new sessions. Total sessions dropped 0. Jul 19 04:38:21 4.0.0.254 RT_IDP: IDP_SESSION_LOG_EVENT: IDP: at 1374233901, FPC 4 PIC 1 IDP total sessions drop below low mark 99000. IDP working in normal mode. Total sessions dropped 24373.
min-objcache-limit-lt—该
min-objcache-limit-lt
选项设置可用缓存内存的较低阈值。阈值以可用 IDP 缓存内存的百分比表示。如果可用缓存内存降至阈值较低级别以下,则会记录一条消息,指出存在可能由于内存分配失败而丢弃 IDP 会话的情况。例如,以下消息显示 IDP 缓存内存已降至阈值下限以下,并且已丢弃多个会话:Jul 19 04:07:33 4.0.0.254 RT_IDP: IDP_SESSION_LOG_EVENT: IDP: at 1374232053, FPC 4 PIC 1 IDP total available objcache(used 4253368304, limit 7247757312) drops below low mark 3986266515. IDP may drop new sessions. Total sessions dropped 1002593.
min-objcache-limit-ut- 该
min-objcache-limit-ut
选项设置可用缓存内存的上限阈值。阈值以可用 IDP 缓存内存的百分比表示。如果可用 IDP 缓存内存返回到阈值上限级别,则会记录一条消息,指出可用缓存内存已恢复正常。例如,以下消息显示可用的 IDP 缓存内存已增加到上限阈值以上,并且现在运行正常:Jul 19 04:13:47 4.0.0.254 RT_IDP: IDP_SESSION_LOG_EVENT: IDP: at 1374232428, FPC 4 PIC 1 IDP total available objcache(used 2782950560, limit 7247757312) increases above high mark 4348654380. IDP working in normal mode. Total sessions dropped 13424632.
注意:仅当已达到下限并且可用内存返回到上限阈值以上时,才会触发此消息。如果可用内存中的波动降至阈值上限以下,但未低于阈值下限,则不会触发消息。
从 Junos OS 12.3X48-D10 版和 Junos OS 17.3R1 版开始,SRX 系列支持 IDP 智能旁路功能。
在其默认配置中,IDP 会尝试检查新的和现有的会话,而不考虑 CPU 使用率。在 CPU 利用率高事件期间,这可能导致数据包丢弃、延迟以及整个系统的不稳定性。为了克服不可预测的 IDP 数据包处理行为,可以启用 IDP 智能旁路功能。当系统 CPU 利用率达到较高水平时,通过此功能可以灵活地绕过 IDP 或丢弃数据包,也称为“打开失败”(允许数据包)或“关闭失败”(丢弃数据包)。默认情况下,IDP 智能旁路功能未启用。以下选项用于配置 IDP 智能旁路功能。
idp-bypass-cpu-usage-overload— 默认情况下,IDP 可能会消耗 100% 的可用 CPU,并且可能会无意中开始丢弃所有会话的数据包。要在系统 CPU 利用率达到较高阈值时处理 IDP 数据包处理行为,可以启用 IDP 智能旁路功能。要启用 IDP 智能旁路功能,请发出
set security idp sensor-configuration flow idp-bypass-cpu-overload
命令。默认情况下,IDP 智能旁路功能未启用。idp-bypass-cpu-threshold— 当 CPU 利用率达到定义的阈值时,IDP 将停止检查新会话。默认阈值 CPU 使用率为 85%。当 CPU 利用率达到阈值时,IDP 会继续绕过新会话,直到 CPU 利用率降至阈值之下。或者,如果设置
drop-on-limit
,IDP 将丢弃新会话,直到 CPU 利用率降至阈值下限值以下。要配置阈值,请发出set security idp sensor-configuration flow idp-bypass-cpu-threshold
命令。您可以在 0 到 99 的范围内设置阈值。此阈值以百分比表示。idp-bypass-cpu-tolerance— 要配置容差值,请发出
set security idp sensor-configuration flow idp-bypass-cpu-tolerance
命令。您可以在 1 到 99 的范围内设置容差值。默认容差值为 5。此容差值以百分比表示。
您可以使用以下公式计算 CPU 阈值上限和下限值:
CPU 阈值上限 = CPU 阈值 + CPU 容差值。
CPU 下限值 = CPU 阈值 - CPU 容差值。

当系统 CPU 使用率超过阈值时,IDP 将停止检查新会话,但会继续检查现有会话。在此状态下,如果 drop-on-limit
已设置,IDP 将开始丢弃新会话。将触发日志消息,以指示新会话已丢弃。例如,以下消息指出 IDP CPU 使用率已超过阈值,IDP 可能会丢弃新会话:
FPC 0 PIC 1 IDP CPU usage 86 crossed threshold value 85. IDP may drop new sessions. Total sessions dropped 2
当系统 CPU 使用率超过阈值上限时,IDP 将停止检查现有会话和新会话的数据包。在此状态下,任何数据包都无法通过 IDP 检查。如果 drop-on-limit
设置,IDP 将丢弃所有会话。将触发日志消息,以指示所有会话都已丢弃。例如,以下消息指出 IDP CPU 利用率已超过阈值上限,并且 IDP 将停止检查现有会话和新会话的数据包:
FPC 0 PIC 1 IDP CPU usage 92 crossed upper threshold value 90. IDP may drop packets of existing sessions as well as new sessions. Total sessions dropped 21
当系统 CPU 利用率低于阈值下限时,IDP 开始检查新会话并返回正常模式。IDP 不会检查现有的已丢弃会话。将触发日志消息,指示 IDP 开始检查新会话并返回正常模式。例如,以下消息指出 IDP CPU 利用率低于阈值下限,并且 IDP 返回到正常模式:
FPC 0 PIC 1 IDP CPU usage 75 dropped below lower threshold value 80. IDP working in normal mode. Total sessions dropped 25
IDP 保护模式
IDP 保护模式可调整检测参数,以有效检测设备中的流量。要启用 IDP 保护模式,请在[edit security idp sensor-configuration]
层次结构级别发出security-configuration protection-mode mode
命令。
user@host#
set security-configuration protection-mode mode
有四种 IDP 保护模式:
所有 IDP 保护模式都检查 CTS(客户端到服务器)流量。
模式 |
描述 |
---|---|
周长已满 |
检查所有 STC(服务器到客户端)流量。 处理 TCP 错误,无需任何优化。
注意:
这是默认模式。 |
周边 |
检查所有 STC 流量。 优化处理 TCP 错误。对于 TCP 数据包,如果在窗口中收到 SYN 并设置了 TCP 错误标志,则处理 TCP 错误并采取适当的措施。丢弃当前数据包并忽略对整个会话的检查。 |
数据中心满员 |
禁用所有 STC 流量检测。 处理 TCP 错误,无需任何优化。
注意:
Datacenter-Full 可用于以下情况:SRX 系列防火墙仅负责保护其响应流量被认为无法进行分析的服务器。当 SRX 系列防火墙负责保护客户端时,不应使用数据中心完全。 |
数据中心 |
禁用所有 STC 流量检测。 优化处理 TCP 错误。对于 TCP 数据包,如果在窗口中收到 SYN 并设置了 TCP 错误标志,则处理 TCP 错误并采取适当的措施。丢弃当前数据包并忽略对整个会话的检查。 数据中心配置经过优化,可提供平衡的保护和性能。 |
另见
示例:使用 IDP 传感器配置选项改进日志记录和流量分析
此示例说明如何通过配置 IDP 传感器配置选项来改进日志记录和流量分析。例如,尽管您无法使用 IDP 签名数据库创建应用程序签名,但您可以配置传感器设置来限制运行应用程序标识的会话数并限制其内存使用量。此外,当接近 IDP 会话容量和内存限制时,您可以使用这些选项记录运行情况,并分析 IDP 丢弃的流量和应用程序标识,当超过这些限制时。
要求
开始之前:
配置网络接口。
下载签名数据库。请参阅 示例:手动更新 IDP 签名数据库。应用签名是瞻博网络提供的安全包的一部分。您可以下载预定义的应用程序签名以及安全包更新。
概述
IDP 传感器监控网络,并根据 IDP 规则库中定义的特定规则检测可疑和异常的网络流量。它基于协议或应用程序将攻击对象应用于流量。应用签名使传感器能够识别在非标准端口上运行的已知和未知应用,并应用正确的攻击对象。
IDP 的默认行为是在以下情况下忽略会话:
设备中未配置 IDP 策略
达到资源限制(内存或活动会话)
如果是机箱群集,则用于故障转移会话
如果认为流量可用性比安全性更重要,则建议继续使用上述 IDP 默认行为。但是,如果安全性被认为比可用性更重要,则建议使用此示例中提供的配置更改默认行为。
您可以通过此示例实现以下目标:
尽管无法使用 IDP 签名数据库创建应用程序签名,但可以配置传感器设置以限制运行应用程序标识的会话数,并限制应用程序标识的内存使用量。您可以配置可用于保存数据包以用于识别一个 TCP 或 UDP 会话的应用程序的最大内存字节量。还可以为应用程序标识配置全局内存使用限制。当系统达到会话的指定内存限制后,将对会话禁用应用程序识别。
默认情况下,当在 SRX 系列机箱群集部署中发生到辅助节点的故障转移时,IDP 会忽略正在主节点上进行检查的故障转移会话。在此示例中,您指定自动丢弃这些会话,并将其捕获到相应的计数器中,而不是被忽略。您可以监控和分析辅助节点上发生故障切换时丢弃的会话。
默认情况下,如果超过 IDP 会话限制或资源限制,会话不会丢弃。在此示例中,您指定如果超出 IDP 会话限制或资源限制,则删除会话并添加日志记录。您可以为最大 IDP 会话限制设置最大会话偏移限制值。当 IDP 会话数超过该值时,将记录一条警告,指出存在可能丢弃 IDP 会话的情况。当 IDP 会话数降至最大 IDP 会话限制减去偏移值以下时,将记录一条消息,指出情况已恢复正常。
您可以为可用缓存内存指定较低的阈值。如果可用缓存内存降至阈值较低级别以下,则会记录一条消息,指出存在可能由于内存分配失败而丢弃 IDP 会话的情况。通过此日志,您可以控制丢弃的会话数,以后可以分析并考虑处理这些丢弃的会话。
同样,您可以指定可用缓存内存的上限阈值。如果可用 IDP 缓存内存返回到阈值上限级别,则会记录一条消息,指出可用缓存内存已恢复正常。通过此日志,您可以控制丢弃的会话数,以后可以分析并考虑处理这些丢弃的会话。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层 [edit]
级的 CLI 中,然后从配置模式进入 commit
。
set security idp sensor-configuration application-identification max-tcp-session-packet-memory 5000 set security idp sensor-configuration flow drop-if-no-policy-loaded set security idp sensor-configuration flow drop-on-failover set security idp sensor-configuration flow drop-on-limit set security idp sensor-configuration flow max-sessions-offset 5 set security idp sensor-configuration flow min-objcache-limit-lt 21 set security idp sensor-configuration flow min-objcache-limit-ut 56
分步过程
下面的示例要求您在各个配置层级中进行导航。有关作说明,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要设置 IDP 传感器配置选项:
指定应用程序标识的内存限制。
[edit security idp sensor-configuration] user@host# set application-identification max-tcp-session-packet-memory 5000
指定在加载 IDP 策略之前丢弃流量。
[edit security idp sensor-configuration flow] user@host# set drop-if-no-policy-loaded
指定丢弃 SRX 系列机箱群集部署中的故障切换会话。
[edit security idp sensor-configuration flow] user@host# set drop-on-failover
指定当超过资源限制时丢弃会话。
[edit security idp sensor-configuration flow] user@host# set drop-on-limit
注意:如果您不希望在超过资源限制时丢弃会话,请运行命令
delete drop-on-limit
。为最大 IDP 会话限制配置偏移值。
[edit ssecurity idp sensor-configuration flow] user@host# set max-sessions-offset 5
为可用缓存内存设置较低的阈值。
[edit security idp sensor-configuration flow] user@host# set min-objcache-limit-lt 21
设置可用缓存内存的上限阈值。
[edit security idp sensor-configuration flow] user@host# set min-objcache-limit-ut 56
结果
在配置模式下,输入 show security idp
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@host# show security idp sensor-configuration { application-identification { max-tcp-session-packet-memory 5000; } flow { drop-on-limit; drop-on-failover; drop-if-no-policy-loaded; max-sessions-offset 5; min-objcache-limit-lt 21; min-objcache-limit-ut 56; } }
如果完成设备配置,请从配置模式输入 commit
。
验证
验证 IDP 传感器配置设置
目的
验证 IDP 传感器配置设置。
行动
在作模式下,输入 show security idp sensor-configuration
命令。
user@host> show security idp sensor-configuration application-identification { max-tcp-session-packet-memory 5000; } flow { drop-on-limit; drop-on-failover; drop-if-no-policy-loaded; max-sessions-offset 5; min-objcache-limit-lt 21; min-objcache-limit-ut 56; } }
意义
命令 show security idp sensor-configuration
显示使用特定值设置的所有传感器配置选项。
验证 IDP 计数器
目的
验证 IDP 计数器。
行动
在作模式下,输入 show security idp counters flow
命令。
示例输出
命令-名称
IDP counters: IDP counter type Value Fast-path packets 0 Slow-path packets 0 Session construction failed 0 Session limit reached 0 Session inspection depth reached 0 Memory limit reached 0 Not a new session 0 Invalid index at ageout 0 Packet logging 0 Policy cache hits 0 Policy cache misses 0 Policy cache entries 0 Maximum flow hash collisions 0 Flow hash collisions 0 Gates added 0 Gate matches 0 Sessions deleted 0 Sessions aged-out 0 Sessions in-use while aged-out 0 TCP flows marked dead on RST/FIN 0 Policy init failed 0 Number of times Sessions exceed high mark 0 Number of times Sessions drop below low mark 0 Memory of Sessions exceeds high mark 0 Memory of Sessions drops below low mark 0 SM Sessions encountered memory failures 0 SM Packets on sessions with memory failures 0 IDP session gate creation requests 0 IDP session gate creation acknowledgements 0 IDP session gate hits 0 IDP session gate timeouts 0 Number of times Sessions crossed the CPU threshold value that is set 0 Number of times Sessions crossed the CPU upper threshold 0 Sessions constructed 0 SM Sessions ignored 0 SM Sessions dropped 0 SM Sessions interested 0 SM Sessions not interested 749 SM Sessions interest error 0 Sessions destructed 0 SM Session Create 0 SM Packet Process 0 SM ftp data session ignored by idp 0 SM Session close 0 SM Client-to-server packets 0 SM Server-to-client packets 0 SM Client-to-server L7 bytes 0 SM Server-to-client L7 bytes 0 Client-to-server flows ignored 0 Server-to-client flows ignored 0 Both directions flows ignored 0 Fail-over sessions dropped 0 Sessions dropped due to no policy 0 IDP Stream Sessions dropped due to memory failure 0 IDP Stream Sessions ignored due to memory failure 0 IDP Stream Sessions closed due to memory failure 0 IDP Stream Sessions accepted 0 IDP Stream Sessions constructed 0 IDP Stream Sessions destructed 0 IDP Stream Move Data 0 IDP Stream Sessions ignored on JSF SSL Event 0 IDP Stream Sessions not processed for no matching rules 0 IDP Stream stbuf dropped 0 IDP Stream stbuf reinjected 0 Busy pkts from stream plugin 0 Busy pkts from pkt plugin 0 bad kpp 0 Lsys policy id lookup failed sessions 0 Busy packets 0 Busy packet Errors 0 Dropped queued packets (async mode) 0 Dropped queued packets failed(async mode) 0 Reinjected packets (async mode) 0 Reinjected packets failed(async mode) 0 AI saved processed packet 0 AI-session dropped due to malloc failure before session create 0 AI-Sessions dropped due to malloc failure after create 0 AI-Packets received on sessions marked for drop due to malloc failure 0 busy packet count incremented 0 busy packet count decremented 0 session destructed in pme 0 session destruct set in pme 0 kq op hold 0 kq op drop 0 kq op route 0 kq op continue 0 kq op error 0 kq op stop 0 PME wait not set 0 PME wait set 0 PME KQ run not called 0
意义
命令 show security idp counters flow
显示用于分析已丢弃的故障转移流量、已丢弃的 IDP 流量和已丢弃的应用程序标识流量的所有计数器。
IDP 智能检测
在 SRX 系列防火墙上,如果配置的 CPU 和内存阈值超过资源限制,则 IDP 智能检测有助于设备从过载状态恢复。从 Junos OS 19.2R1 版开始,您可以开启 IDP 智能检测并动态调整,以减少 IDP 全量检测的负载。当资源限制达到配置的 CPU 和内存阈值时,IDP 不会通过调整 IDP 检查来拒绝或忽略会话。
在 Junos OS 19.2R1 版之前,当设备超过配置的 CPU 和内存阈值限制时,IDP 将拒绝或忽略新会话。
要启用 IDP 智能检测和旁路功能,请使用命令 set security idp sensor-configuration flow intel-inspect-enable
。
IDP 检测调整的优势
-
重视关键的 IDP 检查
-
避免低优先级的 IDP 检查
-
减少高系统资源使用率
调整 IDP 智能检测的安全机制
-
动态策略 - 严重、主要和次要是三个重要的签名严重性。您可以动态调整策略,以仅包含所需严重性级别的签名。要仅包含严重性的特征码,请使用命令
set security idp sensor-configuration flow intel-inspect-signature-severity critical
。要包含严重性和主要严重性的签名,请使用命令set security idp sensor-configuration flow intel-inspect-signature-severity major
。要包含严重性、主要严重性和次要严重性的签名,请使用命令set security idp sensor-configuration flow intel-inspect-signature-severity minor
。默认情况下,严重性为严重的攻击也包括在内。 -
内容解压缩 — 只有当启用英特尔检查并达到阈值时,才能避免内容解压缩。如果协议内容处于压缩状态,则协议解码器将解压缩协议内容。通过配置
set security idp sensor-configuration flow intel-inspect-disable-content-decompress
命令,可以避免对协议内容进行解压缩。 -
选择性协议 — 默认情况下,IDP 检查所有关键协议。您可以指定用于 IDP 处理的关键协议列表。要指定协议列表,请使用命令
set security idp sensor-configuration flow intel-inspect-protocols protocol
。IDP 不检查非关键协议。 -
检查深度 — 对于每个会话,默认情况下,IDP 会检查会话的所有字节。通过指定检测深度,IDP 可将检测限制为仅指定的字节数。要启用检测深度,请使用命令
set security idp sensor-configuration flow intel-inspect-session-bytes-depth value
。默认情况下,IDP 智能检测会禁用检测深度,这意味着会检测所有字节。
CPU 使用率
您可以为 IDP 检查配置阈值限制。当 CPU 使用率达到配置阈值时,IDP 智能检测被激活。
要配置阈值限制,请使用以下命令:
-
set security idp sensor-configuration flow intel-inspect-cpu-usg-threshold value
-
set security idp sensor-configuration flow intel-inspect-cpu-usg-tolerance value

CPU 使用率的行为如下:
-
当 CPU 利用率达到配置的智能检测阈值时,IDP 将停止对新会话的完全 IDP 处理。IDP 仅处理经过调整的安全检查。此行为会触发一条 syslog 消息以激活 IDP 智能检测。
-
当 CPU 使用率超过智能检测阈值且介于 IDP 旁路阈值和智能检测下限阈值之间时,IDP 继续在智能检测模式下运行。
-
IDP 在新会话上启动完全 IDP 检测,并在 CPU 利用率降至智能检测下限阈值以下时触发系统日志以停用 IDP 智能检测。
-
当 CPU 利用率达到 IDP 旁路阈值时,IDP 智能旁路功能将激活。
内存利用率
您可以为 IDP 检查配置内存限制。当内存使用量达到配置限制时,会激活 IDP 智能检测。
要配置可用内存限制,请使用以下命令:
-
set security idp sensor-configuration flow intel-inspect-free-mem-threshold value
-
set security idp sensor-configuration flow intel-inspect-mem-tolerance value

内存利用率的行为如下:
-
当内存利用率达到智能检测可用内存下限阈值时,IDP 会激活 IDP 智能检测模式。
-
当内存利用率介于智能检测内存上限阈值和内存下限阈值之间时,IDP 继续在智能检测模式下运行。
-
当内存利用率达到可用内存下限阈值时,IDP 会激活 IDP 旁路功能。
-
当内存利用率下降并超过智能检测可用内存上限阈值时,IDP 激活为正常模式。
限度
IDP 智能检测仅在主逻辑系统级别受支持。
示例:配置 IDP 智能检测
当设备超过配置的 CPU 和内存阈值限制时,IDP 智能检测可帮助设备从过载状态中恢复。
此示例说明如何启用 IDP 智能检测并动态调整 IDP 检测,以减轻完整 IDP 检测的负载。
要求
阅读 IDP 传感器配置 ,了解 IDP 智能检测和 IDP 旁路功能何时以及如何工作。
概述
Junos OS 19.2R1 之前的版本,当设备达到配置的 CPU 和内存阈值时,IDP 将忽略或拒绝新会话。此外,当设备超过上限阈值时,IDP 会丢弃现有会话和新会话的数据包。
调整 IDP 检测有助于设备逐渐增加 CPU 和内存利用率,并重视关键检测。此示例说明如何在启用 IDP 智能检测后调整 IDP 检测。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层 [edit]
级的 CLI 中,然后从配置模式进入 commit
。
set security idp sensor-configuration flow intel-inspect-enable set security idp sensor-configuration flow intel-inspect-cpu-usg-threshold 60 set security idp sensor-configuration flow intel-inspect-cpu-usg-tolerance 15 set security idp sensor-configuration flow intel-inspect-mem-tolerance 5 set security idp sensor-configuration flow intel-inspect-free-mem-threshold 30 set security idp sensor-configuration flow intel-inspect-signature-severity critical set security idp sensor-configuration flow intel-inspect-disable-content-decompress set security idp sensor-configuration flow intel-inspect-session-bytes-depth 2 set security idp sensor-configuration flow intel-inspect-protocols HTTP set security idp sensor-configuration flow intel-inspect-protocols FTP
程序
分步过程
要配置 IDP 智能检测,请执行以下作:
开启IDP智能检测。
[edit security idp sensor-configuration] user@host# set flow intel-inspect-enable
配置 CPU 阈值限制。
[edit security idp sensor-configuration] user@host# set flow intel-inspect-cpu-usg-threshold 60
配置 CPU 容差。
[edit security idp sensor-configuration] user@host# set flow intel-inspect-cpu-usg-tolerance 15
配置内存容差。
[edit security idp sensor-configuration] user@host# set security idp sensor-configuration flow intel-inspect-mem-tolerance 5
配置内存限制。
[edit security idp sensor-configuration] user@host# set security idp sensor-configuration flow intel-inspect-memory-limit-lt 30
指定严重性级别。
[edit security idp sensor-configuration] user@host# set flow intel-inspect-signature-severity critical
禁用内容解压缩。
[edit security idp sensor-configuration] user@host# set flow intel-inspect-disable-content-decompress
配置数据包检测深度。
[edit security idp sensor-configuration] user@host# set flow intel-inspect-session-bytes-depth 2
配置检查协议。
[edit security idp sensor-configuration] user@host# set flow intel-inspect-protocols HTTP user@host# set flow intel-inspect-protocols FTP
结果
在配置模式下,输入 show security idp sensor-configuration
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
[edit]
user@host# show security idp sensor-configuration
flow {
intel-inspect-enable;
intel-inspect-cpu-usg-threshold 60;
intel-inspect-cpu-usg-tolerance 15;
intel-inspect-free-mem-threshold 30;
intel-inspect-mem-tolerance 5;
intel-inspect-disable-content-decompress;
intel-inspect-session-bytes-depth 2;
intel-inspect-protocols [ HTTP FTP ];
intel-inspect-signature-severity critical;
}
如果完成设备配置,请从配置模式输入 commit
。
验证
确认配置工作正常。
验证所有 IDP 流计数器值的状态
目的
验证 IDP 智能检测是否捕获计数器值。
行动
user@host> show security idp counters flow IDP counters: IDP counter type Value Fast-path packets 580 Slow-path packets 61 Session construction failed 0 Session limit reached 0 Session inspection depth reached 0 Memory limit reached 0 Not a new session 0 Invalid index at ageout 0 Packet logging 0 Policy cache hits 58 Policy cache misses 3 Maximum flow hash collisions 0 Flow hash collisions 0 Gates added 0 Gate matches 0 Sessions deleted 62 Sessions aged-out 0 Sessions in-use while aged-out 0 TCP flows marked dead on RST/FIN 47 Policy init failed 0 Policy reinit failed 0 Number of times Sessions exceed high mark 0 Number of times Sessions drop below low mark 0 Memory of Sessions exceeds high mark 0 Memory of Sessions drops below low mark 0 SM Sessions encountered memory failures 0 SM Packets on sessions with memory failures 0 Number of times Sessions crossed the CPU threshold value that is set 0 Number of times Sessions crossed the CPU upper threshold 0 Sessions constructed 61 SM Sessions ignored 3 SM Sessions dropped 0 SM Sessions interested 61 SM Sessions not interested 101612 SM Sessions interest error 0 Sessions destructed 62 SM Session Create 58 SM Packet Process 580 SM ftp data session ignored by idp 0 SM Session close 59 SM Client-to-server packets 312 SM Server-to-client packets 268 SM Client-to-server L7 bytes 8468 SM Server-to-client L7 bytes 19952 Client-to-server flows ignored 0 Server-to-client flows ignored 0 Server-to-client flows tcp optimized 0 Client-to-server flows tcp optimized 0 Both directions flows ignored 47 Fail-over sessions dropped 0 Sessions dropped due to no policy 0 IDP Stream Sessions dropped due to memory failure 0 IDP Stream Sessions ignored due to memory failure 0 IDP Stream Sessions closed due to memory failure 0 IDP Stream Sessions accepted 0 IDP Stream Sessions constructed 0 IDP Stream Sessions destructed 0 IDP Stream Move Data 0 IDP Stream Sessions ignored on JSF SSL Event 0 IDP Stream Sessions not processed for no matching rules 0 IDP Stream stbuf dropped 0 IDP Stream stbuf reinjected 0 Busy pkts from stream plugin 0 Busy pkts from pkt plugin 0 bad kpp 0 Lsys policy id lookup failed sessions 0 NGAppID Events with no L7 App 0 NGAppID Events with no active-policy 0 NGAppID Detector failed from event handler 0 NGAppID Detector failed from API 0 Busy packets 0 Busy packet Errors 0 Dropped queued packets (async mode) 0 Dropped queued packets failed(async mode) 0 Reinjected packets (async mode) 0 Reinjected packets failed(async mode) 0 AI saved processed packet 0 busy packet count incremented 0 busy packet count decremented 0 session destructed in pme 0 session destruct set in pme 0 kq op hold 0 kq op drop 11 kq op route 47 kq op continue 522 kq op error 0 kq op stop 0 PME wait not set 0 PME wait set 0 PME KQ run not called 0 IDP sessions ignored for content decompression in intel inspect mode 47 IDP sessions ignored for bytes depth limit in intel inspect mode 0 IDP sessions ignored for protocol decoding in intel inspect mode 0 IDP sessions detected CPU usage crossed intel inspect CPU threshold 43 IDP sessions detected mem drop below intel inspect low mem threshold 0
意义
show 命令显示 IDP 智能检查的计数器。
验证 IDP 当前策略的状态
目的
验证 IDP 智能检查是否捕获了当前策略。
行动
user@host>show security idp status Intelligent Inspection State Details: State: Active State of IDP: Default, Up since: 2018-07-03 14:16:03 PDT (132w4d 09:19 ago) Packets/second: 6 Peak: 12 @ 2019-01-17 22:25:26 PST KBits/second : 249 Peak: 490 @ 2019-01-17 22:25:26 PST Latency (microseconds): [min: 0] [max: 0] [avg: 0] Packet Statistics: [ICMP: 0] [TCP: 127] [UDP: 7] [Other: 0] Flow Statistics: ICMP: [Current: 0] [Max: 6 @ 2019-01-16 20:36:17 PST] TCP: [Current: 4] [Max: 4 @ 2019-01-17 22:34:33 PST] UDP: [Current: 2] [Max: 6 @ 2019-01-17 20:03:55 PST] Other: [Current: 0] [Max: 0 @ 2016-07-03 14:16:03 PDT] Session Statistics: [ICMP: 0] [TCP: 2] [UDP: 1] [Other: 0] Number of SSL Sessions : 0 Policy Name : idp-policy-unified Running Detector Version : 12.6.130180509
意义
show security idp status 命令可显示 IDP 当前策略。虽然您已经开启了 IDP 智能巡检,但在执行 show security idp status
作命令时,IDP 智能巡检的状态可能处于非活动状态。原因是配置的 CPU 和内存阈值不超过资源限制。当 CPU 使用率达到配置的阈值时,IDP 智能检测状态变为活动状态。
特定于协议的智能卸载
当达到已检查字节的限制时,IDP 中的现有智能卸载功能将卸载会话。除此之外,检查限制不是细粒度的,它适用于所有会话,而不管协议或服务如何。
由于能够按协议启用或禁用 IDP 智能卸载,管理员可以灵活地决定哪些协议应利用卸载功能。管理员还可以配置每个协议的卸载限制。
入侵检测和防御 (IDP) 系统中的协议特定于协议的智能卸载配置功能允许您为不同的协议定制检测深度限制,从而增强性能和安全性。通过为 SSH 和 FTP 等协议配置单独的卸载限制,您可以优化资源使用并确保更高效的会话检查。
此功能通过清晰的 CLI 命令简化配置和管理,使管理员能够更轻松地根据特定网络要求实施和调整卸载设置。
配置特定于协议的卸载限制
您可以使用新选项指定协议并设置卸载限制,从而配置每个协议的卸载限制。
[编辑]
user@host# set security idp sensor-configuration global intelligent-offload-tunable ?
所有协议的卸载限制范围相同,即 0 到 4294967295 字节。所有协议的卸载限制范围相同,范围为 0 到 4294967295,以字节为单位,0 表示无限检查。
您可以配置以 KB、MB 和 GB 为单位的限制,在这种情况下,您必须分别在限制值的末尾附加 k、m 和 g。
set security idp sensor-configuration global intelligent-offload disable 命令可全局禁用智能卸载。您无法配置 set security idp sensor-configuration global intelligent-offload disable 以及按协议自定义 offload 限制。
-
如果为某个协议配置了任何卸载限制,则该卸载限制对该协议具有最高优先级。例如,如果为协议MYSQL配置了限制,则会话卸载限制是从配置中获取的,而不是从detector-capabilities.xml文件中获取的。
-
如果未为某个协议配置卸载限制,但 detector-capablities.xml 文件中存在限制,则该文件中的限制将应用于该协议。
-
如果 detector-capabilities.xml 文件中不存在协议的卸载限制,则应用默认限制 256 KB(除非智能卸载处于保守模式,在这种情况下,限制为 1 MB)。如果禁用智能卸载,则不会发生卸载。
如果使用该 set security idp sensor-configuration global intelligent-offload disable
选项,卸载功能将被禁用,它将适用于整个数据检查,直到会话关闭。
变更历史表
是否支持某项功能取决于您使用的平台和版本。使用 功能浏览器 查看您使用的平台是否支持某项功能。