收集 Cisco 路由器記錄
本文說明如何使用 Bindplane 代理程式,將 Cisco 路由器記錄擷取至 Google Security Operations。剖析器會先使用一系列 Grok 模式,從各種系統記錄訊息格式中擷取通用欄位,並處理不同的時間戳記和鍵值資料變化。然後根據擷取的事件類型 (設施、助記符、message_type) 套用特定邏輯,使用額外欄位擴充資料,並將這些欄位對應至 UDM 模型。
事前準備
- 確認您擁有 Google SecOps 執行個體。
- 確認您使用的是 Windows 2016 以上版本,或是搭載
systemd
的 Linux 主機。 - 如果透過 Proxy 執行,請確認防火牆通訊埠已開啟。
- 確認您具備 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 安裝
- 開啟具有根層級或 sudo 權限的終端機。
執行下列指令:
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
其他安裝資源
- 如需其他安裝選項,請參閱這份安裝指南。
設定 Bindplane 代理程式,擷取系統記錄檔並傳送至 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。將
/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 路由器上設定系統記錄
- 登入 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
設定系統記錄設施:
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 欄位。 |
- | 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 | 這個值會設為不同事件的特定訊息。 |
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求答案。