將 ArcSight 偵測規則移轉至 Microsoft Sentinel

本文說明如何識別、比較及移轉 ArcSight 偵測規則至 Microsoft Sentinel 分析規則。

識別和移轉規則

Microsoft Sentinel 會使用機器學習分析來建立高精確度且可採取動作的事件,而您的某些現有偵測可能會在 Microsoft Sentinel 中備援。 因此,請不要盲目地移轉所有偵測和分析規則。 當您識別現有的偵測規則時,請檢閱這些考量事項。

  • 請務必選取可證明規則移轉的使用案例,考慮商務優先順序和效率。
  • 確認您了解 Microsoft Sentinel 規則類型
  • 確認您了解規則術語
  • 檢閱過去 6-12 個月內未觸發任何警示的任何規則,並判斷其是否仍然相關。
  • 消除您定期忽略的低階威脅或警示。
  • 使用現有的功能,並檢查 Microsoft Sentinel 的內建分析規則是否可以處理您目前的使用案例。 因為 Microsoft Sentinel 使用機器學習分析來產生很逼真又可因應的事件,所以可能不再需要某些現有的偵測。
  • 確認已連線的資料來源,並檢閱資料連線方法。 回顧覽資料收集交談,以確認您打算在使用案例上偵測的資料深度和廣度。
  • 探索 SOC Prime Threat Detection Marketplace 之類社群資源,以檢查您的規則是否可用。
  • 考慮線上查詢轉換器 (例如 Uncoder.io) 是否適用於您的規則。
  • 如果規則不適用或無法轉換,則必須使用 KQL 查詢來手動建立規則。 檢閱規則對應以建立新的查詢。

深入了解移轉偵測規則的最佳做法

若要將分析規則移轉至 Microsoft Sentinel

  1. 請確認已備妥測試系統來處理您要移轉的每個規則。

    1. 針對已移轉的規則準備驗證程序,包括完整的測試案例和指令碼。

    2. 請確定您的小組有實用的資源來測試已移轉的規則。

    3. 確認您已連線任何必要的資料來源,並檢閱您的資料連線方法。

  2. 確認您的偵測是否可作為 Microsoft Sentinel 中的內建範本:

    • 如果內建規則已足夠,請使用內建規則範本來為您自己的工作區建立規則。

      在 Microsoft Sentinel 中,移至 [設定]> [分析] > [規則範本] 索引標籤,然後建立並更新每個相關的分析規則。

      如需詳細資訊,請參閱立即偵測威脅

    • 如果您有 Microsoft Sentinel 內建規則未涵蓋的偵測,請嘗試線上查詢轉換器 (例如 Uncoder.io),將您的查詢轉換成 KQL。

      識別觸發條件和規則動作,然後建構並檢閱您的 KQL 查詢。

    • 如果內建規則和線上規則轉換器都不夠,您必須手動建立規則。 在這種情況下,請使用下列步驟開始建立規則:

      1. 識別您想要在規則中使用的資料來源。 您想要在 Microsoft Sentinel 中的資料來源與資料表之間建立對應資料表,以識別您想要查詢的資料表。

      2. 在您想要用於規則的資料中,識別任何屬性、欄位或實體

      3. 識別您的規則準則和邏輯。 在這個階段,您可能會想要使用規則範本作為如何建構 KQL 查詢的範例。

        請考慮篩選、相互關聯規則、作用中清單、參考集、關注清單、偵測異常、彙總等等。 您可以使用舊版 SIEM 所提供的參考,以了解如何最正確對應查詢語法

      4. 識別觸發條件和規則動作,然後建構並檢閱您的 KQL 查詢。 檢閱查詢時,請考慮 KQL 最佳化指引資源。

  3. 使用每個相關使用案例測試規則。 如果未提供預期的結果,您可以檢閱 KQL,然後再測試一次。

  4. 當您滿意時,可以考慮移轉的規則。 視需要為您的規則動作建立劇本。 如需詳細資訊,請參閱使用 Microsoft Sentinel 中的劇本將威脅回應自動化

深入了解分析規則:

比較規則術語

下表可協助您釐清 Microsoft Sentinel 與 ArcSight 的規則概念比較。

ArcSight Microsoft Sentinel
規則型別 • 篩選規則
• 加入規則
• 使用中清單規則
• 等等
• 排程的查詢
• 融合
• Microsoft 安全性
• Machine Learning (ML) 行為分析
準則 在規則條件中定義 在 KQL 中定義
觸發條件 • 以動作定義
• 以彙總定義 (適用於事件彙總)
閾值:查詢結果數目
動作 • 設定事件欄位
• 傳送通知
• 建立新案例
• 新增至使用中清單
• 等等
• 建立警示或事件
• 與 Logic Apps 整合

對應和比較規則範例

使用這些範例,在各種案例中比較 ArcSight 與 Microsoft Sentinel 的規則並加以對應。

