使用風險分析規則的指標函式

支援的服務:

本文說明 YARA-L 2.0 語法功能的主要元素,這些功能專為風險分析設計。詳細說明如何使用專門的指標函式匯總大量歷來資料,進而提升偵測和風險評分能力。如要進一步瞭解 YARA-L,請參閱「YARA-L 2.0 總覽」。

Google Security Operations 支援多種指標函式,可匯總大量歷來資料。所有使用指標函式的規則都會自動歸類為多事件規則,即使沒有 match 區段且只使用一個事件變數也一樣。也就是說,這類規則會計入多事件規則配額。

指標函式參數

您可以將指標函式用於執行實體行為分析的規則。

範例:計算每個 IP 每日傳出位元組數上限

以下範例說明如何透過規則,計算特定 IP 位址在過去一個月內,每日傳送的最大位元組數。在這個例子中,IP 位址是以預留位置變數 ($ip) 表示。進一步瞭解預留位置變數。

$max_bytes_per_day = max(metrics.network_bytes_outbound(
    period:1d, window:30d,
    metric:value_sum,
    agg:max,
    principal.asset.ip:$ip
))

由於這些函式使用大量引數,因此範例使用具名參數,可以按照任意順序指定。參數如下:

期間

個別記錄事件合併為一項觀測所需的時間長度。只能使用 1h 和 1d。

時間範圍

個別觀測值匯總為單一值 (例如平均值和最大值) 所需的時間長度。window 的允許值取決於指標的週期。有效的對應關係如下:

period:1h:window:today

period:1d:window:30d

範例:找出特定使用者每日驗證失敗次數的高峰

