收集 STIX 威胁情报日志

支持的语言:

本文档介绍了如何使用 Bindplane 代理将 STIX 威胁情报日志注入到 Google Security Operations。

STIX(结构化威胁信息表达)是一种标准化语言和格式,用于在组织之间共享失陷指标 (IOC) 和威胁情报数据。STIX 数据通常以 JSON 或 XML 文件格式从 TAXII 服务器或威胁情报平台接收。Bindplane 代理直接从本地文件系统中收集 STIX 数据文件。

准备工作

请确保满足以下前提条件:

  • Google SecOps 实例
  • Windows Server 2016 或更高版本,或者具有 systemd 的 Linux 主机
  • 如果在代理后面运行,请确保按照 Bindplane 代理要求打开防火墙端口
  • TAXII 客户端或威胁情报平台,用于将 STIX 格式的文件(JSON 或 XML)保存到本地目录

获取 Bindplane 代理的 Google SecOps 凭据

如需向 Google SecOps 验证 Bindplane 代理的身份,请选择以下方法之一:

  • 新部署:使用 Chronicle API(选项 1)。
  • 旧版部署:继续使用数据注入身份验证文件(方法 2),直到 Ingestion API 于 2027 年 7 月 20 日停用。
  1. 登录 Google Cloud 控制台,然后选择与您的 Google SecOps 实例关联的 Google Cloud 项目。
  2. 前往 IAM 和管理 > 服务账号。
  3. 点击创建服务账号。
  4. 提供以下配置详细信息:
    • 服务账号名称:输入账号的名称(例如 bindplane-ingest)。
    • 服务账号说明:输入说明(例如 Bindplane agent log ingestion)。
  5. 点击创建并继续。
  6. 在向此服务账号授予对项目的访问权限部分,点击选择角色,然后选择 Chronicle Editor。
  7. 点击继续,然后点击完成。
  8. 点击您创建的服务账号,然后前往密钥标签页。
  9. 依次点击添加密钥 > 创建新密钥。
  10. 选择 JSON,然后点击创建。密钥文件会下载到您的计算机上。
  11. 将密钥文件另存为 Bindplane 收集器目录(Linux 上的 /opt/observiq-otel-collector/ingestion-auth.json 或 Windows 上的 C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json)中的 ingestion-auth.json,或更新 config.yaml 中的 creds_file_path 以匹配您保存该文件的路径。
  12. 前往 IAM 和管理 > 设置,然后复制项目编号。您需要此信息才能配置导出器。

方法 2:下载数据注入身份验证文件(旧版)

  1. 登录 Google SecOps 控制台。
  2. 前往 SIEM 设置> 收集代理。
  3. 下载数据注入身份验证文件。
  4. 将文件安全地保存在将要安装 Bindplane 代理的系统上。

获取 Google SecOps 客户 ID

  1. 登录 Google SecOps 控制台。
  2. 前往 SIEM 设置 > 个人资料。
  3. 复制并保存组织详细信息部分中的客户 ID。

安装 Bindplane 代理

根据以下说明,在 Windows 或 Linux 操作系统上安装 Bindplane 代理。

Windows 安装

  1. 以管理员身份打开命令提示符或 PowerShell。
  2. 运行以下命令:

    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
    
  3. 等待安装完成。

  4. 运行以下命令,验证安装是否成功:

    sc query observiq-otel-collector
    

    该服务应显示为 RUNNING。

Linux 安装

  1. 打开具有 root 或 sudo 权限的终端。
  2. 运行以下命令:

    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
    
  3. 等待安装完成。

  4. 运行以下命令,验证安装是否成功:

    sudo systemctl status observiq-otel-collector
    

    该服务应显示为 active (running)。

其他安装资源

如需了解其他安装选项和问题排查,请参阅 Bindplane 代理安装指南。

配置 Bindplane 代理以注入日志并将其发送到 Google SecOps

找到配置文件

  • Linux:

    sudo nano /opt/observiq-otel-collector/config.yaml
    
  • Windows:

    notepad "C:\Program Files\observIQ OpenTelemetry Collector\config.yaml"
    

