收集 Arista 交換器記錄

剖析器版本:3.0

支援的國家/地區:

本文說明如何使用 Bindplane 代理程式,將 Arista 交換器記錄擷取至 Google Security Operations。

Arista EOS (可擴充作業系統) 會在 Arista 網路交換器上執行,並為系統事件、介面變更、驗證、AAA 記帳和通訊協定狀態變更產生系統記錄訊息。剖析器會處理 JSON 和系統記錄格式。

事前準備

請確認您已完成下列事前準備事項:

  • Google SecOps 執行個體
  • Windows Server 2016 以上版本,或搭載 systemd 的 Linux 主機
  • Bindplane 代理程式與 Arista 交換器之間的網路連線
  • 如果透過 Proxy 執行,請確保防火牆通訊埠已根據 Bindplane 代理程式需求開啟
  • Arista EOS 4.23.x 以上版本
  • Arista EOS 交換器的特殊存取權

取得 Google SecOps 擷取驗證檔案

  1. 登入 Google SecOps 控制台。
  2. 依序前往「SIEM 設定」>「收集代理程式」
  3. 下載擷取驗證檔案。將檔案安全地儲存在要安裝 Bindplane 的系統上。

取得 Google SecOps 客戶 ID

  1. 登入 Google SecOps 控制台。
  2. 依序前往「SIEM 設定」>「設定檔」
  3. 複製並儲存「機構詳細資料」部分中的客戶 ID

安裝 Bindplane 代理程式

請按照下列操作說明,在 Windows 或 Linux 作業系統上安裝 Bindplane 代理程式。

Windows 安裝

  1. 以管理員身分開啟「命令提示字元」或「PowerShell」
  2. 執行下列指令:

    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
    
  3. 等待安裝完成。

  4. 執行下列指令,確認安裝成功:

    sc query observiq-otel-collector
    

    服務應顯示為「RUNNING」

Linux 安裝

  1. 開啟具有根層級或 sudo 權限的終端機。
  2. 執行下列指令:

    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
    
  3. 等待安裝完成。

  4. 執行下列指令,確認安裝成功:

    sudo systemctl status observiq-otel-collector
    

    服務應顯示為有效 (執行中)

其他安裝資源

如需其他安裝選項和疑難排解資訊,請參閱 Bindplane 代理程式安裝指南

設定 Bindplane 代理程式,擷取系統記錄檔並傳送至 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/arista_switch:
            compression: gzip
            creds_file_path: '/etc/bindplane-agent/ingestion-auth.json'
            customer_id: '<customer_id>'
            endpoint: malachiteingestion-pa.googleapis.com
            log_type: ARISTA_SWITCH
            raw_log_field: body
    
    service:
        pipelines:
            logs/arista_to_chronicle:
                receivers:
                    - udplog
                exporters:
                    - chronicle/arista_switch
    

設定參數

替換下列預留位置:

  • 接收器設定:

    • listen_address:要接聽的 IP 位址和通訊埠:
      • 0.0.0.0,監聽所有介面 (建議)
      • 通訊埠 514 是標準的系統記錄通訊埠 (在 Linux 上需要根層級權限;非根層級權限請使用 1514)
  • 匯出工具設定:

    • creds_file_path:擷取驗證檔案的完整路徑:
      • Linux/etc/bindplane-agent/ingestion-auth.json
      • WindowsC:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
    • customer_id:從 Google SecOps 控制台複製的客戶 ID
    • endpoint:區域端點網址:
      • 美國malachiteingestion-pa.googleapis.com
      • 歐洲europe-malachiteingestion-pa.googleapis.com
      • 亞洲asia-southeast1-malachiteingestion-pa.googleapis.com
      • 如需完整清單,請參閱「區域端點

儲存設定檔

  • 編輯完成後,請儲存檔案:
    • Linux:依序按下 Ctrl+OEnterCtrl+X
    • Windows:依序點選「檔案」>「儲存」

重新啟動 Bindplane 代理程式,以套用變更

  • 如要在 Linux 中重新啟動 Bindplane 代理程式,請執行下列指令:

    sudo systemctl restart observiq-otel-collector
    
    1. 確認服務正在執行:

      ```bash
      sudo systemctl status observiq-otel-collector
      ```
      
    2. 檢查記錄中是否有錯誤:

      ```bash
      sudo journalctl -u observiq-otel-collector -f
      ```
      
  • 如要在 Windows 中重新啟動 Bindplane 代理程式,請選擇下列其中一個選項:

    • 以管理員身分開啟命令提示字元或 PowerShell:

      net stop observiq-otel-collector && net start observiq-otel-collector
      
    • 服務控制台:

      1. 按下 Win+R,輸入 services.msc,然後按下 Enter 鍵。
      2. 找出 observIQ OpenTelemetry Collector
      3. 按一下滑鼠右鍵,然後選取「重新啟動」
      4. 確認服務正在執行:

        sc query observiq-otel-collector
        
      5. 檢查記錄中是否有錯誤:

        type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"
        

