3.6 Snort 規則閾值
規則閾值是不贊成的,在將來的版本中將不支持。在規則中使用detection_filters([]),或者使用event_filters([])作為獨立配置。
threshold可以作為規則的一部分包含,也可以使用引用生成器和應用它們的SID的獨立閾值。向規則添加閾值與對同一規則使用獨立閾值之間沒有功能上的區別。兩者在邏輯上存在差異。有些規則可能只有在有門檻的情況下才有意義。它們應該將閾值納入規則。例如,檢測登錄密碼嘗試過多的規則可能需要超過5次嘗試。這可以使用“limit”類型的閾值來完成。閾值特性是該規則不可分割的一部分,這是有道理的。
3.6.0.0.1 格式
threshold:
type <limit|threshold|both>,
track <by_src|by_dst>,
count <c>, seconds <s>;
| 選項 | 描述 |
|---|---|
type limit/threshold/both |
在時間間隔內的第1 m個事件上鍵入“limit”警報,然后忽略其余時間間隔內的事件。在此時間間隔內,我們看到該事件時,每隔m次輸入“threshold”警報。在看到m個事件發生后,每個時間間隔輸入一次’ both ‘警報,然后忽略該時間間隔內的任何其他事件。 |
track by_src/by_dst |
速率由源IP地址或目標IP地址跟蹤。這意味著為每個唯一的源IP地址或每個唯一的目標IP地址維護計數。端口或任何其他東西都不會被跟蹤。 |
count c |
導致超過’ event_filter ‘限制的規則匹配數(以秒為單位)。“c”必須是非零值。 |
seconds s |
“計數”的累計時間。’ s ‘必須是非零值。 |
3.6.0.1 例子
該規則每60秒記錄此SID的第一個事件。
alert tcp $external_net any -> $http_servers $http_ports
(msg:"web-misc robots.txt access"; flow:to_server, established;
uricontent:"/robots.txt"; nocase; reference:nessus,10302;
classtype:web-application-activity; threshold:type limit, track
by_src, count 1 , seconds 60; sid:1000652; rev:1;)
在60秒的時間間隔內,該規則每記錄該SID上的第10個事件。因此,如果60秒內發生的事件少于10個,則不會記錄任何內容。記錄事件后,type=threshold將啟動一個新的時間段。
alert tcp $external_net any -> $http_servers $http_ports
(msg:"web-misc robots.txt access"; flow:to_server, established;
uricontent:"/robots.txt"; nocase; reference:nessus,10302;
classtype:web-application-activity; threshold:type threshold,
track by_dst, count 10 , seconds 60 ; sid:1000652; rev:1;)
如果在此SID上觸發了至少10個事件,則該規則每60秒最多記錄一個事件。
alert tcp $external_net any -> $http_servers $http_ports
(msg:"web-misc robots.txt access"; flow:to_server, established;
uricontent:"/robots.txt"; nocase; reference:nessus,10302;
classtype:web-application-activity; threshold:type both, track
by_dst, count 10, seconds 60; sid:1000652; rev:1;)
Snort安裝使用中文手冊
推薦文章: