在規則中指定實體風險評分
支援的服務:
整合式 SecOps
SIEM
本文說明如何在規則中使用實體風險評分。在規則中,實體風險評分的運作方式與實體背景資訊類似。您可以編寫 YARA-L 2.0 規則,將風險評分做為主要偵測方法。如要進一步瞭解風險分析規則,請參閱「建立風險分析規則」。如要進一步瞭解更多風險相關情境,請參閱「建立情境感知分析」。
如要擷取實體風險評分,請將實體與 UDM 事件彙整,並從 EntityRisk 擷取指定欄位。
以下範例說明如何建立規則,針對風險分數大於 100 的任何實體主機名稱產生偵測結果。
rule EntityRiskScore {
meta:
events:
$e1.principal.hostname != ""
$e1.principal.hostname = $hostname
$e2.graph.entity.hostname = $hostname
$e2.graph.risk_score.risk_window_size.seconds = 86400 // 24 hours
$e2.graph.risk_score.risk_score >= 100
// Run deduplication across the risk score.
$rscore = $e2.graph.risk_score.risk_score
match:
// Dedup on hostname and risk score across a 4 hour window.
$hostname, $rscore over 4h
outcome:
// Force these risk score based rules to have a risk score of zero to
// prevent self feedback loops.
$risk_score = 0
condition:
$e1 and $e2
}
這個範例規則也會使用比對區段執行自我簡化。如果規則偵測可能觸發,但主機名稱和風險評分在 4 小時內保持不變,就不會建立新的偵測。
實體風險評分規則僅支援 24 小時 (86,400 秒) 或 7 天 (604,800 秒) 的風險時間範圍。如未在規則中指定風險時間範圍大小,系統會預設為 24 小時或 7 天。
實體風險評分資料與實體比對內容資料分開儲存。如要在規則中同時使用這兩者,規則必須有兩個獨立的實體事件,一個用於實體內容,另一個用於實體風險評分,如以下範例所示:
rule EntityContextAndRiskScore {
meta:
events:
$log_in.metadata.event_type = "USER_LOGIN"
$log_in.principal.hostname = $host
$context.graph.entity.hostname = $host
$context.graph.metadata.entity_type = "ASSET"
$risk_score.graph.entity.hostname = $host
$risk_score.graph.risk_score.risk_window_size.seconds = 604800
match:
$host over 2m
outcome:
$entity_risk_score = max($risk_score.graph.risk_score.normalized_risk_score)
condition:
$log_in and $context and $risk_score and $entity_risk_score > 100
}
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求解答。