收集 Cisco 路由器日志
本文档介绍了如何使用 Bindplane 代理将 Cisco 路由器日志注入到 Google 安全运营中心。解析器首先使用一系列 Grok 模式从各种 syslog 消息格式中提取常用字段,处理不同的时间戳和键值对数据变体。然后,它会根据提取的事件类型(设施、缩写词、message_type)应用特定逻辑,使用其他字段丰富数据,并将其映射到 UDM 模型。
准备工作
- 确保您拥有 Google SecOps 实例。
- 确保您使用的是 Windows 2016 或更高版本,或者使用了带有
systemd
的 Linux 主机。 - 如果在代理后面运行,请确保防火墙端口处于打开状态。
- 确保您拥有对 Cisco 路由器的特权访问权限。
获取 Google SecOps 提取身份验证文件
- 登录 Google SecOps 控制台。
- 依次前往 SIEM 设置 > 收集代理。
- 下载提取身份验证文件。将该文件安全地保存在将安装 BindPlane 的系统上。
获取 Google SecOps 客户 ID
- 登录 Google SecOps 控制台。
- 依次选择 SIEM 设置 > 配置文件。
- 复制并保存组织详细信息部分中的客户 ID。
安装 Bindplane 代理
Windows 安装
- 以管理员身份打开命令提示符或 PowerShell。
运行以下命令:
msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
Linux 安装
- 打开具有 root 或 sudo 权限的终端。
运行以下命令:
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
其他安装资源
- 如需了解其他安装选项,请参阅此安装指南。
配置 Bindplane 代理以注入 Syslog 并将其发送到 Google SecOps
访问配置文件:
- 找到
config.yaml
文件。通常,在 Linux 上,该目录位于/etc/bindplane-agent/
目录中;在 Windows 上,该目录位于安装目录中。 - 使用文本编辑器(例如
nano
、vi
或记事本)打开该文件。
- 找到
按如下方式修改
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
根据基础架构中的需要替换端口和 IP 地址。
将
<customer_id>
替换为实际的客户 ID。在获取 Google SecOps 提取身份验证文件部分中,将
/path/to/ingestion-authentication-file.json
更新为身份验证文件的保存路径。
重启 Bindplane 代理以应用更改
如需在 Linux 中重启 Bindplane 代理,请运行以下命令:
sudo systemctl restart bindplane-agent
如需在 Windows 中重启 Bindplane 代理,您可以使用服务控制台,也可以输入以下命令:
net stop BindPlaneAgent && net start BindPlaneAgent
在 Cisco 路由器上配置 Syslog
- 登录 Cisco 路由器。
输入
enable
命令以提升特权:Switch> enable Switch#
输入
conf t
命令,切换到配置模式:Switch# conf t Switch(config)#
输入以下命令:
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
。
- 将
输入以下命令以设置优先级:
logging trap Informational logging console Informational logging severity Informational
设置 syslog 设施:
logging facility local6
输入以下命令以启用时间戳:
service timestamps log datetime
保存并退出。
输入以下命令,将设置配置为在重启后保持不变:
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 字段。 |
- | is_alert | 此值默认设置为 true 。 |
- | is_significant | 此值默认设置为 true 。 |
- | metadata.event_timestamp | 该值取自 create_time 字段。 |
- | metadata.event_type | 该值默认设置为 GENERIC_EVENT ,并会根据解析的日志消息更改为特定事件类型。 |
- | metadata.log_type | 该值设置为 CISCO_ROUTER 。 |
- | metadata.product_event_type | 该值取自 message_type 字段,该字段是通过组合 facility 、priority 和 mnemonics 字段生成的。 |
- | metadata.product_name | 该值设置为 Router 。 |
- | metadata.vendor_name | 该值设置为 Cisco 。 |
- | network.application_protocol | 如果 protocol 字段分别为 http 或 https ,则将此值设置为 HTTP 或 HTTPS 。 |
- | 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 | 该值会针对不同的事件设置为特定消息。 |
变化
2024-12-12
增强功能:
- 将
intermediary_host
映射到intermediary.hostname
。
2024-12-05
增强功能:
- 添加了 Grok 模式,以支持新的 syslog 日志模式。
- 将
srcip
映射到principal.ip
。
2024-10-30
增强功能:
- 添加了对
BST
时区的metadata.event_timestamp
的支持。
2024-10-15
增强功能:
- 将
inter_hostname
映射到intermediary.ip
,将intermediary_host
映射到intermediary.hostname
。
2024-09-12
增强功能:
- 添加了 Grok 模式,以将
int_ip
映射到intermediary.hostname
。
2024-06-26
增强功能:
- 添加了新的 Grok 模式,用于解析新格式的 SYSLOG 日志。
2024-06-09
增强功能:
- 将 syslog 标头中的
hostname
映射到了intermediary.hostname
。
2024-05-20
增强功能:
- 添加了新的 Grok 模式,用于解析新格式的 SYSLOG 日志。
- 将
MessageSourceAddress
映射到principal.ip
和principal.asset.ip
。 - 将
SourceModuleName
和SourceModuleType
映射到principal.resource.attribute.labels
。
2023-11-10
增强功能:
- 添加了新的 Grok 模式,用于解析失败的 SYSLOG 日志。
- 为
AUTH_VIOLATION
添加了Unable
、exceeded
和No space left on device
条件。
2023-10-30
增强功能:
- 添加了新的 Grok 模式,用于解析失败的 syslog 日志。
- 将
resourcename
映射到principal.resource.name
。 - 将
app_protocol
映射到network.application.protocol
。 - 将
app
映射到target.application
。 - 将
source_port
映射到principal.port
。 - 将
source_ip
映射到principal.ip
。 - 将
device_ip
映射到target.ip
。 - 将
username
映射到target.user.userid
。 - 将
intermediary_ip
映射到intermediary.ip
。 - 将
mnemonics
映射到metadata.event_type
。 - 将
sec_action
映射到security_result.action
。 - 映射了
sec_category
security_result.category
。 - 将
sec_summary
映射到security_result.summary
。 - 对于身份验证类型日志,请将
metadata.event_type
设置为USER_LOGIN
。
2023-05-09
增强功能:
- 值为
FMANFP-6-IPACCESSLOGP
的日志会解析为NETWORK_CONNECTION
事件。
2022-12-02
增强功能:
- 添加了 grok 以支持未解析的 Syslog 日志。
- 如果
principal.hostname
将 event_type 映射从 GENERIC_EVENT 更改为 STATUS_UPDATE。
2022-11-10
增强功能:
- 添加了对 SYS-5-CONFIG_I 事件日志的支持。
- 修改了 grok,以支持具有时区的日志。
2022-10-27
增强功能:
- 解析日志类型 IOSXE-6-PLATFORM 的以下 syslog 字段
- 将
ip
映射到intermediary.ip
- 将
src_ip
映射到principal.ip
- 将
src_port
映射到principal.port
- 将
dst_ip
映射到target.ip
- 将
dst_port
映射到target.port
- 将
protocol
映射到network.ip_protocol
- 将
facility
映射到principal.resource.type
- 将
mnemonics
映射到metadata.product_event_type
- 将
sc_summary
映射到metadata.description
- 将
sr_action
映射到security_result.action
- 将
summary
映射到security_result.summary
2022-08-23
增强功能:
- 更正了主账号和目标 IP 地址的映射
- 将
target_ip
映射到event.idm.read_only_udm.target.ip
- 将
src_ip
映射到event.idm.read_only_udm.principal.asset.ip
2022-07-01
增强功能:
- 修复了解析包含 product_event_type 为 SYS-3-LOGGINGHOST_FAIL、SEC_LOGIN-5-LOGIN_SUCCESS、SYS-6-LOGGINGHOST_STARTSTOP、SYS-6-LOGOUT 且不含时间戳的日志时出错的问题。
- 将 SYS-3-LOGGINGHOST_FAIL 日志的 metadata.event_type 从 GENERIC_EVENT 更改为 STATUS_UPDATE。
需要更多帮助?向社区成员和 Google SecOps 专业人士寻求解答。