修改配置文件

  • 将 config.yaml 的全部内容替换为以下配置:

    receivers:
      filelog:
        include:
          - /var/log/stix/*.json
        start_at: beginning
    
    exporters:
      chronicle/stix:
        protocol: https
        # Region of your instance, for example us, europe, asia-southeast1
        location: <LOCATION>
        # Project number of the Google Cloud project linked to the instance
        project: '<PROJECT_NUMBER>'
        compression: gzip
        creds_file_path: '/opt/observiq-otel-collector/ingestion-auth.json'
        customer_id: '<customer_id>'
        endpoint: chronicle.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
    • start_at:设置为 beginning 可读取现有日志,设置为 end 可仅读取新条目
  • 导出器配置:

    • stix:导出器的描述性名称
    • creds_file_path:服务账号 JSON 密钥文件的完整路径(选项 1):
      • Linux:/opt/observiq-otel-collector/ingestion-auth.json
      • Windows:C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
    • <customer_id>:上一步中的客户 ID
    • location:将 <LOCATION> 替换为 Google SecOps 实例所在的区域(例如 us、europe 或 asia-southeast1)。导出工具会在此值前面加上 chronicle.googleapis.com。如需查看完整列表,请参阅区域级端点。
    • project:将 <PROJECT_NUMBER> 替换为“IAM 和管理”>“设置”中的项目编号。
    • endpoint:保持设置为 chronicle.googleapis.com。
    • STIX:日志类型,与 Chronicle 中显示的完全一致
    • ingestion_labels:YAML 格式的可选标签(例如 env: production)
  • 流水线配置:

    • stix_to_chronicle:流水线的描述性名称

旧版提取 API 导出工具

  • 如果您使用选项 2 中的数据注入身份验证文件,请将 exporters 代码块替换为以下内容。将 creds_file_path 设置为数据注入身份验证文件的路径,如果您的实例位于美国境外,请将 malachiteingestion-pa.googleapis.com 替换为您的区域端点(例如 europe-malachiteingestion-pa.googleapis.com)。

    exporters:
      chronicle/stix:
        compression: gzip
        creds_file_path: '/opt/observiq-otel-collector/ingestion-auth.json'
        customer_id: '<customer_id>'
        endpoint: malachiteingestion-pa.googleapis.com
        log_type: STIX
        raw_log_field: body
        ingestion_labels:
          env: production
    

保存配置文件

  • 修改后,保存文件:
    • Linux:依次按 Ctrl+O、Enter 和 Ctrl+X
    • Windows:依次点击文件 > 保存

重启 Bindplane 代理以应用更改

  • 如需在 Linux 中重启 Bindplane 代理,请运行以下命令:

    sudo systemctl restart observiq-otel-collector
    
    1. 验证服务是否正在运行:

      sudo systemctl status observiq-otel-collector
      
    2. 检查日志中是否存在错误:

      sudo journalctl -u observiq-otel-collector -f
      
  • 如需在 Windows 中重启 Bindplane 代理,请选择以下选项之一:

    • 以管理员身份运行命令提示符或 PowerShell:

      net stop observiq-otel-collector && net start observiq-otel-collector
      
    • 服务控制台:

      1. 按 Win+R,输入 services.msc,然后按 Enter 键。
      2. 找到 observIQ OpenTelemetry 收集器。
      3. 右键点击,然后选择重新启动。
      4. 验证服务是否正在运行:

        sc query observiq-otel-collector
        
      5. 检查日志中的错误:

        type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"
        

配置 STIX 数据文件收集

STIX 是一种数据格式,而不是产品。STIX 威胁情报数据通常以 JSON 或 XML 文件的形式从 TAXII 客户端、威胁情报平台或手动下载中接收。您需要确保将这些文件放置在 Bindplane 代理监控的目录中。

Linux

  1. 创建一个目录来存储 STIX 数据文件:

    sudo mkdir -p /var/log/stix
    
  2. 将 TAXII 客户端或威胁情报平台配置为将 STIX 文件保存到 /var/log/stix/。

  3. 确保 Bindplane 代理服务账号具有对该目录的读取权限:

    sudo chmod 755 /var/log/stix
    

Windows

  1. 创建一个目录来存储 STIX 数据文件:

    mkdir C:\Logs\stix
    
  2. 将 TAXII 客户端或威胁情报平台配置为将 STIX 文件保存到 `C:\Logs\stix`。

  3. 更新 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_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 中的值;否则为 grok 中的 dom;如果类型为 domain-name,则为 value;否则为 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;如果模式为 grok,则为 ip;否则为 source_ip;如果类型为 ipv4,则为值;否则为 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 如果类型为 URL,则为 observable.object.properties.value 中的值;否则为 grok 中的 url_val;否则为类型为网址的值;否则为非空的 observable_properties_value
email_val, mail, value entity.user.email_addresses 如果 grok 匹配,则为 email_val 中的值;否则,如果类型为电子邮件地址,则为 grok 中的邮件;否则为值
时间戳 metadata.collected_timestamp 使用日期匹配 ISO8601/RFC 3339 进行转换
title, description metadata.description 来自标题或说明的值
entity_type metadata.entity_type 直接复制的值
时间戳、有效期限 metadata.interval.end_time 使用日期匹配 ISO8601/RFC 3339 从 timestamp 或 valid_until 转换而来
timestamp、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 中的值,如果为 no_value,则为 confidence,否则为 x_stix_confidence,否则为 x_ctix_confidence_score
值、置信度、x_ctix_confidence_score threat.confidence_score 如果名称为 Confidence Score,则为值中的值,否则为 confidence,否则为 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”,则为“value”中的值,否则为“extensions”中的得分,并转换为浮点数
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 从更新日志映射

更新日志

查看相应解析器的更新日志

需要更多帮助?获得社区成员和 Google SecOps 专业人士的解答。