本文檔介紹思科安全防火牆ASA上的威脅檢測功能和配置。
思科建議瞭解ASA CLI、訪問控制和(用於VPN威脅檢測)遠端訪問VPN。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
ASA上的威脅檢測提供第3/4層前線防禦。它基於丟包統計資訊和可選的對象級別「top」報告構建基線。它不能取代專用的IPS或下一代IPS模組,後者會檢查到第7層的允許流量;兩人可以合作。
附註:這篇文章介紹了ASA CLI功能集。思科安全防火牆威脅防禦(FTD)在訪問控制策略高級設定下顯示相關但並不相同的威脅檢測功能。請勿將FTD威脅檢測視為這些命令的1:1對映。有關詳細資訊,請參閱ASA到威脅防禦功能對映文章。
威脅檢測為防火牆管理員提供識別、瞭解和(用於掃描和VPN服務)阻止攻擊的工具。它依賴於速率觸發器、對象級統計資訊和可選的自動調速。
此功能有四個元件:
運行8.0(2)及更高版本的ASA預設啟用基本威脅檢測。
它監控整個ASA出於各種原因丟棄資料包的速率。統計資訊適用於整個裝置,通常不夠精細以識別源主機。ASA監控丟棄的資料包是否存在以下事件:
大多數觸發器對映到特定的ASP丟棄原因;某些系統日誌和檢查操作也會計數。某些觸發器出現在多個威脅類別中。常見對映(非詳盡無遺):
| 基本威脅 |
觸發器/ASP丟棄原因 |
| acl-drop |
acl-drop |
| bad-packet-drop |
invalid-tcp-hdr-length invalid-ip-header inspect-dns-pak-too-long inspect-dns-id-not-matched |
| conn-limit-drop |
conn-limit |
| dos-drop |
sp-security-failed |
| fw-drop |
inspect-icmp-seq-num-not-matched inspect-dns-pak-too-long inspect-dns-id-not-matched sp-security-failed acl-drop |
| icmp-drop |
inspect-icmp-seq-num-not-matched |
| inspect-drop |
由檢查引擎觸發的幀丟棄 |
| interface-drop |
sp-security-failed no-route |
| scanning-threat |
tcp-3whs-failed tcp-not-syn sp-security-failed acl-drop inspect-icmp-seq-num-not-matched inspect-dns-pak-too-long inspect-dns-id-not-matched |
| syn攻擊 |
%ASA-6-302014系統日誌,其拆卸原因為「SYN超時」 |
對於每個事件,基本威脅檢測測量在配置的平均速率間隔(ARI)內的丟棄率,從600秒到30天。如果ARI中的事件超過配置的閾值,ASA會將其視為威脅。
有兩個閾值:平均速率和突發速率。ARI的平均速率是每秒丟棄數。突發速率使用更短的突發速率間隔(BRI)。 自8.2(1)以來,BRI是ARI的1/30,或10秒(以較高者為準)。在8.2(1)之前,BRI是ARI的1/60。10秒的最小值適用於所有軟體版本。
範例:ACL-drop average rate 400 with ARI 600 seconds表示ASA平均ACL在最近600秒內丟棄並在平均值超過400秒時記錄威脅。具有相同ARI的突發速率800使用20秒(600 / 30)的BRI。 如果20秒視窗內ACL丟棄數超過每秒800,則會記錄威脅。
當檢測到基本威脅時,ASA生成系統日誌%ASA-4-733100。如果同時超過平均速率和突發速率,ASA可以傳送兩個733100消息(每個速率型別一個),每個突發週期每個速率型別最多傳送一個消息。
運行show threat-detection rate命令以檢視平均、當前、觸發計數和事件總數。ASA儲存每個突發週期結束時的30個已完成的BRI計數。未完成的當前BRI通常排除在平均值之外。總事件計數是這30個BRI樣本中的事件總數(如果未完成的BRI已超過最早的樣本,則會出現即時異常)。
系統日誌中的突發速率是根據當前BRI中到目前為止的丟棄率計算得出的,並且會定期取樣,因此可以在BRI完成之前報告漏洞(每個BRI的每個速率型別都有一個系統日誌)。 show threat-detection rate中的突發/當前速率使用最後完成的BRI。
基本威脅檢測不會丟棄或迴避流量。它是資訊性的(監視和報告)。 效能影響微不足道,主要發生於發生丟包或潛在威脅時。
高級威脅檢測可跟蹤更精細對象的統計資訊:受TCP攔截保護的主機IP、埠、協定、ACL和伺服器。預設情況下只啟用ACL統計資訊。主機統計在高流量下對效能有顯著影響;根據需要臨時啟用它們。埠統計的影響要小一些。
對於主機、埠和協定對象,ASA跟蹤在固定視窗中傳送和接收的資料包、位元組和丟包。對於ACL,它會跟蹤這些視窗中前10個ACE(允許和拒絕)命中。在頂級ACL顯示中,不會區分允許和拒絕的ACE命中。
固定視窗為20分鐘、1小時、8小時和24小時。視窗本身不可配置。速率數{1 | 2 | 3}關鍵字(僅主機、埠和協定)控制保留多少個較長的間隔:
主機在掃描威脅主機資料庫中處於活動狀態時積累主機統計資訊,並且在處於非活動狀態的10分鐘後清除這些統計資訊。
啟用TCP攔截後,威脅檢測可以跟蹤受攻擊的前10台伺服器。TCP攔截統計資訊使用可配置的監控視窗以及平均閾值和突發閾值(在8.0(4)及更高版本中提供)。 預設值:
通過運行show threat-detection statistics和show threat-detection statistics top 命令檢視統計資訊。此功能也填充了傳統ASDM防火牆控制面板上的「頂部」圖形。
除TCP攔截已保護伺服器之外,高級威脅檢測只是提供資訊。沒有從這些統計資訊中單獨應用其他塊。
掃描威脅檢測會跟蹤在子網中太多主機或主機或子網中太多埠上建立連線的主機。預設情況下禁用。與基於IPS簽名的掃描檢測不同,ASA掃描威脅檢測維護主機資料庫(無返回活動、封閉埠訪問、某些TCP行為等的連線)。
它與基本掃描威脅類別共用速率間隔、平均速率(ARI)和突發速率(BRI)。您不能為基本與掃描配置單獨的速率。區別在於掃描威脅檢測會保留攻擊者和目標IP資料庫。僅統計允許通過ASA並建立流的流量。基本威脅檢測仍可以對ACL拒絕的流量733100行掃描威脅檢測;掃描威脅檢測則不會。
如果來自主機的流量超過掃描速率,則該主機就是攻擊者。如果到主機的流量超過,則該主機為目標。已記錄系統日誌%ASA-4-733101。可以選擇避開攻擊者(新增規避時為%ASA-4-733102,刪除時為%ASA-4-733103。) 預設迴避持續時間為3600秒(1小時),可在10到2592000秒之間配置。
使用shun的掃描威脅檢測是能夠主動丟棄其他允許的流量的兩個功能之一(另一個是VPN威脅檢測)。
對攻擊者/目標資料庫運行show threat-detection scanning-threat命令,僅對掃描 — 威脅規避運行show threat-detection shun。
附註:對於使用threat-detection scanning-threat shun except傳送高合法控制平面或組播流量(例如PIM路由器)的主機,免除這些主機,或者安裝shun時可以丟棄這些資料包。
VPN威脅檢測可保護ASA遠端訪問VPN頭端免受IPv4 DoS式攻擊。預設情況下禁用所有三個服務。當服務啟用且主機超過其閾值時,ASA會自動對該IPv4地址進行迴避,直到您刪除迴避。
服務:
即使這些攻擊失敗,它們也會消耗身份驗證和會話資源。當您設定抑制和閾值時,PAT(酒店、CGNAT)帳戶:許多有效使用者可以共用一個公共IP。使用更高的值,以便合法使用者能夠完成連線。
VPN威脅檢測僅監控出廠設定IPv4。Shuns出現在show shun中,而不是show threat-detection shun中。相關系統日誌:%ASA-6-733200(資訊)和%ASA-4-733201(超出閾值;shun已安裝。)
基本威脅檢測功能預設啟用,您可以重新啟用:
ciscoasa(config)# threat-detection basic-threat
禁用無威脅檢測基本威脅。使用show run all threat-detection的預設速率檢視
ciscoasa(config)# show run all threat-detection threat-detection rate dos-drop rate-interval 600 average-rate 100 burst-rate 400 threat-detection rate dos-drop rate-interval 3600 average-rate 80 burst-rate 320 threat-detection rate bad-packet-drop rate-interval 600 average-rate 100 burst-rate 400 threat-detection rate bad-packet-drop rate-interval 3600 average-rate 80 burst-rate 320 threat-detection rate acl-drop rate-interval 600 average-rate 400 burst-rate 800 threat-detection rate acl-drop rate-interval 3600 average-rate 320 burst-rate 640 threat-detection rate conn-limit-drop rate-interval 600 average-rate 100 burst-rate 400 threat-detection rate conn-limit-drop rate-interval 3600 average-rate 80 burst-rate 320 threat-detection rate icmp-drop rate-interval 600 average-rate 100 burst-rate 400 threat-detection rate icmp-drop rate-interval 3600 average-rate 80 burst-rate 320 threat-detection rate scanning-threat rate-interval 600 average-rate 5 burst-rate 10 threat-detection rate scanning-threat rate-interval 3600 average-rate 4 burst-rate 8 threat-detection rate syn-attack rate-interval 600 average-rate 100 burst-rate 200 threat-detection rate syn-attack rate-interval 3600 average-rate 80 burst-rate 160 threat-detection rate fw-drop rate-interval 600 average-rate 400 burst-rate 1600 threat-detection rate fw-drop rate-interval 3600 average-rate 320 burst-rate 1280 threat-detection rate inspect-drop rate-interval 600 average-rate 400 burst-rate 1600 threat-detection rate inspect-drop rate-interval 3600 average-rate 320 burst-rate 1280 threat-detection rate interface-drop rate-interval 600 average-rate 2000 burst-rate 8000 threat-detection rate interface-drop rate-interval 3600 average-rate 1600 burst-rate 6400
通過運行threat-detection rate命令調整類別。每個類別最多可以有三種費率(費率1、2和3)。 已超過的速率ID在GUI中引733100:
ciscoasa(config)# threat-detection rate acl-drop rate-interval 1200 average-rate 250 burst-rate 550
在以下範例中,當ACL捨棄超過250/sec(超過1200秒)或550/sec(超過40秒)(1200/30)時,就會產生733100。
此命令中的scanning-threat關鍵字與掃描威脅檢測共用。即使基本威脅檢測被禁用,也可以設定掃描速度。
運行threat-detection statistics命令以啟用高級統計資訊。如果沒有關鍵字,則啟用所有統計型別:
ciscoasa(config)# threat-detection statistics ? configure mode commands/options: access-list Keyword to specify access-list statistics host Keyword to specify IP statistics port Keyword to specify port statistics protocol Keyword to specify protocol statistics tcp-intercept Trace tcp intercept statistics <cr>
no threat-detection statistics(no options)刪除所有statistic命令,包括預設的threat-detection statistics access-list。
ACL統計資訊(預設設定為on):
ciscoasa(config)# threat-detection statistics access-list
主機、埠或協定,以及可選數量的速率間隔:
ciscoasa(config)# threat-detection statistics host number-of-rate 2 ciscoasa(config)# threat-detection statistics port number-of-rate 2 ciscoasa(config)# threat-detection statistics protocol number-of-rate 3
TCP攔截統計資訊(在多情景模式下也可用):
ciscoasa(config)# threat-detection statistics tcp-intercept ciscoasa(config)# threat-detection statistics tcp-intercept rate-interval 60 burst-rate 800 average-rate 600
ciscoasa(config)# threat-detection scanning-threat ciscoasa(config)# threat-detection rate scanning-threat rate-interval 1200 average-rate 10 burst-rate 20 ciscoasa(config)# threat-detection scanning-threat shun ciscoasa(config)# threat-detection scanning-threat shun duration 1000 ciscoasa(config)# threat-detection scanning-threat shun except ip-address 10.1.1.1 255.255.255.255 ciscoasa(config)# threat-detection scanning-threat shun except object-group no-shun
您可以在一行上組合shun和except,並多次輸入命令以免除更多地址或對象組。
ciscoasa(config)# threat-detection scanning-threat shun except ip-address 10.1.1.0 255.255.255.0
ciscoasa(config)# threat-detection service invalid-vpn-access ciscoasa(config)# threat-detection service remote-access-client-initiations hold-down 10 threshold 20 ciscoasa(config)# threat-detection service remote-access-authentication hold-down 10 threshold 20
使用同一命令的no形式禁用服務。使用clear threat-detection service重置計數器。
有關專用演練,請參閱為安全防火牆ASA上的遠端訪問VPN服務配置威脅檢測(文檔ID 222315。)
基本威脅檢測對效能的影響很小。高級主機統計資訊和掃描威脅檢測會佔用更多的資源,因為它們儲存的是每個主機和每個對象的資料。對特定問題進行故障排除時,暫時啟用主機統計資訊。
可捨棄否則允許流量的功能:
在啟用高級或掃描功能之前和之後監控記憶體:
ciscoasa# show threat-detection memory ciscoasa# show memory app-cache threat-detection detail
show threat-detection memory(8.3(1)+)是用於advanced-statistics memory的已記錄命令。show memory app-cache threat-detection [detail]顯示應用程式區塊快取。
請注意Windows中的威脅733100別並與show threat-detection rate關聯。然後檢查show asp drop以瞭解捨棄原因。
出於特定原因,請使用ASP丟棄捕獲:
ciscoasa# capture drop type asp-drop acl-drop ciscoasa# show capture drop 1 packet captured 1: 18:03:00.205189 10.10.10.10.60670 > 192.168.1.100.53: udp 34 Drop-reason: (acl-drop) Flow is denied by configured rule
本示例是從10.10.10.10到192.168.1.100的UDP/53資料包。
如果733100報告掃描,請暫時啟用掃描威脅檢測,以便ASA可以記錄攻擊者和目標IP。
基本威脅檢測主要對ASP已丟棄的流量進行計數,因此不需要額外的丟棄操作。例外是SYN攻擊和掃描威脅,這些威脅涉及通過ASA的流量。
如果丟棄對於環境是合法的,則提高基本速率間隔。如果是攻擊流量,則在ASA之前阻止或速率限制上游(ACL、QoS)。
對於SYN攻擊,請拒絕ACL中的源地址或啟用TCP攔截以保護目標(這樣可改為產生連線限制威脅)。 對於掃描,您可以在ACL中拒絕或使用shun啟用掃描威脅檢測。
733101列出目標主機/子網或攻擊者。對於完整清單,運行show threat-detection scanning-threat命令。
在面向攻擊者和面向目標的介面上捕獲有助於確認掃描。
如果掃描是意外的,則在上游阻止或速率限制。新增shun允許ASA在配置的持續時間內丟棄來自攻擊者的所有資料包。作為最後手段,使用ACL或TCP攔截在ASA上阻止。
如果為誤報,請提高掃描威脅率間隔。
733102列出scanning-threat shun目標。運行show threat-detection shun命令,僅掃描威脅迴避。對ASA上的每個活動shun運行show shun(掃描、VPN威脅檢測和手動shun)。
對於真正的攻擊,也會儘可能地阻止上游攻擊,因此中間裝置不會處理流量。對於誤報,請刪除掃描偏離:
ciscoasa# clear threat-detection shun ciscoasa# clear threat-detection shun 10.1.1.6
這些系統日誌將已受TCP攔截保護的主機命名為。733104是突發速率;733105是平均速率。檢查:
ciscoasa# show threat-detection statistics top tcp-intercept Top 10 protected servers under attack (sorted by average rate) Monitoring window size: 30 mins Sampling interval: 30 secs ---------------------------------------------------------------------------------- 1 192.168.1.2:5000 inside 1249 9503 2249245 Last: 10.0.0.3 (0 secs ago) 2 192.168.1.3:5000 inside 10 10 6080 10.0.0.200 (0 secs ago)
驗證連線限制是否足夠。如果可能,阻止攻擊者上游。對於誤報,請調整威脅檢測統計資訊tcp-intercept速率。
733201命名超出閾值的服務和對等體。確認方式:
ciscoasa# show threat-detection service ciscoasa# show threat-detection service remote-access-authentication details ciscoasa# show shun
被迴避的IP從服務專案清單中移除;阻塞計數器增加。如果主機是合法的(共用PAT、配置錯誤的客戶端),請刪除shun:
ciscoasa# no shun 192.168.100.101 ciscoasa# no shun 192.168.100.101 interface outside
如果地址在多個介面上被迴避,而您省略了介面,則no shun只會從一個介面上移除迴避(route-lookup)。 指定介面以清除其他介面;clear shun刪除所有介面上的所有分流。
請勿對VPN通路運行清除威脅檢測shun;該命令僅適用於掃描威脅檢測。
如果有效使用者被迴避,請提高抑制/閾值(尤其是在PAT之後)或禁用該服務,直到您調整它。
使用這些實驗方法來測試和排除故障。僅在隔離環境中運行它們。
ACL Drop、Firewall和Scanning基本類別都考慮acl-drop。要同時觸發它們,請執行以下操作:
1.在外部介面上建立拒絕TCP到達內部目標(10.11.11.11)的ACL:
access-list outside_in extended line 1 deny tcp any host 10.11.11.11 access-list outside_in extended permit ip any any access-group outside_in in interface outside
2.從外部攻擊者(10.10.10.10)運行TCP SYN掃描:
nmap -sS -T5 -p1-65535 -Pn 10.11.11.11
附註:T5以儘可能快的速度運行nmap。對於預設速率,攻擊者PC仍可能太慢。降低要檢視的類別的配置費率。將ARI和BRI設定為0會導致基本威脅檢測觸發,無論其速率如何。
3.記錄基本威脅,例如:
%ASA-4-733100: [ Scanning] drop rate-1 exceeded. Current burst rate is 19 per second, max configured rate is 10; Current average rate is 9 per second, max configured rate is 5; Cumulative total count is 5538 %ASA-4-733100: [ ACL drop] drop rate-1 exceeded. Current burst rate is 19 per second, max configured rate is 0; Current average rate is 2 per second, max configured rate is 0; Cumulative total count is 1472 %ASA-4-733100: [ Firewall] drop rate-1 exceeded. Current burst rate is 18 per second, max configured rate is 0; Current average rate is 2 per second, max configured rate is 0; Cumulative total count is 1483
附註:在此示例中,ACL-drop和防火牆ARI/BRI設定為0,因此它們始終觸發(最大配置速率顯示為0。)
1.允許TCP到達內部目標:
access-list outside_in extended line 1 permit tcp any host 10.11.11.11 access-group outside_in in interface outside
2.如果目標不存在或重置連線,則使用靜態ARP條目進行黑洞檢查:
arp inside 10.11.11.11 dead.dead.dead
3.建立簡單的TCP攔截(初始/連線限制)策略:
access-list tcp extended permit tcp any any
class-map tcp
match access-list tcp
policy-map global_policy
class tcp
set connection conn-max 2
service-policy global_policy global
從攻擊者處掃描:
nmap -sS -T5 -p1-65535 -Pn 10.11.11.11
ciscoasa(config)# show threat-detection statistics top tcp-intercept Top 10 protected servers under attack (sorted by average rate) Monitoring window size: 30 mins Sampling interval: 30 secs -------------------------------------------------------------------------------- 1 10.11.11.11:18589 outside 0 0 1 10.10.10.10 (36 secs ago) 2 10.11.11.11:47724 outside 0 0 1 10.10.10.10 (36 secs ago)
1.允許TCP到達目標(掃描威脅檢測僅跟蹤允許的已建立流):
access-list outside_in extended line 1 permit tcp any host 10.11.11.11 access-group outside_in in interface outside
2.如果需要,使用靜態ARP進行黑洞。不計算實際伺服器重置的連線。
arp inside 10.11.11.11 dead.dead.dead
3.從攻擊者處掃描。如果nmap不夠快,則降低速率或將ARI/BRI設定為0。
nmap -sS -T5 -p1-65535 -Pn 10.11.11.11
4.啟用shun時的預期日誌:
%ASA-4-733100: [ Scanning] drop rate-1 exceeded. Current burst rate is 17 per second, max configured rate is 10; Current average rate is 0 per second, max configured rate is 5; Cumulative total count is 404 %ASA-4-733101: Host 10.10.10.10 is attacking. Current burst rate is 17 per second, max configured rate is 10; Current average rate is 0 per second, max configured rate is 5; Cumulative total count is 700 %ASA-4-733102: Threat-detection adds host 10.10.10.10 to shun list
| 修訂 | 發佈日期 | 意見 |
|---|---|---|
5.0 |
16-Sep-2026
|
更新的拼寫、語法、插入的水平線到各個部分的可讀性、更新的HTTP的URL以及固定的CCW警報。 |
4.0 |
20-Jun-2023
|
重新發佈 |
3.0 |
20-Jun-2023
|
更新的PII、簡介、樣式要求、機器翻譯、檔和格式。 |
1.0 |
31-Aug-2012
|
初始版本 |