收集 Juniper SRX 系列防火墙日志
本文档介绍了如何使用 Bindplane 将 Juniper SRX 系列防火墙日志注入到 Google Security Operations。
Juniper SRX 系列防火墙是高性能网络安全设备,可提供新一代防火墙 (NGFW) 功能,包括状态检测、入侵检测和防御 (IDP)、应用安全和 VPN。SRX 防火墙会针对流量、安全、系统和会话事件生成 syslog 消息,这些消息可转发到外部 SIEM 平台以进行集中式安全监控。
准备工作
请确保满足以下前提条件:
- Google SecOps 实例。
- Windows Server 2016 或更高版本,或者具有
systemd的 Linux 主机。 - Bindplane 代理与 Juniper SRX 防火墙之间的网络连接。
- 如果在代理后面运行,请确保防火墙端口已根据 Bindplane 代理要求打开。
- 对 Juniper SRX 防火墙的特权访问权限(通过 J-Web 或 CLI 进行的 root 或超级用户级访问)。
获取 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](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](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 /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/juniper_firewall: compression: gzip creds_file_path: '/etc/bindplane-agent/ingestion-auth.json' customer_id: 'your-customer-id-here' endpoint: malachiteingestion-pa.googleapis.com log_type: JUNIPER_FIREWALL raw_log_field: body ingestion_labels: env: production service: pipelines: logs/juniper_to_chronicle: receivers: - udplog exporters: - chronicle/juniper_firewall
配置参数
替换以下占位符:
接收器配置:
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 客户 ID。endpoint:区域端点网址:- 美国:
malachiteingestion-pa.googleapis.com - 欧洲:
europe-malachiteingestion-pa.googleapis.com - 亚洲:
asia-southeast1-malachiteingestion-pa.googleapis.com - 如需查看完整列表,请参阅区域级端点。
- 美国:
ingestion_labels:采用 YAML 格式的可选标签(例如env: production)。
保存配置文件
- 修改后,保存文件:
- 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 收集器。
- 右键点击并选择重新启动。
- 按
验证服务是否正在运行:
sc query observiq-otel-collector检查日志是否存在错误:
type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"
配置 Juniper SRX syslog 转发
配置 Juniper SRX 防火墙,以将 syslog 消息转发到 Bindplane 代理。
使用 J-Web 界面
- 登录 Juniper SRX J-Web 界面。
- 依次前往配置 > 系统属性 > Syslog。
- 点击主机部分下的添加,以添加新的 syslog 服务器。
- 提供以下配置详细信息:
- 主机名:输入 Bindplane 代理主机(例如
192.168.1.100)的 IP 地址。 - 端口:输入
514(或在 Bindplane 代理中配置的端口)。 - 日志前缀:日志消息的可选前缀。
- 设备:选择要转发的设备和严重程度级别:
- any:选择严重程度为 info 或更高级别的事件。
- 主机名:输入 Bindplane 代理主机(例如
- 在来源地址字段中,输入 SRX 管理界面 IP(可选,但建议使用,以便实现一致的来源识别)。
- 点击确定进行保存。
- 点击提交以应用配置。
使用 Junos CLI
- 通过 SSH 或控制台连接到 Juniper SRX。
进入配置模式:
configure配置 syslog 主机:
set system syslog host BINDPLANE_IP any info set system syslog host BINDPLANE_IP port 514 set system syslog host BINDPLANE_IP source-address SRX_MGMT_IP set system syslog host BINDPLANE_IP structured-data将
BINDPLANE_IP:Bindplane 代理主机 IP 地址。SRX_MGMT_IP:SRX 防火墙的管理 IP 地址。
配置安全日志流式传输(针对流量日志和会话日志):
set security log mode stream set security log source-address SRX_MGMT_IP set security log stream chronicle-stream host BINDPLANE_IP set security log stream chronicle-stream port 514 set security log stream chronicle-stream transport protocol udp set security log stream chronicle-stream format sd-syslog set security log stream chronicle-stream severity info set security log stream chronicle-stream category all将
BINDPLANE_IP:Bindplane 代理主机 IP 地址。SRX_MGMT_IP:SRX 防火墙的管理 IP 地址。
提交配置:
commit验证 syslog 配置:
show system syslog show security log
配置特定日志类别
如需转发特定日志类型,请配置各个功能:
set system syslog host BINDPLANE_IP firewall any set system syslog host BINDPLANE_IP authorization info set system syslog host BINDPLANE_IP daemon info set system syslog host BINDPLANE_IP kernel info set system syslog host BINDPLANE_IP interactive-commands info
将 BINDPLANE_IP 替换为 Bindplane 代理主机 IP 地址。
验证 Syslog 转发
在 SRX 上,运行以下命令可查看有效的 syslog 目标:
show system syslog通过防火墙生成测试流量,并验证日志是否显示在 Bindplane 代理日志中。
如需了解详情,请参阅 Juniper SRX 系列文档。
UDM 映射表
| 日志字段 | UDM 映射 | 逻辑 |
|---|---|---|
source-address |
event.idm.read_only_udm.principal.ip |
从 source-address 中获取的值。 |
source-port |
event.idm.read_only_udm.principal.port |
从 source-port 中获取的值并转换为整数。 |
destination-address |
event.idm.read_only_udm.target.ip |
从 destination-address 中获取的值。 |
destination-port |
event.idm.read_only_udm.target.port |
从 destination-port 中获取的值并转换为整数。 |
protocol-id |
event.idm.read_only_udm.network.ip_protocol |
从协议编号到名称的映射(6=TCP,17=UDP,1=ICMP)。 |
policy-name |
event.idm.read_only_udm.security_result.rule_name |
从 policy-name 中获取的值。 |
source-zone-name |
event.idm.read_only_udm.additional.fields |
从 source-zone-name 中获取的值,并使用键 source-zone-name 添加。 |
destination-zone-name |
event.idm.read_only_udm.additional.fields |
从 destination-zone-name 中获取的值,并使用键 destination-zone-name 添加。 |
service-name |
event.idm.read_only_udm.target.application |
从 service-name 中获取的值。 |
application |
event.idm.read_only_udm.target.application |
从 application 中获取的值(如果不存在 service-name)。 |
nat-source-address |
event.idm.read_only_udm.principal.nat_ip |
从 nat-source-address 中获取的值。 |
nat-source-port |
event.idm.read_only_udm.principal.nat_port |
从 nat-source-port 中获取的值并转换为整数。 |
nat-destination-address |
event.idm.read_only_udm.target.nat_ip |
从 nat-destination-address 中获取的值。 |
nat-destination-port |
event.idm.read_only_udm.target.nat_port |
从 nat-destination-port 中获取的值并转换为整数。 |
bytes-from-client |
event.idm.read_only_udm.network.sent_bytes |
从 bytes-from-client 中获取的值并转换为无符号整数。 |
bytes-from-server |
event.idm.read_only_udm.network.received_bytes |
从 bytes-from-server 中获取的值并转换为无符号整数。 |
packets-from-client |
event.idm.read_only_udm.additional.fields |
从 packets-from-client 中获取的值,并使用键 packets-from-client 添加。 |
packets-from-server |
event.idm.read_only_udm.additional.fields |
从 packets-from-server 中获取的值,并使用键 packets-from-server 添加。 |
elapsed-time |
event.idm.read_only_udm.additional.fields |
从 elapsed-time 中获取的值,并使用键 elapsed-time 添加。 |
username |
event.idm.read_only_udm.principal.user.userid |
从 username 中获取的值。 |
reason |
event.idm.read_only_udm.security_result.description |
从 reason 中获取的值。 |
action |
event.idm.read_only_udm.security_result.action |
如果 action 为 accept 或 permit,则设置为 ALLOW。如果 action 为 deny、drop、reject 或 close,则设置为 BLOCK。 |
hostname |
event.idm.read_only_udm.principal.hostname |
从 syslog 主机名字段中获取的值。 |
attack-name |
event.idm.read_only_udm.security_result.threat_name |
从 attack-name(IDP 事件)获取的值。 |
severity |
event.idm.read_only_udm.security_result.severity |
从严重程度字符串映射:info 映射到 INFORMATIONAL,warning 映射到 MEDIUM,error 或 major 映射到 ERROR,critical 映射到 CRITICAL。 |
event.idm.read_only_udm.metadata.vendor_name |
设置为 Juniper Networks。 |
|
event.idm.read_only_udm.metadata.product_name |
设置为 SRX Series Firewall。 |
更新日志
需要更多帮助?获得社区成员和 Google SecOps 专业人士的解答。