範例:找出特定使用者每日驗證失敗次數的高峰 以下範例說明如何透過規則,找出特定使用者 (alice) 在一天內 (1d) 驗證失敗次數 (max(metrics.auth_attempts_fail) 的最高值,計算範圍為 30 天 (30d) 回溯期:

$user = "alice"
$max_fail = max(metrics.auth_attempts_fail(
    period:1d, window:30d,
        metric:event_count_sum,
        agg:max,
        target.user.userid:$user
))

範例:使用每小時和每日指標偵測首次登入的使用者

以下範例說明如何結合每小時和每日指標函式,找出「首次出現」的行為。這項規則會檢查當天每小時的增量,以及更廣泛的 30 天歷來資料,判斷使用者是否首次登入特定應用程式。

events:
    $e.metadata.event_type = "USER_LOGIN"
    $e.security_result.action = "ALLOW"
    $userid = $e.target.user.userid
    $app = $e.target.application
match:
    // find events from now - 4h ago, which is the recommended look-back period
    $userid, $app over 4h
outcome:
    // check hourly analytics until daily analytics are available
    $first_seen_today = max(metrics.auth_attempts_success(
        period:1h, window:today, metric:first_seen, agg:max,
        target.user.userid:$userid, target.application:$app))
    $first_seen_monthly = max(metrics.auth_attempts_success(
        period:1d, window:30d, metric:first_seen, agg:max,
        target.user.userid:$userid, target.application:$app))
condition:
    $e and ($first_seen_today = 0) and ($first_seen_monthly = 0)

指標

在每段時長,各項觀察都有多項相關聯的指標。 您必須選取其中一項,才能在整個期間內匯總。支援五種 metric 類型:

  • event_count_sum:每個期間內的不重複記錄事件數量。
  • first_seen:每個期間內相符記錄事件的首次出現時間戳記。
  • last_seen:每個期間內相符記錄事件的上次偵測時間戳記。
  • value_sum:代表該期間內所有記錄事件的位元組總數。這個值只能用於名稱中含有 bytes 的指標函式。
  • num_unique_filter_values:Google SecOps 未預先計算的指標,但可在執行規則時計算。詳情請參閱「計算不重複指標」。

Agg

套用至指標的匯總方式。並在整個期間內發揮作用 (例如過去 30 天內的每日最高值)。允許的值包括:

avg:每個週期的平均值。這是統計平均值,不含零值。

max:各期間的最大值。

min:每個時段的最小值。

num_metric_periods:時間範圍內指標值不為零的時段數量。

stddev:每個週期的價值標準差。這是統計標準差,不含零值。

sum:整個時間範圍內,每個時段各值的總和。

舉例來說,下列規則會顯示特定使用者 (Alice) 在過去 30 天內,任何一天平均驗證失敗的次數:

$user = "alice"
$avg_fail = max(metrics.auth_attempts_fail(
        period:1d, window:30d,
        metric:event_count_sum,
        agg:avg,
        target.user.userid:$user
))

下列規則會顯示特定使用者在過去 30 天內成功驗證的次數:

$total_success = max(metrics.auth_attempts_success(
        period:1d, window:30d,
        metric:event_count_sum,
        agg:sum,
        target.user.userid:$user
))

下列規則會指出特定使用者在過去 30 天內是否至少成功登入一次:

$days_success = max(metrics.auth_attempts_success(
        period:1d, window:30d,
        metric:event_count_sum,
        agg:num_metric_periods,
        target.user.userid:$user
))

下列規則會顯示特定使用者首次或最後一次成功登入的時間:

$first_seen = max(metrics.auth_attempts_success(
        period:1d, window:30d,
        metric:first_seen,
        agg:min,
        target.user.userid:$user
))
$last_seen = max(metrics.auth_attempts_success(
        period:1d, window:30d,
        metric:last_seen,
        agg:max,
        target.user.userid:$user
))

下列規則會顯示使用者在過去 30 天內,任何一天傳送的位元組數量上限:

$max_daily_bytes = max(metrics.network_bytes_outbound(
        period:1d, window:30d,
        metric:value_sum,
        agg:max,
        target.user.userid:$user
))

篩選器

篩選器可讓您在匯總指標前,依據預先計算指標中的值篩選指標 (請參閱「指標」中的值)。篩選器可以是任何有效的事件運算式 (事件區段中的單行),不含任何事件欄位或預留位置。這項條件只能包含指標類型變數。

下列規則只包含 value_sum > 10 AND event_count_sum > 2 的指標:

$max_bytes_per_day = max(metrics.network_bytes_outbound(
    period:1d, window:30d,
    metric:value_sum,
    agg:max,
    principal.asset.ip:$ip
    filter:value_sum > 10 AND event_count_sum > 2
))

有效的篩選器範例

filter:value_sum > 10 AND event_count_sum != 5
filter:event_count_sum = 100 OR event_count_sum > 1000
filter:timestamp.get_day_of_week(first_seen) = 3
無效的篩選器範例
// No placeholders in filter expressions.
filter:value_sum > $ph

// No event fields in filter expressions.
filter:event_count_sum + $e.field > 10

// No event fields in filter expressions.
filter:timestamp.subtract(first_seen, $e.metadata.timestamp)

UDM 欄位

視函式而定,指標會依據 1、2 或 3 個 UDM 欄位篩選。詳情請參閱「函式」。

指標函式會使用下列類型的 UDM 欄位:

  • 維度:(必要) 本文件列出不同的組合。您無法將指標與預設值 (字串為 "",int 為 0) 彙整。
  • 命名空間:(選用) 命名空間只能用於維度中指定的實體。舉例來說,如果您使用 principal.asset.hostname filter,也可以使用 principal.namespace filter。如未加入命名空間篩選器,系統會彙整所有命名空間的資料。您可以使用預設值做為命名空間篩選器。

視窗計算

Google Security Operations 會使用每日或每小時指標視窗計算指標。

每日時段

所有每日時間範圍 (例如 30d) 的決定方式都相同。Google Security Operations 會使用最新產生的可用指標資料,且不會與規則日期範圍重疊。每日指標的計算作業最多可能需要 6 小時才能完成,且要到世界標準時間當天結束後才會開始。前一天的指標資料會在每天世界標準時間 6:00 或之前提供。

舉例來說,如果規則執行的事件資料時間範圍是 2023 年 10 月 31 日世界標準時間 4:00 至 2023 年 10 月 31 日世界標準時間 7:00,系統可能已產生 2023 年 10 月 31 日的每日指標,因此指標計算會使用 2023 年 10 月 1 日至 2023 年 10 月 30 日 (含) 的資料。如果規則執行的事件資料時間範圍是 2023 年 10 月 31 日世界標準時間 1:00 至 2023 年 10 月 31 日世界標準時間 3:00,則 2023 年 10 月 30 日的每日指標可能尚未產生,因此指標計算會使用 2023 年 9 月 30 日至 2023 年 10 月 29 日 (含) 的資料。

每小時 today 視窗

每小時指標時間範圍的計算方式與每日指標時間範圍不同。today 的每小時指標時間範圍並非靜態大小,不像每日指標的 30d 時間範圍。每小時指標時間範圍 today 會盡可能填入每日時間範圍結束到規則時間範圍開始之間的資料。

舉例來說,如果規則執行的事件資料時間範圍是 2023-10-31 4:00:00 UTC 到 2023-10-31 7:00:00 UTC,每日指標計算會使用 2023-10-01 到 2023-10-30 (含) 的資料,每小時指標時間範圍則會使用 2023-10-31 00:00:00 UTC 到 2023-10-31 4:00:00 UTC 的資料。

計算不重複指標

有一種特殊類型的指標 num_unique_filter_values,不是由 Google SecOps 預先計算,而是在規則執行期間計算。方法是在預先計算的指標中,匯總現有維度。舉例來說, 中的 daily total count of distinct countries that a user attempted to authenticate 指標 可從 維度 target.user.userid 和 principal.ip_geo_artifact.location.country_or_region 上預先計算的 auth_attempts_total 指標衍生,方法是對後者維度執行不重複 計數匯總。

以下範例規則會計算不重複指標:

$outcome_variable = max(metrics.auth_attempts_total(
    period: 1d,
    window: 30d,
    // This metric type indicates any filter with a wildcard value should be
    // aggregated over each day to produce a new metric on-the-fly.
    metric: num_unique_filter_values,
    agg: max,
    target.user.userid: $userid,
    // Filter whose value should be counted over each day to produce the
    // num_unique_filter_values metric.
    principal.ip_geo_artifact.location.country_or_region: *
))

函式

本節提供 Google Security Operations 支援的特定指標函式說明文件。

警告事件

metrics.alert_event_name_count 會預先計算 UDM 事件的歷來值,這些事件曾由 Carbon Black、CrowdStrike Falcon、Microsoft Graph API Alerts 或 Microsoft Sentinel 產生快訊。

可做為篩選器的 UDM 欄位完整清單

  • principal.asset.asset_id, principal.process.file.full_path, principal.user.email_addresses, security_result.rule_name
  • principal.asset.asset_id, principal.process.file.full_path, principal.user.employee_id, security_result.rule_name
  • principal.asset.asset_id, principal.process.file.full_path, principal.user.product_object_id, security_result.rule_name
  • principal.asset.asset_id, principal.process.file.full_path, principal.user.userid, security_result.rule_name
  • principal.asset.asset_id, principal.process.file.full_path, principal.user.windows_sid, security_result.rule_name
  • principal.asset.asset_id, principal.process.file.full_path, security_result.rule_name
  • principal.asset.asset_id, principal.process.file.sha256, principal.user.email_addresses, security_result.rule_name
  • principal.asset.asset_id, principal.process.file.sha256, principal.user.employee_id, security_result.rule_name
  • principal.asset.asset_id, principal.process.file.sha256, principal.user.product_object_id, security_result.rule_name
  • principal.asset.asset_id, principal.process.file.sha256, principal.user.userid, security_result.rule_name
  • principal.asset.asset_id, principal.process.file.sha256, principal.user.windows_sid, security_result.rule_name
  • principal.asset.asset_id, security_result.rule_name
  • principal.asset.hostname, principal.process.file.full_path, principal.user.email_addresses, security_result.rule_name
  • principal.asset.hostname, principal.process.file.full_path, principal.user.employee_id, security_result.rule_name
  • principal.asset.hostname, principal.process.file.full_path, principal.user.product_object_id, security_result.rule_name
  • principal.asset.hostname, principal.process.file.full_path, principal.user.userid, security_result.rule_name
  • principal.asset.hostname, principal.process.file.full_path, principal.user.windows_sid, security_result.rule_name
  • principal.asset.hostname, principal.process.file.full_path, security_result.rule_name
  • principal.asset.hostname, principal.process.file.sha256, principal.user.email_addresses, security_result.rule_name
  • principal.asset.hostname, principal.process.file.sha256, principal.user.employee_id, security_result.rule_name
  • principal.asset.hostname, principal.process.file.sha256, principal.user.product_object_id, security_result.rule_name
  • principal.asset.hostname, principal.process.file.sha256, principal.user.userid, security_result.rule_name
  • principal.asset.hostname, principal.process.file.sha256, principal.user.windows_sid, security_result.rule_name
  • principal.asset.hostname, security_result.rule_name
  • principal.asset.ip, principal.process.file.full_path, principal.user.email_addresses, security_result.rule_name
  • principal.asset.ip, principal.process.file.full_path, principal.user.employee_id, security_result.rule_name
  • principal.asset.ip, principal.process.file.full_path, principal.user.product_object_id, security_result.rule_name
  • principal.asset.ip, principal.process.file.full_path, principal.user.userid, security_result.rule_name
  • principal.asset.ip, principal.process.file.full_path, principal.user.windows_sid, security_result.rule_name
  • principal.asset.ip, principal.process.file.full_path, security_result.rule_name
  • principal.asset.ip, principal.process.file.sha256, principal.user.email_addresses, security_result.rule_name
  • principal.asset.ip, principal.process.file.sha256, principal.user.employee_id, security_result.rule_name
  • principal.asset.ip, principal.process.file.sha256, principal.user.product_object_id, security_result.rule_name
  • principal.asset.ip, principal.process.file.sha256, principal.user.userid, security_result.rule_name
  • principal.asset.ip, principal.process.file.sha256, principal.user.windows_sid, security_result.rule_name
  • principal.asset.ip, security_result.rule_name
  • principal.asset.mac, principal.process.file.full_path, principal.user.email_addresses, security_result.rule_name
  • principal.asset.mac, principal.process.file.full_path, principal.user.employee_id, security_result.rule_name
  • principal.asset.mac, principal.process.file.full_path, principal.user.product_object_id, security_result.rule_name
  • principal.asset.mac, principal.process.file.full_path, principal.user.userid, security_result.rule_name
  • principal.asset.mac, principal.process.file.full_path, principal.user.windows_sid, security_result.rule_name
  • principal.asset.mac, principal.process.file.full_path, security_result.rule_name
  • principal.asset.mac, principal.process.file.sha256, principal.user.email_addresses, security_result.rule_name
  • principal.asset.mac, principal.process.file.sha256, principal.user.employee_id, security_result.rule_name
  • principal.asset.mac, principal.process.file.sha256, principal.user.product_object_id, security_result.rule_name
  • principal.asset.mac, principal.process.file.sha256, principal.user.userid, security_result.rule_name
  • principal.asset.mac, principal.process.file.sha256, principal.user.windows_sid, security_result.rule_name
  • principal.asset.mac, security_result.rule_name
  • principal.asset.product_object_id, principal.process.file.full_path, principal.user.email_addresses, security_result.rule_name
  • principal.asset.product_object_id, principal.process.file.full_path, principal.user.employee_id, security_result.rule_name
  • principal.asset.product_object_id, principal.process.file.full_path, principal.user.product_object_id, security_result.rule_name
  • principal.asset.product_object_id, principal.process.file.full_path, principal.user.userid, security_result.rule_name
  • principal.asset.product_object_id, principal.process.file.full_path, principal.user.windows_sid, security_result.rule_name
  • principal.asset.product_object_id, principal.process.file.full_path, security_result.rule_name
  • principal.asset.product_object_id, principal.process.file.sha256, principal.user.email_addresses, security_result.rule_name
  • principal.asset.product_object_id, principal.process.file.sha256, principal.user.employee_id, security_result.rule_name
  • principal.asset.product_object_id, principal.process.file.sha256, principal.user.product_object_id, security_result.rule_name
  • principal.asset.product_object_id, principal.process.file.sha256, principal.user.userid, security_result.rule_name
  • principal.asset.product_object_id, principal.process.file.sha256, principal.user.windows_sid, security_result.rule_name
  • principal.asset.product_object_id, security_result.rule_name

驗證嘗試

metrics.auth_attempts_total 會預先計算 UDM 事件的歷來值,並加上 USER_LOGIN event type。

metrics.auth_attempts_success 還要求事件至少有一個 ALLOW 的 SecurityResult.Action。

metrics.auth_attempts_fail 則要求所有 SecurityResult.Actions 都不是 ALLOW。

可做為篩選器的 UDM 欄位完整清單

  • principal.asset.asset_id
  • principal.asset.asset_id、target.asset.asset_id
  • principal.asset.asset_id、target.asset.hostname
  • principal.asset.asset_id、target.asset.ip
  • principal.asset.asset_id、target.asset.mac
  • principal.asset.asset_id、target.asset.product_object_id
  • principal.asset.hostname
  • principal.asset.hostname、target.asset.asset_id
  • principal.asset.hostname、target.asset.hostname
  • principal.asset.hostname、target.asset.ip
  • principal.asset.hostname、target.asset.mac
  • principal.asset.hostname、target.asset.product_object_id
  • principal.asset.ip
  • principal.asset.ip、target.asset.asset_id
  • principal.asset.ip、target.asset.hostname
  • principal.asset.ip、target.asset.ip
  • principal.asset.ip、target.asset.mac
  • principal.asset.ip、target.asset.product_object_id
  • principal.asset.mac
  • principal.asset.mac、target.asset.asset_id
  • principal.asset.mac、target.asset.hostname
  • principal.asset.mac、target.asset.ip
  • principal.asset.mac、target.asset.mac
  • principal.asset.mac、target.asset.product_object_id
  • principal.asset.product_object_id
  • principal.asset.product_object_id、target.asset.asset_id
  • principal.asset.product_object_id、target.asset.hostname
  • principal.asset.product_object_id、target.asset.ip
  • principal.asset.product_object_id、target.asset.mac
  • principal.asset.product_object_id、target.asset.product_object_id
  • principal.user.email_addresses
  • principal.user.email_addresses、target.asset.asset_id
  • principal.user.email_addresses、target.asset.hostname
  • principal.user.email_addresses、target.asset.ip
  • principal.user.email_addresses、target.asset.mac
  • principal.user.email_addresses、target.asset.product_object_id
  • principal.user.employee_id
  • principal.user.employee_id、target.asset.asset_id
  • principal.user.employee_id、target.asset.hostname
  • principal.user.employee_id、target.asset.ip
  • principal.user.employee_id、target.asset.mac
  • principal.user.employee_id、target.asset.product_object_id
  • principal.user.product_object_id
  • principal.user.product_object_id、target.asset.asset_id
  • principal.user.product_object_id、target.asset.hostname
  • principal.user.product_object_id、target.asset.ip
  • principal.user.product_object_id、target.asset.mac
  • principal.user.product_object_id、target.asset.product_object_id
  • principal.user.userid
  • principal.user.userid、target.asset.asset_id
  • principal.user.userid、target.asset.hostname
  • principal.user.userid、target.asset.ip
  • principal.user.userid、target.asset.mac
  • principal.user.userid、target.asset.product_object_id
  • principal.user.windows_sid
  • principal.user.windows_sid、target.asset.asset_id
  • principal.user.windows_sid、target.asset.hostname
  • principal.user.windows_sid、target.asset.ip
  • principal.user.windows_sid、target.asset.mac
  • principal.user.windows_sid、target.asset.product_object_id
  • target.application
  • target.user.email_addresses
  • target.user.email_addresses、network.tls.client.certificate.sha256
  • target.user.email_addresses、principal.ip_geo_artifact.location.country_or_region
  • target.user.email_addresses、principal.ip_geo_artifact.network.organization_name
  • target.user.email_addresses、target.application
  • target.user.employee_id
  • target.user.employee_id、network.tls.client.certificate.sha256
  • target.user.employee_id、principal.ip_geo_artifact.location.country_or_region
  • target.user.employee_id、principal.ip_geo_artifact.network.organization_name
  • target.user.employee_id、target.application
  • target.user.product_object_id
  • target.user.product_object_id、network.tls.client.certificate.sha256
  • target.user.product_object_id、principal.ip_geo_artifact.location.country_or_region
  • target.user.product_object_id、principal.ip_geo_artifact.network.organization_name
  • target.user.product_object_id、target.application
  • target.user.userid
  • target.user.userid、network.tls.client.certificate.sha256
  • target.user.userid、principal.ip_geo_artifact.location.country_or_region
  • target.user.userid、principal.ip_geo_artifact.network.organization_name
  • target.user.userid、target.application
  • target.user.windows_sid
  • target.user.windows_sid、network.tls.client.certificate.sha256
  • target.user.windows_sid、principal.ip_geo_artifact.location.country_or_region
  • target.user.windows_sid、principal.ip_geo_artifact.network.organization_name
  • target.user.windows_sid、target.application

metrics.auth_attempts_total 有其他 UDM 欄位可做為篩選器

  • target.application、target.asset.asset_id
  • target.application、target.asset.hostname
  • target.application、target.asset.ip
  • target.application、target.asset.mac
  • target.application、target.asset.product_object_id

metrics.auth_attempts_success 有其他 UDM 欄位可做為篩選器

  • network.http.user_agent
  • principal.asset.asset_id、metadata.event_type
  • principal.asset.hostname、metadata.event_type
  • principal.asset.ip、metadata.event_type
  • principal.asset.mac、metadata.event_type
  • principal.asset.product_object_id、metadata.event_type

DNS 傳出位元組

metrics.dns_bytes_outbound 會預先計算 UDM 事件的歷來值,其中 network.sent_bytes 大於 0,且目標通訊埠為 53/udp、53/tcp 或 3000/tcp。network.sent_bytes 則以 value_sum 的形式提供。

可做為篩選器的 UDM 欄位完整清單

  • principal.asset.asset_id
  • principal.asset.asset_id、target.ip
  • principal.asset.hostname
  • principal.asset.hostname、target.ip
  • principal.asset.ip
  • principal.asset.ip、target.ip
  • principal.asset.mac
  • principal.asset.mac、target.ip
  • principal.asset.product_object_id
  • principal.asset.product_object_id、target.ip
  • principal.user.email_addresses
  • principal.user.email_addresses、target.ip
  • principal.user.employee_id
  • principal.user.employee_id、target.ip
  • principal.user.product_object_id
  • principal.user.product_object_id、target.ip
  • principal.user.userid
  • principal.user.userid、target.ip
  • principal.user.windows_sid
  • principal.user.windows_sid、target.ip
  • target.ip

DNS 查詢

metrics.dns_queries_total 會預先計算 network.dns.id 中有值的 UDM 事件歷來值。

metrics.dns_queries_success 進一步要求network。dns.response_code 之前為 0 (NoError)。

metrics.dns_queries_fail 只會考量具有 network 的事件。dns.response_code大於0。

可做為篩選器的 UDM 欄位完整清單

  • principal.asset.asset_id
  • principal.asset.asset_id、network.dns_domain
  • principal.asset.asset_id、network.dns.questions.type
  • principal.asset.hostname
  • principal.asset.hostname、network.dns_domain
  • principal.asset.hostname、network.dns.questions.type
  • principal.asset.ip
  • principal.asset.ip、network.dns_domain
  • principal.asset.ip、network.dns.questions.type
  • principal.asset.mac
  • principal.asset.mac、network.dns_domain
  • principal.asset.mac、network.dns.questions.type
  • principal.asset.product_object_id
  • principal.asset.product_object_id、network.dns_domain
  • principal.asset.product_object_id、network.dns.questions.type
  • principal.user.email_addresses
  • principal.user.email_addresses、network.dns_domain
  • principal.user.email_addresses、network.dns.questions.type
  • principal.user.employee_id
  • principal.user.employee_id、network.dns_domain
  • principal.user.employee_id、network.dns.questions.type
  • principal.user.product_object_id
  • principal.user.product_object_id、network.dns_domain
  • principal.user.product_object_id、network.dns.questions.type
  • principal.user.userid
  • principal.user.userid、network.dns_domain
  • principal.user.userid、network.dns.questions.type
  • principal.user.windows_sid
  • principal.user.windows_sid、network.dns_domain
  • principal.user.windows_sid、network.dns.questions.type

檔案執行

metrics.file_executions_total 會預先計算 UDM 事件的歷來值,並加上 PROCESS_LAUNCH event type。

metrics.file_executions_success 進一步要求事件至少有一個 ALLOW 的 SecurityResult.Action。

metrics.file_executions_fail 則要求所有 SecurityResult.Actions 都不是 ALLOW。

可做為篩選器的 UDM 欄位完整清單

  • metadata.event_type、principal.process.file.sha256
  • metadata.event_type、principal.asset.asset_id、principal.process.file.sha256
  • metadata.event_type、principal.asset.hostname、principal.process.file.sha256
  • metadata.event_type、principal.asset.ip、principal.process.file.sha256
  • metadata.event_type、principal.asset.mac、principal.process.file.sha256
  • metadata.event_type、principal.asset.product_object_id、principal.process.file.sha256
  • metadata.event_type、principal.user.email_addresses、principal.process.file.sha256
  • metadata.event_type、principal.user.employee_id、principal.process.file.sha256
  • metadata.event_type、principal.user.product_object_id、principal.process.file.sha256
  • metadata.event_type、principal.user.userid、principal.process.file.sha256
  • metadata.event_type、principal.user.windows_sid、principal.process.file.sha256

HTTP 查詢

metrics.http_queries_total 會預先計算 network.http.method 中有值的 UDM 事件歷來值。

metrics.http_queries_success 進一步要求network。http.response_code小於 400。

metrics.http_queries_fail 只會考量具有 network 的事件。http.response_code 大於或等於 400。

可做為篩選器的 UDM 欄位完整清單

  • principal.asset.asset_id
  • principal.asset.asset_id、network.http.user_agent
  • principal.asset.asset_id、target.hostname
  • principal.asset.asset_id、network.http.user_agent、target.hostname
  • principal.asset.hostname
  • principal.asset.hostname、network.http.user_agent
  • principal.asset.hostname、target.hostname
  • principal.asset.hostname、network.http.user_agent、target.hostname
  • principal.asset.ip
  • principal.asset.ip、network.http.user_agent
  • principal.asset.ip、target.hostname
  • principal.asset.ip、network.http.user_agent、target.hostname
  • principal.asset.mac
  • principal.asset.mac、network.http.user_agent
  • principal.asset.mac、target.hostname
  • principal.asset.mac、network.http.user_agent、target.hostname
  • principal.asset.product_object_id
  • principal.asset.product_object_id、network.http.user_agent
  • principal.asset.product_object_id、target.hostname
  • principal.asset.product_object_id、network.http.user_agent、target.hostname
  • principal.user.email_addresses
  • principal.user.email_addresses、network.http.user_agent
  • principal.user.email_addresses、target.hostname
  • principal.user.email_addresses、network.http.user_agent、target.hostname
  • principal.user.employee_id
  • principal.user.employee_id、network.http.user_agent
  • principal.user.employee_id、target.hostname
  • principal.user.employee_id、network.http.user_agent、target.hostname
  • principal.user.product_object_id
  • principal.user.product_object_id、network.http.user_agent
  • principal.user.product_object_id、target.hostname
  • principal.user.product_object_id、network.http.user_agent、target.hostname
  • principal.user.userid
  • principal.user.userid、network.http.user_agent
  • principal.user.userid、target.hostname
  • principal.user.userid、network.http.user_agent、target.hostname
  • principal.user.windows_sid
  • principal.user.windows_sid、network.http.user_agent
  • principal.user.windows_sid、target.hostname
  • principal.user.windows_sid、network.http.user_agent、target.hostname
  • target.hostname

網路位元組

metrics.network_bytes_inbound 會預先計算 UDM 事件的歷來值,這些事件的 network.received_bytes 值不為零,並將該欄位設為 value_sum。

metrics.network_bytes_outbound 需要 network 的非零值。sent_bytes,並將該欄位設為 value_sum。

metrics.network_bytes_total 會考量 network.received_bytes 或 network.sent_bytes (或兩者) 具有非零值的事件,並將這兩個欄位的總和設為 value_sum。

可做為篩選器的 UDM 欄位完整清單

  • principal.asset.asset_id
  • principal.asset.asset_id、principal.ip_geo_artifact.location.country_or_region
  • principal.asset.asset_id、security_result.category
  • principal.asset.asset_id、target.ip_geo_artifact.network.organization_name
  • principal.asset.hostname
  • principal.asset.hostname、principal.ip_geo_artifact.location.country_or_region
  • principal.asset.hostname、security_result.category
  • principal.asset.hostname、target.ip_geo_artifact.network.organization_name
  • principal.asset.ip
  • principal.asset.ip、principal.ip_geo_artifact.location.country_or_region
  • principal.asset.ip、security_result.category
  • principal.asset.ip、target.ip_geo_artifact.network.organization_name
  • principal.asset.mac
  • principal.asset.mac、principal.ip_geo_artifact.location.country_or_region
  • principal.asset.mac、security_result.category
  • principal.asset.mac、target.ip_geo_artifact.network.organization_name
  • principal.asset.product_object_id
  • principal.asset.product_object_id、principal.ip_geo_artifact.location.country_or_region
  • principal.asset.product_object_id、security_result.category
  • principal.asset.product_object_id、target.ip_geo_artifact.network.organization_name
  • principal.user.email_addresses
  • principal.user.email_addresses、principal.ip_geo_artifact.location.country_or_region
  • principal.user.email_addresses、security_result.category
  • principal.user.email_addresses、target.ip_geo_artifact.network.organization_name
  • principal.user.employee_id
  • principal.user.employee_id、principal.ip_geo_artifact.location.country_or_region
  • principal.user.employee_id、security_result.category
  • principal.user.employee_id、target.ip_geo_artifact.network.organization_name
  • principal.user.product_object_id
  • principal.user.product_object_id、principal.ip_geo_artifact.location.country_or_region
  • principal.user.product_object_id、security_result.category
  • principal.user.product_object_id、target.ip_geo_artifact.network.organization_name
  • principal.user.userid
  • principal.user.userid、principal.ip_geo_artifact.location.country_or_region
  • principal.user.userid、security_result.category
  • principal.user.userid、target.ip_geo_artifact.network.organization_name
  • principal.user.windows_sid
  • principal.user.windows_sid、principal.ip_geo_artifact.location.country_or_region
  • principal.user.windows_sid、security_result.category
  • principal.user.windows_sid、target.ip_geo_artifact.network.organization_name

建立資源

metrics.resource_creation_total 會預先計算 UDM 事件的歷來值,其中包含 RESOURCE_CREATION event type 或 USER_RESOURCE_CREATION event type。

如需對等事件類型清單,請參閱「中繼資料事件類型」

metrics.resource_creation_success 還要求事件至少有一個 ALLOW 的 SecurityResult.Action。

可做為篩選器的 UDM 欄位完整清單

  • principal.user.email_addresses、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、metadata.vendor_name、metadata.product_name
  • principal.user.userid、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.userid、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.userid、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.userid、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.userid、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • principal.user.userid、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • target.user.email_addresses、metadata.vendor_name、metadata.product_name
  • target.user.employee_id、metadata.vendor_name、metadata.product_name
  • target.user.product_object_id、metadata.vendor_name、metadata.product_name
  • target.user.userid、metadata.vendor_name、metadata.product_name
  • target.user.windows_sid、metadata.vendor_name、metadata.product_name

刪除資源

metrics.resource_deletion_success 會預先計算 RESOURCE_DELETION event type 的 UDM 事件歷來值,並進一步要求事件至少有一個 ALLOW 的 SecurityResult.Actions。

可做為篩選器的 UDM 欄位完整清單

  • principal.user.email_addresses、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、metadata.vendor_name、metadata.product_name
  • principal.user.userid、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.userid、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.userid、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.userid、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.userid、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • principal.user.userid、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • target.user.email_addresses、metadata.vendor_name、metadata.product_name
  • target.user.employee_id、metadata.vendor_name、metadata.product_name
  • target.user.product_object_id、metadata.vendor_name、metadata.product_name
  • target.user.userid、metadata.vendor_name、metadata.product_name
  • target.user.windows_sid、metadata.vendor_name、metadata.product_name

資源讀取

metrics.resource_read_success 會預先計算 RESOURCE_READ event type 的 UDM 事件歷來值,並進一步要求事件至少有一個 ALLOW 的 SecurityResult.Action。

metrics.resource_read_fail 則要求所有 SecurityResult.Actions 都不是 ALLOW。

可做為篩選器的 UDM 欄位完整清單

  • principal.user.email_addresses、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、metadata.vendor_name、metadata.product_name
  • principal.user.userid、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.userid、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、principal.ip、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.userid、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、target.application、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.userid、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、target.application、target.location.name、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.userid、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、target.resource.name、metadata.vendor_name、metadata.product_name
  • principal.user.email_addresses、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • principal.user.employee_id、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • principal.user.product_object_id、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • principal.user.userid、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • principal.user.windows_sid、target.resource.name、target.resource_type、metadata.vendor_name、metadata.product_name
  • target.user.email_addresses、metadata.vendor_name、metadata.product_name
  • target.user.employee_id、metadata.vendor_name、metadata.product_name
  • target.user.product_object_id、metadata.vendor_name、metadata.product_name
  • target.user.userid、metadata.vendor_name、metadata.product_name
  • target.user.windows_sid、metadata.vendor_name、metadata.product_name

指標限制

使用指標建立 YARA-L 規則時,請注意下列限制:

  • 您無法將指標與預設值 (字串為 "",int 為 0) 彙整。
  • 預設值:
    • 如果沒有與事件對應的指標資料,指標函式傳回的值會是 0。
    • 如果偵測到的事件沒有指標資料,使用 min 匯總函式可能會傳回 0。
    • 如要檢查事件是否有資料,可以使用相同篩選器,對該事件進行 num_metric_periods 指標匯總。
  • 指標函式只能用於結果區段。
  • 由於指標函式只能用於結果部分,因此必須像規則中具有比對部分的其他值一樣進行匯總。

還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求解答。