在規則中指定實體風險分數

支援的國家/地區:

本文說明如何在規則中使用實體風險分數。在規則中,實體風險分數的運作方式與實體背景資訊類似。您可以編寫 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 小時或 7 天 (分別為 86,400 或 604,800 秒)。如果規則中未納入風險時間範圍大小,規則會傳回不準確的結果。

實體風險評分資料與實體內容資料會分開儲存。如要在規則中同時使用這兩者,規則必須有兩個不同的實體事件,一個用於實體內容,另一個用於實體風險評分,如下列範例所示:

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 專業人員尋求答案。