收集 Nokia 路由器日志

支持:

本文档介绍了如何使用 Bindplane 代理将 Nokia 路由器日志注入到 Google Security Operations。

Nokia Service Router 是一款网络路由器,可针对 BGP 事件、接口状态更改、MKA 会话、LLDP 邻居发现、IS-IS 路由和安全过滤条件匹配生成 syslog 消息。解析器使用 grok 模式从 syslog 格式的日志中提取字段,并将其映射到统一数据模型 (UDM)。

准备工作

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

  • Google SecOps 实例
  • Windows Server 2016 或更高版本,或者具有 systemd 的 Linux 主机
  • Bindplane 代理与 Nokia Service Router 之间的网络连接
  • 如果通过代理运行,请确保防火墙端口根据 Bindplane 代理要求处于开放状态
  • 对 Nokia 路由器的特权访问权限

获取 Bindplane 代理的 Google SecOps 凭据

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

  • 新部署:使用 Chronicle API(选项 1)。
  • 旧版部署:继续使用提取身份验证文件(方法 2),直到提取 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
    

    该服务应显示为有效(正在运行)。

其他安装资源

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

配置 Bindplane 代理以注入 Syslog 并发送到 Google SecOps

找到配置文件

  • Linux:

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

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

修改配置文件

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

    receivers:
      udplog:
        listen_address: "0.0.0.0:514"
    
    exporters:
      chronicle/nokia_router:
        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: NOKIA_ROUTER
        raw_log_field: body
    
    service:
      pipelines:
        logs/nokia_router_to_chronicle:
          receivers:
            - udplog
          exporters:
            - chronicle/nokia_router
    

配置参数

替换以下占位符:

  • 接收器配置:

    • listen_address:要监听的 IP 地址和端口:
      • 0.0.0.0 在所有接口上监听(推荐)
      • 端口 514 是标准 syslog 端口(在 Linux 上需要 root 权限;对于非 root 用户,请使用 1514)
  • 导出器配置:

    • 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:从 Google SecOps 控制台复制的客户 ID
    • location:将 <LOCATION> 替换为 Google SecOps 实例所在的区域(例如 us、europe 或 asia-southeast1)。导出工具会在此值前面加上 chronicle.googleapis.com。如需查看完整列表,请参阅区域级端点。
    • project:将 <PROJECT_NUMBER> 替换为 IAM 和管理 > 设置中的项目编号。
    • endpoint:保持设置为 chronicle.googleapis.com。

旧版提取 API

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

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

保存配置文件

  • 修改后,保存文件:
    • 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"
        

在 Nokia 服务路由器上配置 syslog

  1. 进入配置模式:

    config# log
    
  2. 定义 syslog 目标:

    config>log# syslog 1
    
  3. 配置 syslog 参数:

    config>log>syslog# address <syslog-server-ip>
    config>log>syslog# port <port-number>
    config>log>syslog# facility local0
    config>log>syslog# level info
    config>log>syslog# log-prefix "Nokia-SR"
    config>log>syslog# description "Syslog to Bindplane"
    
    • 将 <syslog-server-ip> 替换为 Bindplane 代理 IP 地址,并将 <port-number> 替换为相应端口(例如,UDP 为 514)。
  4. 将 syslog 目标位置应用于日志文件:

    config>log# log-id 1
    config>log>log-id# to syslog 1
    
  5. 启用日志文件:

    config>log>log-id# no shutdown
    
  6. 保存配置:

    config>log>log-id# exit
    config>log# save
    

UDM 映射表

