收集 VyOS 日志
本文档介绍了如何使用 Bindplane 代理将 VyOS 日志注入到 Google Security Operations 中。
VyOS 是一款开源网络路由器,可为防火墙事件、路由更改、VPN 连接和系统事件生成 syslog 消息。
准备工作
请确保满足以下前提条件:
- Google SecOps 实例
- Windows Server 2016 或更高版本,或者具有
systemd的 Linux 主机 - Bindplane 代理与 VyOS 路由器之间的网络连接
- 如果通过代理运行,请确保防火墙端口根据 Bindplane 代理要求处于开放状态
- 通过 SSH 访问具有管理员权限的 VyOS 路由器
获取 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该服务应显示为活跃 (running) 。
其他安装资源
如需了解其他安装选项和问题排查信息,请参阅 Bindplane 代理安装指南。
配置 Bindplane 代理以注入 syslog 并发送到 Google SecOps
找到配置文件
Linux :
sudo nano /opt/observiq-otel-collector/config.yamlWindows :
notepad "C:\Program Files\observIQ OpenTelemetry Collector\config.yaml"
修改配置文件
将
config.yaml的全部内容替换为以下配置:receivers: udplog: listen_address: "0.0.0.0:514" exporters: chronicle/vyos: compression: gzip creds_file_path: '/etc/bindplane-agent/ingestion-auth.json' customer_id: '<customer_id>' endpoint: malachiteingestion-pa.googleapis.com log_type: VYOS raw_log_field: body service: pipelines: logs/vyos_to_chronicle: receivers: - udplog exporters: - chronicle/vyos
配置参数
替换以下占位符:
接收器配置:
listen_address:要监听的 IP 地址和端口:0.0.0.0以监听所有接口(推荐)- 端口
514是标准 syslog 端口(在 Linux 上需要 root;对于非 root 用户,请使用1514)
导出器配置:
creds_file_path:注入身份验证文件的完整路径:- Linux:
/etc/bindplane-agent/ingestion-auth.json - Windows:
C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
- Linux:
customer_id:从 Google SecOps 控制台复制的客户 IDendpoint:区域级端点网址:- 美国:
malachiteingestion-pa.googleapis.com - 欧洲:
europe-malachiteingestion-pa.googleapis.com - 亚洲:
asia-southeast1-malachiteingestion-pa.googleapis.com - 如需查看完整列表,请参阅区域级端点
- 美国:
保存配置文件
- 修改后,保存文件:
- 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 Collector 。
- 右键点击并选择重启 。
验证服务正在运行:
sc query observiq-otel-collector检查日志中的错误:
type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"
- 按
在 VyOS 中配置 syslog
- 使用 SSH 连接到 VyOS 路由器。
进入配置模式:
configure配置远程 syslog 主机(将
<bindplane-ip>替换为您的 Bindplane 代理 IP 地址):set system syslog host <bindplane-ip> facility all level info set system syslog host <bindplane-ip> port 514 set system syslog host <bindplane-ip> protocol udp提交并保存配置:
commit save
UDM 映射表
| 日志字段 | UDM 映射 | 逻辑 |
|---|---|---|
clientIp |
principal.ip |
从 DHCP 消息中提取的客户端 IP 地址。 |
clientMac |
principal.mac |
从 DHCP 消息中提取的客户端 MAC 地址。 |
datetime |
metadata.event_timestamp |
从日志消息中提取的时间戳。 |
dst_ipaddress |
target.ip |
从日志消息中提取的目标 IP 地址。 |
hostname |
observer.hostname |
从日志消息中提取的主机名。由解析器根据 process 和其他字段确定。可以是 GENERIC_EVENT、NETWORK_CONNECTION、NETWORK_DHCP 或 STATUS_UPDATE。硬编码为“VYOS”。 |
msg |
metadata.description |
日志中的原始消息或其中的一部分,具体取决于解析逻辑。如果 process 为“dhcpd”,则设置为“DHCP Event”。硬编码为“VYOS DHCP”。硬编码为“VYOS”。 |
network.dhcp.chaddr |
network.dhcp.chaddr |
从 DHCP 消息中提取的客户端 MAC 地址。 |
network.dhcp.ciaddr |
network.dhcp.ciaddr |
DHCPREQUEST 消息中的客户端 IP 地址。DHCP 消息操作码。对于 DHCPREQUEST 和 DHCPINFORM,设置为“BOOTREQUEST”;对于 DHCPACK 和 DHCPNAK,设置为“BOOTREPLY”。DHCP 消息类型。派生自 eventType,可以是 REQUEST、ACK、INFORM、NAK 或 OFFER。 |
network.dhcp.yiaddr |
network.dhcp.yiaddr |
DHCPACK 或 DHCPOFFER 消息中的您的(客户端)IP 地址。如果 process 为“dhcpd”,则设置为“DHCP”。 |
pri_host |
principal.hostname |
与 DHCP 消息中的客户端关联的主机名。 |
rem_msg |
metadata.description |
初始解析后消息的剩余部分,在某些情况下用于描述。 |
src_ipaddress |
principal.ip |
从日志消息中提取的来源 IP 地址。 |
timestamp |
event.timestamp |
日志条目的时间戳。 |