在 Arista 交換器上設定系統記錄

  1. 登入 Arista 交換器。
  2. 進入設定模式:

    Arista# configure terminal
    
  3. 設定系統記錄檔目的地,將記錄傳送至 Bindplane 代理程式:

    Arista(config)# logging host <bindplane-server-ip> <port-number> protocol udp
    Arista(config)# logging trap informational
    Arista(config)# copy running-config startup-config
    
    • <bindplane-server-ip> 替換為 Bindplane 代理程式 IP 位址。
    • <port-number> 替換為設定用於監聽的通訊埠 (例如 514)。
  4. (選用) 啟用 AAA 記帳的指令執行記錄:

    Arista(config)# aaa accounting commands all console start-stop logging
    Arista(config)# aaa accounting commands all default start-stop logging
    Arista(config)# aaa accounting exec console start-stop logging
    Arista(config)# aaa accounting exec default start-stop logging
    Arista(config)# copy running-config startup-config
    
  5. (選用) 啟用驗證成功和失敗記錄:

    Arista(config)# aaa authentication policy on-success log
    Arista(config)# aaa authentication policy on-failure log
    Arista(config)# copy running-config startup-config
    

UDM 對應表

記錄欄位 UDM 對應 邏輯
appname target.application 直接從「appname」欄位對應。
description metadata.description 直接從 description 欄位對應,該欄位是使用以 product_event_type 為基礎的 grok 模式,從 message 欄位擷取。
dst_ip target.iptarget.asset.ip 直接從 dst_ip 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
dst_mac target.mac 直接從 dst_mac 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
dst_port target.port 直接從 dst_port 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
facility additional.fields[facility].string_value 直接從「facility」欄位對應。
hostname principal.hostnameprincipal.asset.hostname 直接從「hostname」欄位對應。
inner_msg metadata.description 直接從 inner_msg 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
ip_protocol network.ip_protocol 直接從 ip_protocol 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。如果值為「tcp」,系統會轉換為「TCP」。如果事件類型為「NO_IGMP_QUERIER」,則會設為「IGMP」。
pid principal.process.pid 直接從 pid 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
prin_ip principal.ipprincipal.asset.ip 直接從 prin_ip 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
product_event_type metadata.product_event_type 直接從 product_event_type 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
proto network.application_protocol 如果 proto 欄位為「sshd」,UDM 欄位會設為「SSH」。
severity security_result.severitysecurity_result.severity_details security_result.severity 是根據以下對應關係從 severity 欄位衍生而來:「DEFAULT」、「DEBUG」、「INFO」、「NOTICE」->「INFORMATIONAL」;「WARNING」、「ERROR」、「ERR」、「WARN」->「MEDIUM」;「CRITICAL」、「ALERT」、「EMERGENCY」->「HIGH」。severity 的原始值會對應至 security_result.severity_details
session_id network.session_id 直接從 session_id 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
source_ip principal.ipprincipal.asset.ip 直接從 source_ip 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
source_port principal.port 直接從 source_port 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
src_ip principal.ipprincipal.asset.ip 直接從 src_ip 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
table_name target.resource.name 直接從 table_name 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。如果填入這個欄位,target.resource.resource_type 會設為「TABLE」。
target_host target.hostnametarget.asset.hostname 直接從 target_host 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
target_ip target.iptarget.asset.ip 直接從 target_ip 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
target_package target.process.command_line 直接從 target_package 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
target_port target.port 直接從 target_port 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
timestamp metadata.event_timestamp 剖析為時間戳記物件後,直接從 timestamp 欄位對應。
user principal.user.userid 直接從 user 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
user_name target.user.userid 直接從 user_name 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
vrf additional.fields[vrf].string_value 直接從 vrf 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。根據剖析器程式碼所述的複雜條件邏輯,從「has_principal」、「has_target」、「user」、「message」、「product_event_type」和「description」欄位組合衍生而來。預設值為「GENERIC_EVENT」。硬式編碼為「ARISTA_SWITCH」。硬式編碼為「Arista Switch」。已硬式編碼為「Arista」。如果 description 欄位包含「connection rejected」,請設為「BLOCK」。
dpid additional.fields[DPID].string_value 直接從「dpid」欄位對應。
intf additional.fields[intf].string_value 直接從「intf」欄位對應。

變更記錄

查看這個剖析器的變更記錄

還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求答案。