在规则中指定实体风险评分
本文档介绍了如何在规则中使用实体风险评分信息。此过程与在规则中使用实体上下文类似。如需了解详情,请参阅创建情境感知分析。
如需检索实体风险评分,请将实体与 UDM 事件联接起来,并从 EntityRisk 检索指定字段。
以下示例展示了如何检查用户名与 UDM 事件匹配的实体的标准化风险评分是否大于 100。
rule EntityRiskScore {
meta:
events:
$log_in.metadata.event_type = "USER_LOGIN"
$log_in.principal.hostname = $host
$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 $risk_score and $entity_risk_score > 100
}
实体风险评分规则的唯一可能的风险期为 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
}