静默主机监控
本文档介绍了 Google Security Operations 如何通过静默主机监控 (SHM) 帮助您识别环境中已进入静默状态的主机。
静默主机可以指示潜在的收集器停止。
使用 SHM 的检测规则
我们建议您为 SHM 配置检测规则。
此方法会监控 UDM 字段(例如 hostname
、ip
或 mac
),并在指定时间段内未收到预期值时触发提醒。
SHM 的检测规则示例
本部分包含 SHM 的检测规则示例,您可以根据自己的具体需求使用或调整这些规则。例如,您可以修改时间段、使用其他字段(例如 ip
),或以其他方式拆分规则。
按主机名检测静默主机
以下示例通过 hostname
检测静默主机:
- 扫描 20 分钟的时间窗口。
- 使用
ip
、hostname
和mac
跟踪主机。 - 如果主机在过去 10 分钟内未收到任何事件,但在过去 20 分钟内未处于静默状态,则会发出提醒。
rule shm_using_hostname {
meta:
events:
$event.metadata.event_timestamp.seconds > timestamp.current_seconds() - 1200
// $identifier_hash = hash.sha256(strings.concat($event.principal.ip[0], $event.principal.hostname, $event.principal.mac[0]))
$silent_hostname = $event.principal.hostname
match:
$silent_hostname over 10m
outcome:
$max_event_time = max($event.metadata.event_timestamp.seconds)
$max_diff = timestamp.current_seconds() - $max_event_time
condition:
$event and $max_diff > 600
}
使用提取标签检测静默收集器
以下是针对 SHM 的检测规则示例:
- 扫描 20 分钟的时间窗口。
- 使用
ingestion_source
提取标签识别静音。 - 用于标识指定时区(在本例中为 Asia/Calcutta)中在过去 10 分钟内处于静默状态,但在过去 20 分钟内不处于静默状态的值。
rule shm_using_ingestion_label {
meta:
events:
$event.metadata.event_timestamp.seconds > timestamp.current_seconds() - 1200
$event.metadata.ingestion_labels.key = "ingestion_source"
$silent_ingestion_source = $event.metadata.ingestion_labels.value
match:
$silent_ingestion_source over 20m
outcome:
$max_time_seconds = max($event.metadata.event_timestamp.seconds)
$max_diff_seconds = timestamp.current_seconds() - $max_time_seconds
$max_timestamp = timestamp.get_timestamp($max_time_seconds, "SECOND", "Asia/Calcutta")
$current_timestamp = timestamp.get_timestamp(timestamp.current_seconds(), "SECOND", "Asia/Calcutta")
condition:
$event and $max_diff_seconds > 600
}
将 Google Cloud Monitoring 与 SHM 的提取标签搭配使用
此方法使用 Google Cloud Monitoring 根据 SHM 的提取标签监控日志提取速率。
本部分介绍了如何使用 Bindplane 设置此方法,包括以下步骤:
设置应用 SHM 提取标签的日志流水线后,您可以为每个收集器设置 Google Cloud Monitoring 提醒,以便在提取速率低于指定阈值时收到提醒。您可以配置将提醒发送到 Google SecOps 以外的各种位置,并将提醒集成到工作流中。
此方法的好处:
- 监控的是提取时间,而不是事件时间。
- 利用 Cloud Monitoring 的高级提醒功能。
此方法的缺点:
- 需要在 Google SecOps 之外进行单独配置。
- 受提取标签数量的限制。
为 SHM 配置 Bindplane,以搭配 Google Cloud Monitoring 使用
如需为 SHM 配置 Bindplane 并使用 Google Cloud Monitoring,您需要满足以下前提条件:
- 已部署且配置了 Google SecOps 标准化 处理器的 Bindplane 服务器。
- Google SecOps 标准化处理器配置为添加受支持的
log_type
和注入标签(例如ingestion_source
)。
如需配置 Bindplane 以将 SHM 与 Google Cloud Monitoring 搭配使用,请完成以下步骤:
- 在每个日志条目中将收集器服务器的主机名作为属性发送。
- 在日志标签页中,依次选择处理器 > 添加处理器 > 复制字段。
- 配置 Copy Field 处理器:
- 输入资源的简短说明。
- 选择
Logs
遥测类型。 - 将
Copy From
字段设置为Resources
。 - 将
Resource field
字段设置为host.name
。 - 将
Copy To field
字段设置为Attributes
。 - 将
Attributes Field
字段设置为chronicle_ingestion_label["ingestion_source"]
等值。
为 SHM 配置 Google Cloud Monitoring 阈值
根据预期提取速率定义阈值。较低的阈值可检测到收集器中断;较高的阈值可检测到上游日志缺口。
为 SHM 配置 Google Cloud Monitoring 阈值后,建议您监控 Chronicle Collector > Ingestion > Total Ingestion Log Count 指标。如需查看详细的示例设置说明,请参阅设置示例政策以检测静默的 Google SecOps 收集代理。
使用 Google SecOps 信息中心进行 SHM
使用 Google SecOps 信息中心查看已静默的监控主机的每日计数。
此方法非常适合查看每日概览,但不支持提醒,并且结果的延迟时间最长可达 6 小时。
需要更多帮助?从社区成员和 Google SecOps 专业人士那里获得解答。