收集 Cisco IOS 日志
本文档介绍了如何使用 Bindplane 代理将 Cisco Internetwork Operating System (IOS) 日志注入到 Google Security Operations。解析器会将原始 syslog 消息转换为符合统一数据模型 (UDM) 的结构化格式。它首先使用基于常见 Cisco IOS syslog 格式的 grok 模式初始化并提取字段。然后,它会将提取的字段映射到相应的 UDM 字段,对事件进行分类,并使用其他背景信息丰富数据,最后以 UDM 格式输出结构化日志。
准备工作
- 确保您拥有 Google SecOps 实例。
- 确保您使用的是 Windows 2016 或更高版本,或者具有
systemd
的 Linux 主机。 - 如果通过代理运行,请确保防火墙端口处于开放状态。
- 确保您拥有对 Cisco IOS 的特权访问权限。
获取 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_IOS raw_log_field: body service: pipelines: logs/source0__chronicle_w_labels-0: receivers: - udplog exporters: - chronicle/chronicle_w_labels
根据基础架构的需要替换端口和 IP 地址。
将
<customer_id>
替换为实际的客户 ID。将
/path/to/ingestion-authentication-file.json
更新为获取 Google SecOps 提取身份验证文件部分中保存身份验证文件的路径。
重启 Bindplane 代理以应用更改
如需在 Linux 中重启 Bindplane 代理,请运行以下命令:
sudo systemctl restart bindplane-agent
如需在 Windows 中重启 Bindplane 代理,您可以使用服务控制台,也可以输入以下命令:
net stop BindPlaneAgent && net start BindPlaneAgent
在 Cisco IOS 上配置 Syslog
- 登录 Cisco IOS。
输入以下命令来提升权限:
enable
输入以下命令,切换到配置模式:
conf t
输入以下命令:
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。
- 将
输入以下命令以设置优先级:
logging trap Informational logging console Informational logging severity Informational
设置 syslog 设施:
logging facility syslog
保存并退出。
输入以下命令,配置在重启后仍有效的设置:
copy running-config startup-config
UDM 映射表
日志字段 | UDM 映射 | 逻辑 |
---|---|---|
AcsSessionID | network.session_id | 从 AcsSessionID 字段中获取的值。 |
AcctRequest-Flags | security_result.summary | 从 AcctRequest-Flags 字段中获取的值。 |
AcctRequest-Flags | security_result.action | 如果 AcctRequest-Flags 包含 Start ,则设置为 ALLOW 。如果 AcctRequest-Flags 包含 Stop ,则设置为 BLOCK 。 |
AuthenticationIdentityStore | additional.fields.key = AuthenticationIdentityStore , value = AuthenticationIdentityStore |
从 AuthenticationIdentityStore 字段中获取的值。 |
AuthenticationMethod | additional.fields.key = AuthenticationMethod , value = AuthenticationMethod |
从 AuthenticationMethod 字段中获取的值。 |
AuthenticationStatus | security_result.summary | 从 AuthenticationStatus 字段中获取的值。 |
Authen-Method | security_result.detection_fields.key = Authen-Method , value = Authen-Method |
从 Authen-Method 字段中获取的值。 |
Authen-Method | extensions.auth.type | 如果 Authen-Method 包含 TacacsPlus ,则设置为 TACACS 。 |
AVPair_priv-lvl | security_result.detection_fields.key = AVPair_priv-lvl , value = AVPair_priv-lvl |
从 AVPair_priv-lvl 字段中获取的值。 |
AVPair_start_time | additional.fields.key = AVPair_start_time , value = AVPair_start_time |
从 AVPair_start_time 字段中获取的值。 |
AVPair_task_id | additional.fields.key = AVPair_task_id , value = AVPair_task_id |
取自 AVPair_task_id 字段的值。 |
AVPair_timezone | additional.fields.key = AVPair_timezone , value = AVPair_timezone |
从 AVPair_timezone 字段中获取的值。 |
auditid | metadata.product_log_id | 从 auditid 字段中获取的值。 |
cisco_facility | 未映射到 IDM 对象。 | |
cisco_message | metadata.description | 从 cisco_message 字段中获取的值。 |
cisco_mnemonic | security_result.rule_name | 从 cisco_mnemonic 字段中获取的值。 |
cisco_severity | security_result.severity | 根据值映射到不同的严重程度级别:0:ALERT,1:CRITICAL,2:HIGH,3:ERROR,4:MEDIUM,5:LOW,6:INFORMATIONAL,7:INFORMATIONAL。 |
cisco_severity | security_result.severity_details | 根据值映射到不同的严重程度详细信息:0:System unusable ,1:Immediate action needed ,2:Critical condition ,3:Error condition ,4:Warning condition ,5:Normal but significant condition ,6:Informational message only ,7:Appears during debugging only 。 |
cisco_tag | metadata.product_event_type | 从 cisco_tag 字段中获取的值。 |
cisco_tag | metadata.event_type | 根据值映射到不同的事件类型:SYS-6-LOGGINGHOST_STARTSTOP、TRACK-6-STATE、SYS-3-LOGGINGHOST_FAIL、CRYPTO-4-IKMP_NO_SA、HA_EM-3-FMPD_ACTION_NOTRACK、HA_EM-3-FMPD_ERROR:GENERIC_EVENT;IPSEC-3-REPLAY_ERROR、CRYPTO-4-RECVD_PKT_INV_SPI、IPSEC-3-HMAC_ERROR、FW-6-DROP_PKT、SEC-6-IPACCESSLOGP:NETWORK_UNCATEGORIZED;CRYPTO-4-IKMP_BAD_MESSAGE、CRYPTO-6-IKMP_NOT_ENCRYPTED、CRYPTO-6-IKMP_MODE_FAILURE:STATUS_UNCATEGORIZED;SYS-5-CONFIG_I:USER_UNCATEGORIZED。 |
ClientLatency | additional.fields.key = ClientLatency , value = ClientLatency |
从 ClientLatency 字段中获取的值。 |
CmdSet | additional.fields.key = CmdSet , value = CmdSet |
从 CmdSet 字段中获取的值。 |
命令 | principal.process.command_line | 从命令字段中获取的值。 |
CPMSessionID | additional.fields.key = CPMSessionID , value = CPMSessionID |
从 CPMSessionID 字段中获取的值。 |
说明 | metadata.description | 从说明字段中获取的值。 |
DestinationIPAddress | target.asset.ip | 从 DestinationIPAddress 字段中获取的值。 |
DestinationIPAddress | target.ip | 从 DestinationIPAddress 字段中获取的值。 |
DestinationPort | target.port | 从 DestinationPort 字段中获取的值。 |
Device_IP_Address | principal.asset.ip | 从 Device_IP_Address 字段中获取的值。 |
Device_IP_Address | principal.ip | 从 Device_IP_Address 字段中获取的值。 |
Device_Type | additional.fields.key = Device_Type , value = Device_Type |
从 Device_Type 字段中获取的值。 |
dst_ip | target.asset.ip | 取自 dst_ip 字段的值。 |
dst_ip | target.ip | 取自 dst_ip 字段的值。 |
dst_port | target.port | 取自 dst_port 字段的值。 |
dst_user | target.user.userid | 从 dst_user 字段中获取的值。 |
EnableFlag | security_result.detection_fields.key = EnableFlag , value = EnableFlag |
从 EnableFlag 字段中获取的值。 |
IdentityGroup | additional.fields.key = IdentityGroup , value = IdentityGroup |
从 IdentityGroup 字段中获取的值。 |
IdentitySelectionMatchedRule | security_result.detection_fields.key = IdentitySelectionMatchedRule , value = IdentitySelectionMatchedRule |
从 IdentitySelectionMatchedRule 字段中获取的值。 |
intermediary_host | intermediary.hostname | 从 intermediary_host 字段中获取的值。 |
intermediary_ip | intermediary.ip | 从 intermediary_ip 字段中获取的值。 |
IPSEC | additional.fields.key = IPSEC , value = IPSEC |
从 IPSEC 字段中获取的值。 |
ISEPolicySetName | extensions.auth.type | 如果 ISEPolicySetName 包含 Tacacs ,则设置为 TACACS 。 |
IsMachineAuthentication | additional.fields.key = IsMachineAuthentication , value = IsMachineAuthentication |
从 IsMachineAuthentication 字段中获取的值。 |
IsMachineIdentity | security_result.detection_fields.key = IsMachineIdentity , value = IsMachineIdentity |
从 IsMachineIdentity 字段中获取的值。 |
位置 | additional.fields.key = Location , value = Location |
从“位置”字段中获取的值。 |
MatchedCommandSet | additional.fields.key = MatchedCommandSet , value = MatchedCommandSet |
从 MatchedCommandSet 字段中获取的值。 |
消息 | 未映射到 IDM 对象。 | |
metadata_event_type | metadata.event_type | 从 metadata_event_type 字段中获取的值。如果为空或为 GENERIC_EVENT ,则在 principal_mid_present 和 target_mid_present 为 true 时设置为 NETWORK_UNCATEGORIZED,在 principal_userid_present 为 true 时设置为 USER_UNCATEGORIZED,在 principal_mid_present 为 true 时设置为 STATUS_UPDATE,否则设置为 GENERIC_EVENT。如果服务包含 Login ,则在 principal_userid_present、principal_mid_present 和 target_mid_present 为 true 时设置为 USER_LOGIN,在 principal_userid_present 为 true 时设置为 USER_UNCATEGORIZED。 |
Model_Name | additional.fields.key = Model_Name , value = Model_Name |
从 Model_Name 字段中获取的值。 |
名称 | additional.fields.key = Name , value = Name |
从“名称”字段中获取的值。 |
Network_Device_Profile | additional.fields.key = Network_Device_Profile , value = Network_Device_Profile |
从 Network_Device_Profile 字段中获取的值。 |
NetworkDeviceGroups | additional.fields.key = NetworkDeviceGroups , value = NetworkDeviceGroups |
从 NetworkDeviceGroups 字段中获取的值。 |
NetworkDeviceName | principal.asset.hostname | 从 NetworkDeviceName 字段中获取的值。 |
NetworkDeviceName | principal.hostname | 从 NetworkDeviceName 字段中获取的值。 |
NetworkDeviceProfileId | principal.resource.product_object_id | 从 NetworkDeviceProfileId 字段中获取的值。 |
pid | principal.process.pid | 从 PID 字段中获取的值。 |
端口 | principal.resource.attribute.labels.key = Port ,value = Port |
从“端口”字段中获取的值。 |
权限级别 | security_result.detection_fields.key = Privilege-Level , value = Privilege-Level |
从“Privilege-Level”字段中获取的值。 |
product_event_type | metadata.product_event_type | 从 product_event_type 字段中获取的值。 |
协议 | additional.fields.key = Protocol , value = Protocol |
从“协议”字段中获取的值。 |
协议 | network.application_protocol | 如果协议为 HTTPS ,则设置为 HTTPS 。 |
协议 | network.ip_protocol | 如果协议为 TCP 或 UDP ,则设置为协议的大写值。 |
reason | security_result.summary | 从 reason 字段中获取的值。 |
区域 | principal.location.country_or_region | 从“区域”字段中获取的值。 |
Remote-Address | target.asset.ip | 从“Remote-Address”字段中获取值,并验证该值是否为 IP 地址。 |
Remote-Address | target.ip | 从“Remote-Address”字段中获取值,并验证该值是否为 IP 地址。 |
RequestLatency | security_result.detection_fields.key = RequestLatency , value = RequestLatency |
从 RequestLatency 字段中获取的值。 |
响应 | additional.fields.key = Response , value = Response |
从响应字段中获取的值。 |
SelectedAccessService | security_result.action_details | 从 SelectedAccessService 字段中获取的值。 |
SelectedAuthenticationIdentityStores | security_result.detection_fields.key = SelectedAuthenticationIdentityStores , value = SelectedAuthenticationIdentityStores |
从 SelectedAuthenticationIdentityStores 字段中获取的值。 |
SelectedCommandSet | additional.fields.key = SelectedCommandSet , value = SelectedCommandSet |
从 SelectedCommandSet 字段中获取的值。 |
服务 | additional.fields.key = Service , value = Service |
从服务字段中获取的值。 |
Service-Argument | additional.fields.key = Service-Argument , value = Service-Argument |
从 Service-Argument 字段中获取的值。 |
和程度上减少 | security_result.severity | 如果严重程度包含 Notice ,则设置为 INFORMATIONAL。 |
Software_Version | additional.fields.key = Software_Version , value = Software_Version |
从 Software_Version 字段中获取的值。 |
source_facility | principal.asset.hostname | 从 source_facility 字段中获取的值。 |
source_facility | principal.hostname | 从 source_facility 字段中获取的值。 |
src_ip | principal.asset.ip | 从 src_ip 字段中获取的值。 |
src_ip | principal.ip | 从 src_ip 字段中获取的值。 |
src_mac | principal.mac | 将 . 替换为 : 后从 src_mac 字段中获取的值。 |
src_port | principal.port | 从 src_port 字段中获取的值。 |
src_user_id | principal.user.userid | 从 src_user_id 字段中获取的值。如果为空,则从“用户”字段中获取值。如果仍为空,则从 StepData_9 字段中获取值。 |
src_user_name | principal.user.user_display_name | 从 src_user_name 字段中获取的值。 |
步骤 | additional.fields.key = Step ,value = Step |
从“步数”字段中获取的值。 |
StepData_10 | principal.asset.hostname | 从 StepData_10 字段中获取的值。 |
StepData_10 | principal.hostname | 从 StepData_10 字段中获取的值。 |
StepData_13 | security_result.summary | 从 StepData_13 字段中获取的值。 |
StepData_14 | security_result.detection_fields.key = StepData_14 , value = StepData_14 |
从 StepData_14 字段中获取的值。 |
StepData_15 | security_result.detection_fields.key = StepData_15 , value = StepData_15 |
从 StepData_15 字段中获取的值。 |
StepData_20 | security_result.detection_fields.key = StepData_20 , value = StepData_20 |
从 StepData_20 字段中获取的值。 |
StepData_21 | security_result.detection_fields.key = StepData_21 , value = StepData_21 |
从 StepData_21 字段中获取的值。 |
StepData_3 | additional.fields.key = StepData_3 , value = StepData_3 |
从 StepData_3 字段获取的值。 |
StepData_4 | security_result.detection_fields.key = StepData_4 , value = StepData_4 |
从 StepData_4 字段中获取的值。 |
StepData_6 | security_result.detection_fields.key = StepData_6 , value = StepData_6 |
从 StepData_6 字段中获取的值。 |
StepData_7 | security_result.detection_fields.key = StepData_7 , value = StepData_7 |
从 StepData_7 字段中获取的值。 |
StepData_8 | security_result.detection_fields.key = StepData_8 , value = StepData_8 |
从 StepData_8 字段中获取的值。 |
StepData_9 | principal.user.userid | 如果 src_user_id 和 User 字段为空,则取自 StepData_9 字段的值。 |
target_host | target.asset.hostname | 从 target_host 字段中获取的值。 |
target_host | target.hostname | 从 target_host 字段中获取的值。 |
时间戳 | metadata.event_timestamp | 从时间戳字段中提取的值,在提取之前会移除多余的空格并解析日期。 |
TotalAuthenLatency | additional.fields.key = TotalAuthenLatency , value = TotalAuthenLatency |
从 TotalAuthenLatency 字段中获取的值。 |
ts | metadata.event_timestamp | 解析日期后从 ts 字段中获取的值。 |
类型 | security_result.category_details | 从“类型”字段中获取的值。 |
用户 | principal.user.userid | 如果 src_user_id 为空,则取自 User 字段的值。 |
UserType | additional.fields.key = UserType , value = UserType |
从 UserType 字段中获取的值。 |
metadata.vendor_name | 设置为 CISCO 。 |
|
metadata.product_name | 设置为 CISCO_IOS 。 |
|
metadata.log_type | 设置为 CISCO_IOS 。 |
需要更多帮助?从社区成员和 Google SecOps 专业人士那里获得解答。