收集 Cisco 路由器日志

支持的语言:

本文档介绍了如何使用 Bindplane 代理将 Cisco 路由器日志注入到 Google Security Operations。解析器首先使用一系列 Grok 模式从各种 syslog 消息格式中提取通用字段,处理不同的时间戳和键值数据变体。然后,它会根据提取的事件类型(设备、助记符、message_type)应用特定逻辑,使用其他字段丰富数据,并将这些字段映射到 UDM 模型。

准备工作

  • 确保您拥有 Google SecOps 实例。
  • 确保您使用的是 Windows 2016 或更高版本,或者具有 systemd 的 Linux 主机。
  • 如果通过代理运行,请确保防火墙端口处于开放状态。
  • 确保您对 Cisco 路由器具有特权访问权限。

获取 Google SecOps 注入身份验证文件

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

获取 Google SecOps 客户 ID

  1. 登录 Google SecOps 控制台。
  2. 依次前往 SIEM 设置 > 配置文件
  3. 复制并保存组织详细信息部分中的客户 ID

安装 Bindplane 代理

Windows 安装

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

    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
    

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
    

其他安装资源

  • 如需了解其他安装选项,请参阅此安装指南

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

  1. 访问配置文件:

    1. 找到 config.yaml 文件。通常,它位于 Linux 上的 /etc/bindplane-agent/ 目录中或 Windows 上的安装目录中。
    2. 使用文本编辑器(例如 nanovi 或记事本)打开该文件。
  2. 按如下方式修改 config.yaml 文件:

    receivers:
        udplog:
            # Replace the port and IP address as required
            listen_address: "0.0.0.0:514"
    
    exporters:
        chronicle/chronicle_w_labels:
            compression: gzip
            # Adjust the path to the credentials file you downloaded in Step 1
            creds: '/path/to/ingestion-authentication-file.json'
            # Replace with your actual customer ID from Step 2
            customer_id: <customer_id>
            endpoint: malachiteingestion-pa.googleapis.com
            # Add optional ingestion labels for better organization
            ingestion_labels:
                log_type: CISCO_ROUTER
                raw_log_field: body
    
    service:
        pipelines:
            logs/source0__chronicle_w_labels-0:
                receivers:
                    - udplog
                exporters:
                    - chronicle/chronicle_w_labels
    
  3. 根据基础架构的需要替换端口和 IP 地址。

  4. <customer_id> 替换为实际的客户 ID。

  5. /path/to/ingestion-authentication-file.json 更新为获取 Google SecOps 提取身份验证文件部分中保存身份验证文件的路径。

重启 Bindplane 代理以应用更改

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

    sudo systemctl restart bindplane-agent
    
  • 如需在 Windows 中重启 Bindplane 代理,您可以使用服务控制台,也可以输入以下命令:

    net stop BindPlaneAgent && net start BindPlaneAgent
    

在 Cisco 路由器上配置 Syslog

  1. 登录 Cisco 路由器。
  2. 输入 enable 命令来升级权限:

    Switch> enable
    Switch#
    
  3. 输入 conf t 命令,切换到配置模式:

    Switch# conf t
    Switch(config)#
    
  4. 输入以下命令:

    logging host <bindplane-server-ip> transport <tcp/udp> port <port-number>
    logging source-interface <interface>
    
    • <bindplane-server-ip> 替换为 Bindplane 代理 IP 地址,并将 <port-number> 替换为配置的端口。
    • <tcp/udp> 替换为 Bindplane 代理上配置的监听协议,例如 udp
    • <interface> 替换为 Cisco 接口 ID,例如 Ethernet1/1
  5. 输入以下命令以设置优先级:

    logging trap Informational 
    logging console Informational 
    logging severity Informational
    
  6. 设置 syslog 设施:

    logging facility local6
    
  7. 输入以下命令以启用时间戳:

    service timestamps log datetime
    
  8. 保存并退出。

  9. 输入以下命令,配置在重启后仍有效的设置:

    copy running-config startup-config
    

UDM 映射表

日志字段 UDM 映射 逻辑
client_ip target.ip、target.asset.ip 该值取自 grok 解析器提取的 client_ip 字段。
client_mac target.mac 该值取自 grok 解析器提取的 client_mac 字段。
dst_ip target.ip、target.asset.ip 该值取自 grok 解析器提取的 dst_ip 字段。
dst_port target.port 该值取自 grok 解析器提取的 dst_port 字段,并转换为整数。
duration - 此字段未映射到 UDM。
host_ip target.ip、target.asset.ip 该值取自 grok 解析器提取的 host_ip 字段。
local_proxy intermediary.ip 该值取自 grok 解析器提取的 local_proxy 字段。
message_data metadata.description 该值取自 grok 解析器提取的 message_data 字段。
protocol network.ip_protocol 该值取自 grok 解析器提取的 protocol 字段,并转换为大写。
received_bytes network.received_bytes 该值取自 grok 解析器提取的 received_bytes 字段,并转换为无符号整数。
referral_url network.http.referral_url 该值取自 grok 解析器提取的 referral_url 字段。
remote_proxy intermediary.ip 该值取自 grok 解析器提取的 remote_proxy 字段。
send_bytes network.sent_bytes 该值取自 grok 解析器提取的 send_bytes 字段,并转换为无符号整数。
sent_bytes network.sent_bytes 该值取自 grok 解析器提取的 sent_bytes 字段,并转换为无符号整数。
server_host target.hostname、target.asset.hostname 该值取自 grok 解析器提取的 server_host 字段。
server_ip target.ip、target.asset.ip 该值取自 grok 解析器提取的 server_ip 字段。
src_ip principal.ip、principal.asset.ip 该值取自 grok 解析器提取的 src_ip 字段。
src_port principal.port 该值取自 grok 解析器提取的 src_port 字段,并转换为整数。
user_ip target.ip、target.asset.ip 该值取自 grok 解析器提取的 user_ip 字段。
user_mail principal.user.userid、principal.user.email_addresses 该值取自 grok 解析器提取的 user_mail 字段。
username target.user.userid 该值取自 grok 解析器提取的 username 字段。
- metadata.event_timestamp 该值取自 create_time 字段。
- metadata.event_type 该值默认设置为 GENERIC_EVENT,并根据解析的日志消息更改为特定事件类型。
- metadata.log_type 该值设置为 CISCO_ROUTER
- metadata.product_event_type 该值取自 message_type 字段,该字段是通过合并 facilityprioritymnemonics 字段生成的。
- metadata.product_name 该值设置为 Router
- metadata.vendor_name 该值设置为 Cisco
- network.application_protocol 如果 protocol 字段分别为 httphttps,则该值设置为 HTTPHTTPS
- extensions.auth.type 默认情况下,该值设置为 AUTHTYPE_UNSPECIFIED,并根据解析的日志消息更改为特定的身份验证类型。
- security_result.action 成功登录时,该值设置为 ALLOW;登录失败时,该值设置为 BLOCK
- security_result.category 对于包含 IP 选项的事件,该值设置为 NETWORK_SUSPICIOUS;对于登录失败的事件,该值设置为 AUTH_VIOLATION
- security_result.description 该值设置为不同事件的特定消息。
- security_result.severity 对于成功登录,该值设置为 LOW;对于登录失败,该值设置为 MEDIUM;对于其他事件,该值设置为 INFORMATIONAL
- security_result.severity_details 该值从失败登录的 fail_reason 字段中获取,对于具有 IP 选项的事件,该值设置为 Informational message
- security_result.summary 该值设置为不同事件的特定消息。

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