規則 Description 範例偵測規則 (ArcSight) 範例 KQL 查詢 資源
篩選 (AND) 具有 AND 條件的範例規則。 事件必須符合所有條件。 篩選 (AND) 範例 篩選 (AND) 範例 字串篩選:
字串運算子

數值篩選:
數值運算子

日期時間篩選:
ago
Datetime
between
now

剖析:
parse
extract
parse_json
parse_csv
parse_path
parse_url
篩選 (OR) 具有 OR 條件的範例規則。 事件可以符合任何條件。 篩選 (OR) 範例 篩選 (OR) 範例 字串運算子
in
巢狀篩選 具有巢狀篩選條件的範例規則。 此規則包含 MatchesFilter 陳述式,其中也含有篩選條件。 巢狀篩選範例 巢狀篩選範例 範例 KQL 函式
範例參數函式
join
where
作用中清單 (查閱) 使用 InActiveList 陳述式的範例查閱規則。 作用中清單 (查閱) 範例 作用中清單 (查閱) 範例 • 關注清單相當於作用中清單功能。 深入了解關注清單
實作查閱的其他方式
相互關聯 (比對) 此範例規則使用 Matching Event 陳述式,定義一組基本事件的符合條件。 相互關聯 (比對) 範例 相互關聯 (比對) 範例 join 運算子:
join
join 搭配時間範圍
shuffle
Broadcast
Union

define 陳述式:
let

彙總:
make_set
make_list
make_bag
pack
相互關聯 (時間範圍) 此範例規則使用 Matching Event 陳述式及 Wait time 篩選條件,定義一組基本事件的符合條件。 相互關聯 (時間範圍) 範例 相互關聯 (時間範圍) 範例 join
Microsoft Sentinel 規則與 join 陳述式

篩選 (AND) 範例:ArcSight

以下是在 ArcSight 中使用 AND 條件的範例篩選規則。

此圖表說明範例篩選規則。

篩選 (AND) 範例:KQL

以下是在 KQL 中使用 AND 條件的篩選規則。

SecurityEvent
| where EventID == 4728
| where SubjectUserName =~ "AutoMatedService"
| where isnotempty(SubjectDomainName)

此規則假設 Microsoft Monitoring Agent (MMA) 或 Azure Monitoring Agent (AMA) 收集 Windows 安全性事件。 因此,此規則會使用 Microsoft Sentinel SecurityEvent 資料表。

請考慮這些最佳作法:

  • 若要最佳化查詢,請盡可能避免不區分大小寫的運算子:=~
  • 如果值不區分大小寫,請使用 ==
  • where 陳述式開始排序篩選,以篩選出最多資料。

篩選 (OR) 範例:ArcSight

以下是在 ArcSight 中使用 OR 條件的範例篩選規則。

此圖表說明範例篩選規則。 (or)。

篩選 (OR) 範例:KQL

以下是在 KQL 中使用 OR 條件撰寫篩選規則的幾個方式。

作為第一個選項,請使用 in 陳述式:

SecurityEvent
| where SubjectUserName in
 ("Adm1","ServiceAccount1","AutomationServices")

作為第二個選項,請使用 or 陳述式:

SecurityEvent
| where SubjectUserName == "Adm1" or 
SubjectUserName == "ServiceAccount1" or 
SubjectUserName == "AutomationServices"

雖然這兩個選項在效能上都相同,但我們建議使用第一個選項,因為更容易閱讀。

巢狀篩選範例:ArcSight

以下是 ArcSight 中的範例巢狀篩選規則。

此圖表說明範例巢狀篩選規則。

以下是 /All Filters/Soc Filters/Exclude Valid Users 篩選規則。

此圖表說明 Exclude Valid Users 篩選。

巢狀篩選範例:KQL

以下是在 KQL 中使用 OR 條件撰寫篩選規則的幾個方式。

作為第一個選項,請使用具有 where 陳述式的直接篩選:

SecurityEvent
| where EventID == 4728 
| where isnotempty(SubjectDomainName) or 
isnotempty(TargetDomainName) 
| where SubjectUserName !~ "AutoMatedService"

作為第二個選項,請使用 KQL 函式:

  1. 使用 ExcludeValidUsers 別名,將下列查詢儲存為 KQL 函式。

        SecurityEvent
        | where EventID == 4728
        | where isnotempty(SubjectDomainName)
        | where SubjectUserName =~ "AutoMatedService"
        | project SubjectUserName
    
  2. 使用下列查詢來篩選 ExcludeValidUsers 別名。

        SecurityEvent    
        | where EventID == 4728
        | where isnotempty(SubjectDomainName) or 
        isnotempty(TargetDomainName)
        | where SubjectUserName !in (ExcludeValidUsers)
    

