收集 STIX 威胁情报日志
本文档介绍了如何使用 Bindplane 代理将 STIX 威胁情报日志注入到 Google Security Operations。
STIX(结构化威胁信息表达)是一种标准化语言和格式,用于在组织之间共享入侵指标 (IOC) 和威胁情报数据。STIX 数据通常以 JSON 或 XML 文件形式从 TAXII 服务器或威胁情报平台接收。Bindplane 代理直接从本地文件系统收集 STIX 数据文件。
准备工作
请确保满足以下前提条件:
- Google SecOps 实例
- Windows Server 2016 或更高版本,或者具有
systemd的 Linux 主机 - 如果在代理后面运行,请确保防火墙端口已根据 Bindplane 代理要求打开
- 将 STIX 格式的文件(JSON 或 XML)保存到本地目录的 TAXII 客户端或威胁情报平台
获取 Google SecOps 注入身份验证文件
- 登录 Google SecOps 控制台。
- 依次前往 SIEM 设置 > 收集代理。
- 下载数据注入身份验证文件。
将文件安全地保存在将要安装 Bindplane 的系统上。
获取 Google SecOps 客户 ID
- 登录 Google SecOps 控制台。
- 依次前往 SIEM 设置 > 配置文件。
复制并保存组织详细信息部分中的客户 ID。
安装 Bindplane 代理
按照以下说明在 Windows 或 Linux 操作系统上安装 Bindplane 代理。
Windows 安装
- 以管理员身份打开命令提示符或 PowerShell。
运行以下命令:
msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet等待安装完成。
运行以下命令,验证安装是否成功:
sc query observiq-otel-collector该服务应显示为 正在运行。
Linux 安装
- 打开具有 root 或 sudo 权限的终端。
运行以下命令:
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh等待安装完成。
运行以下命令,验证安装是否成功:
sudo systemctl status observiq-otel-collector该服务应显示为有效(正在运行)。
其他安装资源
如需了解其他安装选项和问题排查信息,请参阅 Bindplane 代理安装指南。
配置 Bindplane 代理以注入日志并将其发送到 Google SecOps
找到配置文件
Linux:
sudo nano /opt/observiq-otel-collector/config.yamlWindows:
notepad "C:\Program Files\observIQ OpenTelemetry Collector\config.yaml"
修改配置文件
将
config.yaml的全部内容替换为以下配置:receivers: filelog: include: - /var/log/stix/*.json start_at: beginning exporters: chronicle/stix: compression: gzip creds_file_path: '/etc/bindplane-agent/ingestion-auth.json' customer_id: '<customer_id>' endpoint: malachiteingestion-pa.googleapis.com log_type: STIX raw_log_field: body ingestion_labels: env: production service: pipelines: logs/stix_to_chronicle: receivers: - filelog exporters: - chronicle/stix
配置参数
替换以下占位符:
接收器配置:
filelog:用于从磁盘收集日志文件的接收器类型include:要监控的文件路径列表。将此属性设置为保存 STIX 文件的目录:- Linux:
/var/log/stix/*.json - Windows:
C:\Logs\stix\*.json
- Linux:
start_at:设置为beginning可读取现有日志,设置为end可仅读取新条目
导出器配置:
stix:导出器的描述性名称creds_file_path:提取身份验证文件的完整路径:- Linux:
/etc/bindplane-agent/ingestion-auth.json - Windows:
C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
- Linux:
<customer_id>:上一步中的客户 IDendpoint:区域端点网址:- 美国:
malachiteingestion-pa.googleapis.com - 欧洲:
europe-malachiteingestion-pa.googleapis.com - 亚洲:
asia-southeast1-malachiteingestion-pa.googleapis.com - 如需查看完整列表,请参阅区域级端点
- 美国:
STIX:日志类型,与在 Chronicle 中显示的完全一致ingestion_labels:YAML 格式的可选标签(例如env: production)
流水线配置:
stix_to_chronicle:流水线的描述性名称
保存配置文件
- 修改后,保存文件:
- Linux:依次按
Ctrl+O、Enter和Ctrl+X - Windows:依次点击文件 > 保存
- Linux:依次按
重启 Bindplane 代理以应用更改
如需在 Linux 中重启 Bindplane 代理,请运行以下命令:
sudo systemctl restart observiq-otel-collector验证服务是否正在运行:
sudo systemctl status observiq-otel-collector检查日志是否存在错误:
sudo journalctl -u observiq-otel-collector -f
如需在 Windows 中重启 Bindplane 代理,请选择以下选项之一:
以管理员身份运行命令提示符或 PowerShell:
net stop observiq-otel-collector && net start observiq-otel-collector服务控制台:
- 按
Win+R,输入services.msc,然后按 Enter 键。 - 找到 observIQ OpenTelemetry 收集器。
- 右键点击并选择重新启动。
验证服务是否正在运行:
sc query observiq-otel-collector检查日志是否存在错误:
type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"
- 按
配置 STIX 数据文件收集
STIX 是一种数据格式,而不是产品。STIX 威胁情报数据通常以 JSON 或 XML 文件的形式从 TAXII 客户端、威胁情报平台或手动下载中接收。您需要确保将这些文件放置在 Bindplane 代理监控的目录中。
Linux
创建一个目录来存储 STIX 数据文件:
sudo mkdir -p /var/log/stix将 TAXII 客户端或威胁情报平台配置为将 STIX 文件保存到
/var/log/stix/。确保 Bindplane 代理服务账号具有对该目录的读取权限:
sudo chmod 755 /var/log/stix
Windows
创建一个目录来存储 STIX 数据文件:
mkdir C:\Logs\stix将 TAXII 客户端或威胁情报平台配置为将 STIX 文件保存到 `C:\Logs\stix`。
更新
config.yaml中的 Bindplane 代理include路径,使其匹配:include: - C:\Logs\stix\*.json
UDM 映射表
| 日志字段 | UDM 映射 | 逻辑 |
|---|---|---|
| entity.administrative_domain | 设置为“TEST” | |
| assetid_value | entity.asset.asset_id | 如果 assetid_value 不为空,则返回该值 |
| condition_label、related_indicators_relationship_label、related_indicators_scope、indicator_types_label、valid_start_time_label、controlled_structure_label、marking_structure_label | entity.asset.attribute.labels | 从各种标签合并 |
| name | entity.file.full_path | 直接复制值 |
| val、hash.simple_hash_value、MD5_val、hash_value | entity.file.md5 | 如果与 MD5 正则表达式匹配,则为 val 中的值;如果类型为 MD5,则为 hash.simple_hash_value;否则为 MD5_val;否则为 hash_value |
| 值 | entity.file.names | 直接复制值 |
| val、hash.simple_hash_value、sha1_val、hash_value | entity.file.sha1 | 如果与 SHA1 正则表达式匹配,则为 val 中的值;否则,如果类型为 SHA1,则为 hash.simple_hash_value;否则,如果类型为 SHA1,则为 sha1_val;否则,为 hash_value |
| val, hash.simple_hash_value, sha256val, sha_value, sha_value | entity.file.sha256 | 如果与 sha256 正则表达式匹配,则为 val 中的值;如果类型为 SHA256,则为 hash.simple_hash_value;否则为 sha256val;否则为 sha_value |
| observable.object.properties.value、dom、value、host、name、external_references.0.source_name | entity.hostname | 如果类型为 FQDN,则为 observable.object.properties.value 中的值;否则,如果类型为 domain-name,则为 grok 中的 dom;否则,如果类型为 domain-name,则为值;否则,如果 main_observable_type 为 domain/hostname,则为 host;否则,如果 main_observable_type 为 domain/hostname,则为 name;否则,为 external_references.0.source_name |
| ip_val、ipval、ip、source_ip、value、src_ip | entity.ip | 如果 grok 匹配,则为 ip_val 中的值;如果类别为 ipv4-addr,则为 ipval;否则,如果类型为 ipv4,则为模式 grok 中的 ip;否则,为 source_ip;否则,为值;否则,为 grok 中的 src_ip |
| source_port、src_port | entity.port | 来自 source_port 或 src_port 的值 |
| indicator_label、extension_value1、extension_value2、extension_value3、extension_value4、revoked_value、spec_version_value、object_marking_ref_value、label_value | entity.resource.attribute.labels | 从各种标签合并 |
| observable.object.properties.value、url_val、value、observable_properties_value | entity.url | 如果类型为网址,则为 observable.object.properties.value 中的值;否则,如果类型为网址,则为 grok 中的 url_val;否则,如果类型为网址,则为 value;否则,如果 observable_properties_value 不为空,则为该值 |
| email_val、mail、value | entity.user.email_addresses | 如果 grok 匹配,则为 email_val 中的值;否则,如果类型为电子邮件地址,则为来自 grok 的邮件;否则为值 |
| 时间戳 | metadata.collected_timestamp | 使用日期匹配 ISO8601/RFC 3339 进行转换 |
| 标题、说明 | metadata.description | 标题或说明中的值 |
| entity_type | metadata.entity_type | 直接复制值 |
| 时间戳、有效期限 | metadata.interval.end_time | 根据时间戳或 valid_until 转换而来,使用日期匹配 ISO8601/RFC 3339 |
| 时间戳、valid_from、created | metadata.interval.start_time | 根据时间戳、valid_from、created 或时间戳转换而来,使用日期匹配 ISO8601/RFC 3339 |
| id | metadata.product_entity_id | 直接复制值 |
| 版本 | metadata.product_version | 直接复制值 |
| threat_detail | metadata.threat | 从 threat_detail 合并 |
| threat_detail_category | threat.category | 直接复制值 |
| confidence_value、confidence、x_stix_confidence、x_ctix_confidence_score | threat.confidence_details | 来自 confidence_value 的值,否则为 confidence(如果为 no_value),否则为 x_stix_confidence,否则为 x_ctix_confidence_score |
| 值、置信度、x_ctix_confidence_score | threat.confidence_score | 如果名称为“置信度得分”,则为值中的值;否则为置信度;否则为 x_ctix_confidence_score,转换为浮点数 |
| property_label、sha512_value、observable_id、observable_object_id、keyword_label | threat.detection_fields | 从各种标签合并 |
| 说明 | threat.description | 直接复制值 |
| value, extensions.extension-definition--ea279b3e-5c71-4632-ac08-831c66a786ba.score | threat.risk_score | 如果名称为“Risk”,则为值中的值;否则为扩展得分,转换为浮点数 |
| metadata.product_name | 设置为“STIX” | |
| metadata.vendor_name | 设置为“STIX” | |
dom |
event.idm.entity.entity.hostname |
从变更日志映射 |
name |
event.idm.entity.entity.url |
从变更日志映射 |
valid_from |
event.idm.entity.entity.resource.attribute.labels |
从变更日志映射 |
valid_until |
event.idm.entity.entity.resource.attribute.labels |
从变更日志映射 |
pattern_version |
event.idm.entity.entity.resource.attribute.labels |
从变更日志映射 |
observable.object.properties.value.condition |
event.idm.entity.entity.asset.attribute.labels |
从变更日志映射 |
handling.controlled_structure |
event.idm.entity.entity.asset.attribute.labels |
从变更日志映射 |
handling.marking_structures.color |
event.idm.entity.entity.asset.attribute.labels |
从变更日志映射 |
related_indicators.related_indicators |
event.idm.entity.entity.asset.attribute.labels |
从变更日志映射 |
related_indicators.scope |
event.idm.entity.entity.asset.attribute.labels |
从变更日志映射 |
indicator_types |
event.idm.entity.entity.asset.attribute.labels |
从变更日志映射 |
valid_time_positions |
event.idm.entity.entity.asset.attribute.labels |
从变更日志映射 |
observable.object.properties.custom_properties |
event.idm.entity.metadata.threat.detection_fields |
从变更日志映射 |
observable.object.properties.value |
event.ioc.domain_and_ports.domain |
从变更日志映射 |
mitre-extension-definition.extension_type |
entity.resource.attribute.labels.value |
从变更日志映射 |
sco-extension-definition.extension_type |
entity.resource.attribute.labels.value |
从变更日志映射 |
x_ctix_confidence_score |
threat_detail.confidence_score |
从变更日志映射 |
modified |
timestamp |
从变更日志映射 |
valid_from |
entity_event.metadata.interval.start_time |
从变更日志映射 |
confidence |
threat_detail.confidence_score |
从变更日志映射 |
name |
entity.entity.file.full_path |
从变更日志映射 |
description |
threat_detail.description |
从变更日志映射 |
external_references.0.source_name |
entity_event.entity.hostname |
从变更日志映射 |
entity_type |
IP_ADDRESS |
从变更日志映射 |
entity_type |
USER |
从变更日志映射 |
entity_type |
FILE |
从变更日志映射 |
entity_type |
DOMAIN_NAME |
从变更日志映射 |