为风险分析创建规则
本文档介绍了风险分析新 YARA-L 语法功能的主要元素。如需详细了解 YARA-L,请参阅 YARA-L 2.0 语言语法。
YARA-L 指标函数
Google Security Operations 支持许多指标函数,这些函数可聚合大量历史数据。
指标函数只能在结果部分使用。所有示例函数调用都假定在多事件规则中使用。
所有使用指标函数的规则都会自动归类为多事件规则,即使它们没有匹配部分且仅使用一个事件变量也是如此。这意味着它们将计入多事件规则配额。
函数参数
指标函数可用于执行实体行为分析的规则。
例如,以下规则告知您特定 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
单个观察结果汇总为单个值所用的时间,例如平均值和最大值。window
的允许值取决于指标的周期。有效映射如下所示:
period:1h
:window:today
period:1d
:window:30d
例如,以下规则将显示特定用户 (Alice) 在过去 30 天内在给定日期内发现的身份验证失败次数最多:
$user = "alice"
$max_fail = max(metrics.auth_attempts_fail(
period:1d, window:30d,
metric:event_count_sum,
agg:max,
target.user.userid:$user
))
first-seen
类型的检测可结合使用每小时和每日指标。例如,以下规则会告知您这是否是用户首次登录此应用:
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 Security Operations 不会预先计算,但可在规则执行期间计算的指标。如需了解更多详情和要求,请参阅统计唯一指标数量。
汇总
对指标应用的聚合。汇总会应用于整个时间段(例如,过去 30 天内的最高每日值)。允许的值包括:
avg
- 每个时间段的平均值。这是一个统计平均值,其中不包括零值。
max
- 每个时间段的最大值。
min
- 每个时间段的最小值。
num_metric_periods
- 时间范围内具有非零指标值的时间段数。
stddev
- 每个时间段的值的标准差。这是不包含零值的统计标准差。
sum
- 每个时间段在整个时间范围内每个值的总和。
例如,以下规则告诉您过去 30 天内,特定用户 (Alice) 在任意给定日期内看到身份验证失败的平均次数:
$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 字段用于指标函数:
- 维度 -(必需)本文档中列出了不同的组合。您不能将指标与默认值联接(
""
用于字符串,0
用于整数)。 - 命名空间 -(可选)您只能为您在维度中指定的实体使用命名空间。例如,如果您使用
principal.asset.hostname filter
,则也可以使用principal.namespace filter
。如果您不添加命名空间过滤条件,则所有命名空间中的数据将聚合在一起。您可以使用默认值作为命名空间过滤条件。
窗口期计算
Google Security Operations 使用每日或每小时指标窗口计算指标。
每日窗口
所有每日窗口(例如 30d
)都是以相同的方式确定。Google Security Operations 使用已生成且与规则时间范围不重叠的最新可用指标数据。每日指标的计算最长可能需要 6 小时才能完成,并且要等到当天结束时(世界协调时间 (UTC))才能开始。前一天的指标数据将在世界协调时间 (UTC) 每天 6:00 或之前提供。
例如,如果规则针对世界协调时间 (UTC) 2023 年 10 月 31 日 4:00 到 2023 年 10 月 31 日 7:00 之间的事件数据运行,那么很可能会生成 2023 年 10 月 31 日的每日指标,因此指标计算将使用 2023 年 1 月 3 日和 2023 年 1 月 3 日的数据。然而,如果规则是针对世界协调时间 (UTC) 2023 年 10 月 31 日 1:00 到 2023 年 10 月 31 日 3:00 之间的事件数据运行的规则,系统可能不会生成 2023 年 10 月 30 日的每日指标,因此指标计算将使用 2023 年 2 月 29 日至 3 月 1 日(含)的数据。
每小时 today
个窗口
每小时指标时段的计算方式与每日指标时段的计算方式截然不同。today
的每小时指标窗口不是静态大小,它与每日指标的 30d
窗口不同。每小时指标窗口 today
会填充从每日窗口结束到规则时间范围开始之间的尽可能多的数据。
例如,如果规则对 2023-10-31 4:00:00 UTC 到 2023-10-31 7:00:00 UTC 2023-10-31 4:00:00 期间的事件数据运行,则每日指标计算将使用 2023-10-01 到 2023-10-01 到 2023-10-30 - 2023-10-30 期间的数据,并使用 UTC-30 - 2023-10-30 之间的数据 - 2023-10-30 - 2023-10-30(含)的数据和
统计唯一指标
有一种特殊类型的指标 num_unique_filter_values
,它不是由 Google Security Operations 预先计算的,而是在规则执行期间计算的。这是通过将现有维度汇总到预计算的指标中来实现的。例如,中的 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: *
))
此功能具有以下限制:
- 计算唯一指标数量时,只能针对 1 个过滤条件维度进行汇总。使用通配符令牌
*
作为过滤条件值来指明这一点。
Functions
本部分包含有关 Google Security Operations 支持的特定指标函数的文档。
提醒事件
对于在 Google Workspace received_bytes
中生成了许多提醒的提醒,metics.alert_event_name_count
会预计算 UDM 事件的历史值(非零值),并将该字段设为 value_sum
。
可用作过滤条件的 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
使用 USER_LOGIN
event
type
预计算 UDM 事件的历史值。
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
会预计算其中 network
.sent_bytes
大于 0 且目标端口为 53/udp
、53/tcp
或 3000/tcp
的 UDM 事件的历史值。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
会使用 PROCESS_LAUNCH
event
type
预计算 UDM 事件的历史值。
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.hostname
principal.asset.hostname
,network.http.user_agent
principal.asset.ip
principal.asset.ip
,network.http.user_agent
principal.asset.mac
principal.asset.mac
,network.http.user_agent
principal.asset.product_object_id
principal.asset.product_object_id
,network.http.user_agent
principal.user.email_addresses
principal.user.email_addresses
,network.http.user_agent
principal.user.employee_id
principal.user.employee_id
,network.http.user_agent
principal.user.product_object_id
principal.user.product_object_id
,network.http.user_agent
principal.user.userid
principal.user.userid
,network.http.user_agent
principal.user.windows_sid
principal.user.windows_sid
,network.http.user_agent
网络字节数
metrics.network_bytes_inbound
会预计算 network
.received_bytes
为非零值的 UDM 事件的历史值,并将该字段设置为 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
会使用 RESOURCE_CREATION
event
type
预计算 UDM 事件的历史值。
metrics.resource_creation_success
还要求事件至少包含一个 ALLOW
的 SecurityResult.Action
。
可用作过滤条件的 UDM 字段的完整列表
target.user
、metadata.vendor_name
、metadata.product_name
principal.user
、metadata.vendor_name
、metadata.product_name
principal.user
、principal.ip
、metadata.vendor_name
、metadata.product_name
principal.user
、target.application
、metadata.vendor_name
、metadata.product_name
target.resource.name
、metadata.vendor_name
、metadata.product_name
principal.user
、target.resource.name
、metadata.vendor_name
、metadata.product_name
principal.user
、target.location.name
、metadata.vendor_name
、metadata.product_name
删除资源
metrics.resource_deletion_success
会使用 RESOURCE_DELETION
event
type
预计算 UDM 事件的历史值,并进一步要求事件至少具有一个 ALLOW
的 SecurityResult.Actions
。
可用作过滤条件的 UDM 字段的完整列表
target.user
、metadata.vendor_name
、metadata.product_name
principal.user
、metadata.vendor_name
、metadata.product_name
principal.user
、principal.ip
、metadata.vendor_name
、metadata.product_name
principal.user
、target.application
、metadata.vendor_name
、metadata.product_name
target.resource.name
、metadata.vendor_name
、metadata.product_name
principal.user
、target.resource.name
、metadata.vendor_name
、metadata.product_name
principal.user
、target.location.name
、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 字段的完整列表
target.user
、metadata.vendor_name
、metadata.product_name
principal.user
、metadata.vendor_name
、metadata.product_name
principal.user
、principal.ip
、metadata.vendor_name
、metadata.product_name
principal.user
、target.application
、metadata.vendor_name
、metadata.product_name
target.resource.name
、metadata.vendor_name
、metadata.product_name
principal.user
、target.resource.name
、metadata.vendor_name
、metadata.product_name
principal.user
、target.location.name
、metadata.vendor_name
、metadata.product_name
限制
使用指标创建 YARA-L 规则时,请注意以下限制:
- 您不能将指标与默认值联接(
""
表示字符串,0
表示整数)。 - 默认值:
- 如果没有与事件对应的指标数据,则指标函数返回值为 0。
- 如果检测中的某个事件没有指标数据,使用
min
对该函数进行聚合可能会返回 0。 - 如需检查某个事件是否有数据,您可以使用相同过滤条件对同一事件使用
num_metric_periods
汇总方法。
- 指标函数只能在结果部分中使用。
- 由于指标函数仅在结果部分中使用,因此它们必须像汇总规则中具有匹配部分的任何其他值一样进行汇总。