作為第三個選項,請使用參數函式:

  1. 使用 ExcludeValidUsers 作為名稱和別名來建立參數函式。

  2. 定義函式的參數。 例如:

        Tbl: (TimeGenerated:datatime, Computer:string, 
        EventID:string, SubjectDomainName:string, 
        TargetDomainName:string, SubjectUserName:string)
    
  3. parameter 函式具有下列查詢:

        Tbl
        | where SubjectUserName !~ "AutoMatedService"
    
  4. 執行下列查詢以叫用參數函式:

        let Events = (
        SecurityEvent 
        | where EventID == 4728
        );
        ExcludeValidUsers(Events)
    

作為第四個選項,請使用 join 函式:

let events = (
SecurityEvent
| where EventID == 4728
| where isnotempty(SubjectDomainName) 
or isnotempty(TargetDomainName)
);
let ExcludeValidUsers = (
SecurityEvent
| where EventID == 4728
| where isnotempty(SubjectDomainName)
| where SubjectUserName =~ "AutoMatedService"
);
events
| join kind=leftanti ExcludeValidUsers on 
$left.SubjectUserName == $right.SubjectUserName

考量:

  • 建議您使用直接篩選搭配 where 陳述式 (第一個選項),因為簡單。 若要最佳化效能,請避免使用 join (第四個選項)。
  • 若要最佳化查詢,請盡可能避免 =~!~ 不區分大小寫的運算子。 如果值不區分大小寫,請使用 ==!= 運算子。

作用中清單 (查閱) 範例:ArcSight

以下是 ArcSight 中的作用中清單 (查閱) 規則。

此圖表說明範例作用中清單規則 (查閱)。

作用中清單 (查閱) 範例:KQL

此規則假設 Microsoft Sentinel 的 [帳戶] 欄位出現 [Cyber-Ark 例外狀況帳戶] 關注清單。

let Activelist=(
_GetWatchlist('Cyber-Ark Exception Accounts')
| project Account );
CommonSecurityLog
| where DestinationUserName in (Activelist)
| where DeviceVendor == "Cyber-Ark"
| where DeviceAction == "Get File Request"
| where DeviceCustomNumber1 != ""
| project DeviceAction, DestinationUserName, 
TimeGenerated,SourceHostName, 
SourceUserName, DeviceEventClassID

where 陳述式開始排序篩選,以篩選出最多資料。

相互關聯 (比對) 範例:ArcSight

下列 ArcSight 範例規則使用 Matching Event 陳述式,定義一組基本事件的符合條件。

此圖表說明範例相互關聯規則 (比對)。

相互關聯 (比對) 範例:KQL

let event1 =(
SecurityEvent
| where EventID == 4728
);
let event2 =(
SecurityEvent
| where EventID == 4729
);
event1
| join kind=inner event2 
on $left.TargetUserName==$right.TargetUserName

最佳做法:

  • 若要最佳化查詢,請確定較小的資料表位於 join 函式的左側。
  • 如果資料表的左側相對較小 (最多 10 萬筆記錄),請新增 hint.strategy=broadcast 以提升效能。

相互關聯 (時間範圍) 範例:ArcSight

下列範例 ArcSight 規則使用 Matching Event 陳述式及 Wait time 篩選條件,定義一組基本事件的符合條件。

此圖表說明範例相互關聯規則 (時間範圍)。

相互關聯 (時間範圍) 範例:KQL

let waittime = 10m;
let lookback = 1d;
let event1 = (
SecurityEvent
| where TimeGenerated > ago(waittime+lookback)
| where EventID == 4728
| project event1_time = TimeGenerated, 
event1_ID = EventID, event1_Activity= Activity, 
event1_Host = Computer, TargetUserName, 
event1_UPN=UserPrincipalName, 
AccountUsedToAdd = SubjectUserName 
);
let event2 = (
SecurityEvent
| where TimeGenerated > ago(waittime)
| where EventID == 4729
| project event2_time = TimeGenerated, 
event2_ID = EventID, event2_Activity= Activity, 
event2_Host= Computer, TargetUserName, 
event2_UPN=UserPrincipalName,
 AccountUsedToRemove = SubjectUserName 
);
 event1
| join kind=inner event2 on TargetUserName
| where event2_time - event1_time < lookback
| where tolong(event2_time - event1_time ) >=0
| project delta_time = event2_time - event1_time,
 event1_time, event2_time,
 event1_ID,event2_ID,event1_Activity,
 event2_Activity, TargetUserName, AccountUsedToAdd,
 AccountUsedToRemove,event1_Host,event2_Host, 
 event1_UPN,event2_UPN

彙總範例:ArcSight

以下是具有彙總設定的範例 ArcSight 規則:10 分鐘內有三筆記錄相符。

此圖表說明範例彙總規則。

彙總範例:KQL

SecurityEvent
| summarize Count = count() by SubjectUserName, 
SubjectDomainName
| where Count >3

後續步驟

在本文中,您已了解如何將移轉規則從 ArcSight 對應到 Microsoft Sentinel。