收集 HP ProCurve 日志

支持的语言:

本文档介绍了如何使用 Bindplane 将 HP ProCurve 交换机日志注入到 Google Security Operations。解析器代码首先尝试将原始日志消息解析为 JSON。如果失败,它会使用正则表达式(grok 模式)根据常见的 HP ProCurve 日志格式从消息中提取字段。

准备工作

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

  • Google SecOps 实例
  • Windows 2016 或更高版本,或者具有 systemd 的 Linux 主机
  • 如果在代理后运行,防火墙端口处于开放状态
  • 对 HP ProCurve 交换机的特权访问权限

获取 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. 访问配置文件:

    • 找到 config.yaml 文件。通常,它位于 Linux 上的 /etc/bindplane-agent/ 目录中或 Windows 上的安装目录中。
    • 使用文本编辑器(例如 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: HP_PROCURVE
                    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
    

在 HP ProCurve 交换机上配置 Syslog

  1. 通过 SSH 登录 HP Procurve 交换机
  2. 使用以下命令验证交换机接口:

    show ip int br
    
  3. 使用以下命令在交换机上启用配置模式:

    console# conf t
    
  4. 配置交换机以使用以下命令发送日志:

        logging host <bindplae-server-ip> transport <udp/tcp> port <port-number>
        logging facility syslog
        logging trap informational
        logging buffer 65536
        logging origin-id hostname
        logging source-interface <interface>
    
  5. <bindplae-server-ip><port-number> 替换为 Bindplane IP 地址端口号。

  6. 通过仅选择 UDPTCP 作为通信协议(具体取决于您的 Bindplane 代理配置),替换 <udp/tcp>

  7. <interface> 替换为您之前从交换机收到的接口 ID(例如 Ethernet1/1)。

  8. 使用以下命令退出配置模式并保存:

    console# exit
    console# wr
    

UDM 映射表

日志字段 UDM 映射 逻辑
AAAScheme read_only_udm.security_result.detection_fields.value 如果键为 AAAScheme,则从 descrip 字段提取的值
AAAType read_only_udm.security_result.detection_fields.value 如果键为 AAAType,则从 descrip 字段提取的值
机箱 ID read_only_udm.security_result.detection_fields.value 如果键为 Chassis ID,则从 description 字段提取的值
命令为 read_only_udm.security_result.detection_fields.value commandInfo 字段中 Command is 之后的文本
CommandSource read_only_udm.security_result.detection_fields.value 如果键为 CommandSource,则从 descrip 字段提取的值
配置方法 read_only_udm.additional.fields.value.string_value 如果日志中存在该字段,则会将其放置在附加字段中,并命名为 config_method
ConfigDestination read_only_udm.security_result.detection_fields.value 如果键为 ConfigDestination,则从 descrip 字段提取的值
ConfigSource read_only_udm.security_result.detection_fields.value 如果键为 ConfigSource,则从 descrip 字段提取的值
设备名称 read_only_udm.principal.hostname 如果该字段存在于日志中,则会映射到主账号主机名和资产主机名
活动 ID read_only_udm.additional.fields.value.string_value 如果日志中存在该字段,则会将其放置在附加字段中,并命名为 event_id
EventIndex read_only_udm.security_result.detection_fields.value 如果键为 EventIndex,则从 descrip 字段提取的值
IfIndex read_only_udm.security_result.detection_fields.value 如果键为 IfIndex,则从 description 字段提取的值
IP:%{IP:IPAddr} read_only_udm.target.ip, read_only_udm.target.asset.ip desc 字段提取并映射到目标 IP 和目标资产 IP 的 IP 地址
IPAddr read_only_udm.target.ip, read_only_udm.target.asset.ip 如果该字段存在于日志中,则会映射到目标 IP 和目标资产 IP
通知类型 read_only_udm.additional.fields.value.string_value 如果日志中存在该字段,则会将其放置在附加字段中,并命名为 notice_type
端口 ID read_only_udm.security_result.detection_fields.value 如果键为 Port ID,则从 description 字段提取的值
Remote-IP-Address read_only_udm.additional.fields.value.string_value 如果日志中存在该字段,则会将其放置在附加字段中,并命名为 remote_ip_address
服务 read_only_udm.security_result.detection_fields.value 如果键为 Service,则从 descrip 字段提取的值
任务 read_only_udm.security_result.detection_fields.value 如果键为 Task,则从 descrip 字段提取的值
用户 read_only_udm.principal.user.userid 如果该字段存在于日志中,则会映射到主用户 ID
User-Name read_only_udm.principal.user.userid 如果该字段存在于日志中,则会映射到主用户 ID
用户名 read_only_udm.principal.user.userid 如果该字段存在于日志中,则会映射到主用户 ID
UserService read_only_udm.security_result.detection_fields.value 如果键为 UserService,则从 desc 字段提取的值
collection_time.seconds read_only_udm.metadata.event_timestamp.seconds 事件时间戳的秒部分
数据 此字段包含原始日志消息,并经过解析以提取其他字段。它未映射到 UDM。
降序 read_only_udm.security_result.description 从日志消息中提取的说明
descrip desc 字段提取的说明,进一步解析为键值对。它未映射到 UDM。
说明 read_only_udm.security_result.description 如果该字段存在于日志中,则会映射到安全结果说明
descript read_only_udm.metadata.description 如果该字段存在于日志中,则会映射到元数据说明
event_id read_only_udm.additional.fields.value.string_value 如果日志中存在该字段,则会将其放置在附加字段中,并命名为 event_id
eventId read_only_udm.metadata.product_event_type 从日志消息中提取的事件 ID
主机名 read_only_udm.principal.hostname, read_only_udm.principal.asset.hostname 从日志消息中提取的主机名,并映射到主主机名和资源主机名
inter_ip read_only_udm.additional.fields.value.string_value, read_only_udm.intermediary.ip 如果该字段存在于日志中且是有效的 IP,则会映射到中介 IP。否则,它会作为 inter_ip 放置在其他字段中
notice_type read_only_udm.additional.fields.value.string_value 如果日志中存在该字段,则会将其放置在附加字段中,并命名为 notice_type
pid read_only_udm.principal.process.pid 如果该字段存在于日志中,则会映射到主进程 PID
计划 从日志消息中提取的程序信息,进一步解析以提取模块、严重程度和操作。它未映射到 UDM。
proto read_only_udm.network.application_protocol, read_only_udm.additional.fields.value.string_value 从日志消息中提取的协议。如果与已知协议匹配,则映射到应用协议。否则,它会作为 Application Protocol 放置在其他字段中
remote_ip_address read_only_udm.principal.ip、read_only_udm.principal.asset.ip、read_only_udm.additional.fields.value.string_value 如果该字段存在于日志中且是有效的 IP,则会映射到主 IP 和主资产 IP。否则,它会作为 remote_ip_address 放置在其他字段中
和程度上减少 read_only_udm.security_result.severity, read_only_udm.security_result.severity_details / 拆分后从 program 字段中提取的严重程度。它会映射到 UDM 严重级别,也会存储为原始严重程度详细信息
src_ip read_only_udm.principal.ip, read_only_udm.principal.asset.ip 从日志消息中提取的源 IP,并映射到主 IP 和主资产 IP
状态 read_only_udm.additional.fields.value.string_value 如果日志中存在该字段,则会将其放置在附加字段中,并命名为 status
targetHostname read_only_udm.target.hostname, read_only_udm.target.asset.ip 如果该字段存在于日志中,则会映射到目标主机名和目标资产 IP
target_ip read_only_udm.target.ip, read_only_udm.target.asset.ip 从日志消息中提取的目标 IP,并映射到目标 IP 和目标资产 IP
时间戳 read_only_udm.metadata.event_timestamp.seconds 从日志消息中提取并转换为事件时间戳的时间戳
timestamp.seconds read_only_udm.metadata.event_timestamp.seconds 事件时间戳的秒部分
用户名 read_only_udm.principal.user.userid 如果该字段存在于日志中,则会映射到主用户 ID
read_only_udm.metadata.event_type 根据字段和逻辑的组合确定:
- NETWORK_CONNECTION:如果 has_principalhas_target 为 true。
- USER_LOGOUT:如果 actionWEBOPT_LOGOUTLOGOUTSHELL_LOGOUT
- USER_LOGIN:如果 actionLOGINWEBOPT_LOGIN_SUC
- STATUS_UPDATE:如果 action 不为空或 src_ip/hostname 不为空。
- USER_UNCATEGORIZED:如果 has_user 为 true。
- GENERIC_EVENT:如果未满足上述任何条件。
read_only_udm.metadata.product_name 硬编码为 Procurve
read_only_udm.metadata.vendor_name 硬编码为 HP
read_only_udm.extensions.auth.type 如果 event_typeUSER_LOGOUTUSER_LOGIN,则设置为 MACHINE

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