日志字段 UDM 映射 逻辑
%{SYSLOGTIMESTAMP:date_time} metadata.event_timestamp 从原始日志中提取并转换为时间戳。
%{IP:src_ip} principal.ip 从原始日志中提取。
%{HOSTNAME:host_name} principal.hostname 从原始日志中提取。
%{INT:sequence_id} metadata.product_log_id 从原始日志中提取。
%{DATA:router_name} metadata.product_name 从原始日志中提取。
%{DATA:application} target.application 从原始日志中提取。
%{WORD:severity} security_result.severity 根据以下逻辑从原始日志严重级别映射:
- CLEARED、INFO -> INFORMATIONAL
- MINOR -> ERROR
- WARNING -> LOW
- MAJOR -> HIGH
- CRITICAL -> CRITICAL
%{DATA:event_name} metadata.product_event_type 从原始日志中提取。
%{INT:event_id} additional.fields.value.string_value 从原始日志中提取,并放置在键为 Event Id 的 additional fields 中。
%{GREEDYDATA:message1} 用于根据 event_name 提取各种字段。请参阅下文,了解特定字段的逻辑。
Group %{NOTSPACE:group_id} target.group.product_object_id 当 event_name 与 BGP 事件相关时,从 message1 中提取。
%{WORD} %{IP:dest_ip} target.ip 当 event_name 与 BGP 事件相关时,从 message1 中提取。
%{GREEDYDATA:desc} security_result.description 从 message1 中提取,适用于各种 event_name 场景。
SAP %{DATA:sap_id} additional.fields.value.string_value 当 event_name 为 sapStatusChanged 时,从 message1 中提取并放置在键为 SAP Id 的 additional fields 中。
in service %{INT:service_id} additional.fields.value.string_value 当 event_name 为 sapStatusChanged 时,从 message1 中提取并放置在键为 Service Id 的 additional fields 中。
\\(customer %{INT:customer_id}\\) additional.fields.value.string_value 当 event_name 为 sapStatusChanged 时,从 message1 中提取并放置在键为 Customer Id 的 additional fields 中。
admin=%{WORD:admin_status} additional.fields.value.string_value 当 event_name 为 sapStatusChanged 时,从 message1 中提取并放置在键为 Admin Status 的 additional fields 中。
oper=%{WORD:operation_status} additional.fields.value.string_value 当 event_name 为 sapStatusChanged 时,从 message1 中提取并放置在键为 Operation Status 的 additional fields 中。
flags=%{WORD:flag} additional.fields.value.string_value 当 event_name 为 sapStatusChanged 时,从 message1 中提取并放置在键为 Flag 的 additional fields 中。
with MI:SCI %{DATA:mi_sci} additional.fields.value.string_value 当 event_name 为 tmnxMkaSessionEstablished 时,从 message1 中提取并放置在键为 MI:SCI 的 additional fields 中。
on port %{DATA:port_id} additional.fields.value.string_value 当 event_name 为 tmnxMkaSessionEstablished 时,从 message1 中提取并放置在键为 Port Id 的 additional fields 中。
sub-port %{INT:sub_port_id} additional.fields.value.string_value 当 event_name 为 tmnxMkaSessionEstablished 时,从 message1 中提取并放置在键为 Sub-port Id 的 additional fields 中。
CA %{INT:ca} additional.fields.value.string_value 当 event_name 为 tmnxMkaSessionEstablished 时,从 message1 中提取并放置在键为 CA 的 additional fields 中。
EAPOL-destination %{MAC:dest_mac} target.mac 当 event_name 为 tmnxMkaSessionEstablished 时,从 message1 中提取。
local port-id %{DATA:local_port_id} target.resource.attribute.labels.value 从 message1 中提取特定 event_name 值,并放置在键为 local_port_id 的 target.resource.attribute.labels 中。
dest-mac-type %{NOTSPACE:mac_type} target.resource.attribute.labels.value 针对特定 event_name 值从 message1 中提取,并使用键 mac_type 放置在 target.resource.attribute.labels 中。
remote system name %{HOSTNAME:dest_host} target.hostname 从 message1 中提取,用于特定 event_name 值。
remote chassis-id %{DATA:dest_mac} target.mac 从 message1 中提取,用于特定 event_name 值。
remote port-id %{DATA:port_id} target.resource.attribute.labels.value 从 message1 中提取特定 event_name 值,并放置在键为 port_id 的 target.resource.attribute.labels 中。
remote-index %{INT:remote_index} target.resource.attribute.labels.value 针对特定 event_name 值从 message1 中提取,并使用键 remote_index 放置在 target.resource.attribute.labels 中。
remote management address %{IP:dest_ip} target.ip 针对特定 event_name 值从 message1 中提取。
advRtr:%{HOSTNAME:dest_host}%{GREEDYDATA}, ip@:%{IP:dest_ip}/%{INT:dest_port} target.hostname、target.ip、target.port 针对特定 event_name 值从 message1 中提取。
SID:%{INT:sid} network.session_id 从 message1 中提取,用于特定 event_name 值。
level:%{DATA:level} target.resource.attribute.labels.value 从 message1 中提取特定 event_name 值,并放置在键为 level 的 target.resource.attribute.labels 中。
mtid:%{INT:mtid} target.resource.attribute.labels.value 针对特定 event_name 值从 message1 中提取,并使用键 mtid 放置在 target.resource.attribute.labels 中。
type:%{WORD:type} target.resource.attribute.labels.value 从 message1 中提取特定 event_name 值,并放置在键为 type 的 target.resource.attribute.labels 中。
flags:%{WORD:flag} target.resource.attribute.labels.value 针对特定 event_name 值从 message1 中提取,并使用键 flag 放置在 target.resource.attribute.labels 中。
, algo:%{INT:algo} target.resource.attribute.labels.value 针对特定 event_name 值从 message1 中提取,并使用键 algo 放置在 target.resource.attribute.labels 中。
Description:%{GREEDYDATA:desc}. security_result.description 当 event_name 为 mafEntryMatch 时,从 message1 中提取。
SrcIP principal.ip 当 event_name 为 mafEntryMatch 时,从 kv_data 字段中提取。
SrcIP: %{INT:src_port} principal.port 当 event_name 为 mafEntryMatch 时,从 kv_data 字段中提取。
DstIP target.ip 当 event_name 为 mafEntryMatch 时,从 kv_data 字段中提取。
DstIP: %{INT:dest_port} target.port 当 event_name 为 mafEntryMatch 时,从 kv_data 字段中提取。
Protocol network.ip_protocol 当 event_name 为 mafEntryMatch 时,从 kv_data 字段中提取。
不适用 metadata.vendor_name 设置为 NOKIA_ROUTER。
不适用 metadata.event_type 根据提取的字段的存在情况和组合确定:
- src_ip、dest_ip 和 network 存在 -> NETWORK_CONNECTION
- principal 存在 -> STATUS_UPDATE
- 否则 -> GENERIC_EVENT
%{GREEDYDATA:description} metadata.description 当 event_name 为 tmnxMkaSessionEstablished 时,从 message1 中提取。
src_ip event.idm.read_only_udm.intermediary.ip 从更新日志映射
src_ip event.idm.read_only_udm.intermediary.asset.ip 从更新日志映射

更新日志

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

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