收集 Fortinet 交换机日志
本指南介绍了如何使用 Bindplane 代理将 Fortinet 交换机日志注入到 Google Security Operations。
Fortinet 交换机是一系列专为企业网络设计的安全、高性能以太网交换机。FortiSwitch 提供第 2 层和第 3 层交换功能、VLAN 支持、链路聚合、以太网供电 (PoE) 和集成式安全功能。FortiSwitch 设备可以独立运行,也可以通过 FortiLink 由 FortiGate 防火墙进行管理。
准备工作
请确保满足以下前提条件:
- Google SecOps 实例。
- Windows Server 2016 或更高版本,或者具有 systemd 的 Linux 主机。
- Bindplane 代理与 Fortinet 交换机之间的网络连接。
- 如果通过代理运行,请确保防火墙端口已根据 Bindplane 代理要求打开。
- 对 Fortinet 交换机管理控制台或 FortiGate 控制台(适用于受管交换机)的特权访问权限。
- 运行 FortiSwitchOS 7.0 或更高版本的 Fortinet 交换机。
获取 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该服务应显示为 RUNNING。
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该服务应显示为有效(正在运行)。
其他安装资源
如需了解其他安装选项和问题排查信息,请参阅 Bindplane 代理安装指南。
配置 Bindplane 代理以注入 syslog 并将其发送到 Google SecOps
找到配置文件
Linux:
sudo nano /etc/bindplane-agent/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/fortiswitch:
compression: gzip
creds_file_path: '/etc/bindplane-agent/ingestion-auth.json'
customer_id: 'YOUR_CUSTOMER_ID'
endpoint: malachiteingestion-pa.googleapis.com
log_type: FORTINET_SWITCH
raw_log_field: body
ingestion_labels:
env: production
service:
pipelines:
logs/fortiswitch_to_chronicle:
receivers:
- udplog
exporters:
- chronicle/fortiswitch
配置参数
替换以下占位符:
接收器配置:
- 接收器配置为在 UDP 端口 514 上侦听来自 Fortinet 交换机的 syslog 消息。
- 如需在所有接口上进行监听,请使用
0.0.0.0:514。 - 如需在 Linux 上使用非特权端口,请更改为
0.0.0.0:1514并将 Fortinet 交换机配置为发送到端口 1514。
导出器配置:
creds_file_path:提取身份验证文件的完整路径:- Linux:
/etc/bindplane-agent/ingestion-auth.json - Windows:
C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
- Linux:
customer_id:上一步中的客户 ID。endpoint:区域端点网址:- 美国:
malachiteingestion-pa.googleapis.com - 欧洲:
europe-malachiteingestion-pa.googleapis.com - 亚洲:
asia-southeast1-malachiteingestion-pa.googleapis.com - 如需查看完整列表,请参阅区域级端点。
- 美国:
log_type:必须正好为FORTINET_SWITCH。ingestion_labels:采用 YAML 格式的可选标签(例如env: production)。
保存配置文件
修改后,保存文件:
- Linux:依次按
Ctrl+O、Enter和Ctrl+X。 - Windows:依次点击文件 > 保存。
重启 Bindplane 代理以应用更改
Linux
sudo systemctl restart observiq-otel-collector验证服务是否正在运行:
sudo systemctl status observiq-otel-collector检查日志是否存在错误:
sudo journalctl -u observiq-otel-collector -f
Windows
请从下列选项中选择一项:
以管理员身份使用命令提示符或 PowerShell:
net stop observiq-otel-collector && net start observiq-otel-collector使用“服务”控制台:
- 按
Win+R,输入services.msc,然后按 Enter 键。 - 找到 observIQ OpenTelemetry 收集器。
右键点击并选择重新启动。
验证服务是否正在运行:
sc query observiq-otel-collector检查日志是否存在错误:
type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"
- 按
配置 Fortinet 交换机 syslog 转发
配置 Fortinet 交换机以将日志发送到 Bindplane 代理。配置步骤会有所不同,具体取决于交换机是独立式还是由 FortiGate 管理。
对于独立 FortiSwitch(GUI 配置)
- 登录 FortiSwitch 网页界面。
- 依次前往日志 > 配置。
- 在 Syslog 下,选择启用。
- 选择要记录的事件的严重程度(例如信息或更高级别)。
- 在服务器字段中,输入 Bindplane 代理主机虚拟机的 IP 地址或完全限定域名。
- 在端口字段中,输入
514(或在 Bindplane 代理中配置的端口)。 - 在设施下拉菜单中,选择 local7。
- 点击应用。
对于独立 FortiSwitch(CLI 配置)
- 通过 SSH 或控制台登录 FortiSwitch CLI。
输入以下命令:
config log syslogd setting set status enable set server <BINDPLANE_AGENT_IP> set port 514 set facility local7 end config log syslogd filter set severity information end将
<BINDPLANE_AGENT_IP>替换为 Bindplane 代理主机 IP 地址。验证配置:
show log syslogd setting
对于由 FortiGate 管理的 FortiSwitch
当 FortiSwitch 由 FortiGate 管理时,请从 FortiGate CLI 配置 syslog 转发。
- 通过 SSH 或控制台登录 FortiGate CLI。
输入以下命令,为受管 FortiSwitch 配置远程 syslog:
config switch-controller remote-log edit "chronicle-syslog" set status enable set server <BINDPLANE_AGENT_IP> set port 514 set severity information set facility local7 next end将
<BINDPLANE_AGENT_IP>替换为 Bindplane 代理主机 IP 地址。验证配置:
show switch-controller remote-log确保 FortiGate 防火墙政策允许从 FortiLink 接口到 Bindplane 代理所在接口的 syslog 流量。如果需要,请创建政策:
config firewall policy edit 0 set srcintf <fortilink_interface> set dstintf <bindplane_interface> set srcaddr "all" set dstaddr "all" set action accept set schedule "always" set service "SYSLOG" next end将
<fortilink_interface>替换为 FortiLink 接口名称,并将<bindplane_interface>替换为 Bindplane 代理可访问的接口。
UDM 映射表
| 日志字段 | UDM 映射 | 逻辑 |
|---|---|---|
| metadata.event_type | 相应记录所代表的事件类型。 | |
| 事件 | metadata.product_event_type | 产品报告的事件类型。 |
| log_id | metadata.product_log_id | 产品分配的日志条目的唯一标识符。 |
| device_id | principal.asset.asset_id | 相应资产的唯一标识符。 |
| devname | principal.asset.hostname | 与主账号相关联的资产的主机名。 |
| devname | principal.hostname | 与正文相关联的主机名。 |
| vd | principal.user.attribute.labels | 与用户相关联的标签的列表。 |
| oldrole | principal.user.attribute.roles | 与用户相关联的角色列表。 |
| 单位 | principal.user.role_description | 用户角色的说明。 |
| 用户 | principal.user.userid | 用户的唯一标识符。 |
| 操作 | security_result.action_details | 所采取行动的详细信息。 |
| msg | security_result.description | 安全结果的说明。 |
| 类型、子类型、switch.physical-port、instanceid | security_result.detection_fields | 用于检测的字段的列表。 |
| pri | security_result.priority_details | 有关活动优先级的详细信息。 |
| 状态 | security_result.summary | 安全结果摘要。 |
| newrole | target.user.attribute.roles | 与目标用户相关联的角色列表。 |
| metadata.product_name | 生成相应事件的产品的名称。 | |
| metadata.vendor_name | 生产相应产品的供应商的名称。 |
需要更多帮助?获得社区成员和 Google SecOps 专业人士的解答。