收集 Arista 交換器記錄

剖析器版本:3.0

支援:

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

Arista EOS (Extensible Operating System) 在 Arista 網路切換裝置上執行,並會針對系統事件、介面變更、驗證、AAA 帳戶和通訊協定狀態變更產生系統記錄訊息。剖析器會處理 JSON 和 syslog 格式。

事前準備

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

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

取得 Bindplane 代理程式的 Google SecOps 憑證

如要向 Google SecOps 驗證 Bindplane 代理程式,請選擇下列其中一種方法:

  • 新部署作業:使用 Chronicle API (選項 1)。
  • 舊版部署作業:繼續使用擷取驗證檔案 (選項 2),直到 Ingestion API 於 2027 年 7 月 20 日停用。
  1. 登入 Google Cloud 控制台,選取連結至 Google SecOps 執行個體的 Google Cloud 專案。
  2. 依序前往「IAM & Admin」(IAM 與管理) >「Service Accounts」(服務帳戶)。
  3. 按一下「建立服務帳戶」。
  4. 請提供下列設定詳細資料:
    • 「Service account name」(服務帳戶名稱):輸入帳戶名稱 (例如 bindplane-ingest)。
    • 「服務帳戶說明」:輸入說明 (例如 Bindplane agent log ingestion)。
  5. 點按「Create and continue」(建立並繼續)。
  6. 在「將專案存取權授予這個服務帳戶」部分,按一下「選取角色」,然後選取「Chronicle 編輯者」。
  7. 依序點選「繼續」和「完成」。
  8. 按一下您建立的服務帳戶,然後前往「金鑰」分頁。
  9. 依序點選「新增金鑰」>「建立新的金鑰」。
  10. 選取「JSON」,然後點選「建立」。金鑰檔案會下載到電腦。
  11. 將金鑰檔案儲存為 Bindplane 收集器目錄中的 ingestion-auth.json (Linux 上的 /opt/observiq-otel-collector/ingestion-auth.json 或 Windows 上的 C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json),或更新 config.yaml 中的 creds_file_path,使其與儲存路徑相符。
  12. 依序前往「IAM & Admin」(IAM 與管理) >「Settings」(設定),然後複製「Project number」(專案編號)。設定匯出工具時會用到。

方法 2:下載擷取驗證檔案 (舊版)

  1. 登入 Google SecOps 控制台。
  2. 依序前往「SIEM Settings」 > 「Collection Agents」。
  3. 下載擷取驗證檔案。
  4. 將檔案安全地儲存在要安裝 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. 開啟具有 root 或 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
    

    服務應顯示為「active (running)」。

其他安裝資源

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

設定 Bindplane 代理程式,擷取系統記錄檔並傳送至 Google SecOps

找出設定檔

  • Linux:

    sudo nano /opt/observiq-otel-collector/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:
        protocol: https
        # Region of your instance, for example us, europe, asia-southeast1
        location: <LOCATION>
        # Project number of the Google Cloud project linked to the instance
        project: '<PROJECT_NUMBER>'
        compression: gzip
        creds_file_path: '/opt/observiq-otel-collector/ingestion-auth.json'
        customer_id: '<customer_id>'
        endpoint: chronicle.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 是標準 syslog 通訊埠 (在 Linux 上需要根目錄;非根目錄請使用 1514)
  • Exporter 設定:

    • creds_file_path:服務帳戶 JSON 金鑰檔案的完整路徑 (選項 1):
      • Linux:/opt/observiq-otel-collector/ingestion-auth.json
      • Windows:C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
    • customer_id:從 Google SecOps 控制台複製的客戶 ID
    • location:將 <LOCATION> 替換為 Google SecOps 執行個體的區域 (例如 us、europe 或 asia-southeast1)。匯出工具會在這個值前面加上 chronicle.googleapis.com。如需完整清單,請參閱「區域性端點」。
    • project:將 <PROJECT_NUMBER> 替換為「IAM 與管理」>「設定」中的專案編號。
    • endpoint:維持設為 chronicle.googleapis.com。

舊版擷取 API 匯出工具

  • 如果您使用選項 2 的擷取驗證檔案,請將 exporters 區塊替換為下列內容。將 creds_file_path 設為擷取驗證檔案的路徑,如果您的執行個體位於美國境外,請將 malachiteingestion-pa.googleapis.com 替換為區域端點 (例如 europe-malachiteingestion-pa.googleapis.com)。

    exporters:
      chronicle/arista_switch:
        compression: gzip
        creds_file_path: '/opt/observiq-otel-collector/ingestion-auth.json'
        customer_id: '<customer_id>'
        endpoint: malachiteingestion-pa.googleapis.com
        log_type: ARISTA_SWITCH
        raw_log_field: body
    

儲存設定檔

  • 編輯完畢後,請儲存檔案:
    • Linux:依序按下 Ctrl+O、Enter 和 Ctrl+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. 設定 syslog 目的地,將記錄傳送至 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.ip、target.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.hostname、principal.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.ip、principal.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.severity、security_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.ip、principal.asset.ip 直接從 source_ip 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
source_port principal.port 直接從 source_port 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
src_ip principal.ip、principal.asset.ip 直接從 src_ip 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
table_name target.resource.name 直接從 table_name 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。如果這個欄位已填入資料,target.resource.resource_type 會設為「TABLE」。
target_host target.hostname、target.asset.hostname 直接從 target_host 欄位對應,該欄位是使用 grok 模式從 message 欄位擷取。
target_ip target.ip、target.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 專家尋求解答。