收集 F5 BIG-IP LTM 記錄

支援的國家/地區:

本文說明如何使用 Bindplane,將 F5 BIG-IP LTM 記錄擷取至 Google Security Operations。

事前準備

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

  • Google SecOps 執行個體
  • 搭載 systemd 的 Windows 2016 以上版本或 Linux 主機
  • 如果透過 Proxy 執行,請確保防火牆通訊埠已根據 Bindplane 代理程式需求開啟
  • F5 BIG-IP LTM 裝置的管理員存取權 (TMSH 或網頁 UI)

取得 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
    

Linux 安裝

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

    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
    

其他安裝資源

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

  1. 存取設定檔:

    1. 找出 config.yaml 檔案。通常位於 Linux 的 /etc/bindplane-agent/ 目錄,或 Windows 的安裝目錄。
    2. 使用文字編輯器 (例如 nanovi 或記事本) 開啟檔案。
  2. 按照下列方式編輯 config.yaml 檔案:

      receivers:
        # UDP syslog listener (RFC5424 over UDP)
        udplog:
          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_file_path: "/opt/observiq-otel-collector/ingestion-auth.json"
          # Replace with your actual customer ID from Step 2
          customer_id: "<YOUR_CUSTOMER_ID>"
          # Select the appropriate regional endpoint based on where your Google SecOps instance is provisioned
          # For regional endpoints, see: [https://cloud.google.com/chronicle/docs/reference/ingestion-api#regional_endpoints](https://cloud.google.com/chronicle/docs/reference/ingestion-api#regional_endpoints)
          endpoint: "<YOUR_REGIONAL_ENDPOINT>"
          # Set the log_type to ensure the correct parser is applied
          log_type: "F5_BIGIP_LTM"
          raw_log_field: body
          # You can optionally add other custom ingestion labels here if needed
          ingestion_labels:
    
      service:
        pipelines:
          logs/f5ltm:
            receivers: [udplog]
            exporters: [chronicle/chronicle_w_labels]
    
    • listen_address 設為 0.0.0.0:514,可接受來自任何來源的系統記錄檔。如有需要,請調整為特定介面。
    • UDP 通訊埠 514 是標準系統記錄檔通訊埠。如果通訊埠 514 需要超級使用者權限,您可以改用 1024 以上的通訊埠 (例如 5514),並相應調整 F5 設定。
    • 如要使用 TCP 而非 UDP,請建立 tcplog 接收器,並將 F5 Remote High-Speed Log 通訊協定設為 tcp
  3. 儲存檔案並結束編輯器。

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

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

    sudo systemctl restart bindplane-agent
    
  • 如要在 Windows 中重新啟動 Bindplane 代理程式,可以使用「服務」控制台,或輸入下列指令:

    net stop BindPlaneAgent && net start BindPlaneAgent
    

設定 F5 BIG-IP LTM 系統記錄轉送

方法 A:使用 TMSH (指令列介面)

  1. 為系統記錄目的地建立集區

    1. 透過 SSH 連線至 F5 BIG-IP LTM 裝置。
    2. 執行下列指令:

      tmsh create ltm pool f5_syslog_pool members add { <BINDPLANE_IP>:514 } monitor gateway_icmp
      
      • <BINDPLANE_IP> 替換為 Bindplane 代理程式主機的 IP 位址。
  2. 建立記錄目的地

    tmsh create sys log-config destination remote-high-speed-log f5_hsl_dest protocol udp pool-name f5_syslog_pool
    
    tmsh create sys log-config destination remote-syslog f5_remote_syslog_dest format rfc5424 remote-high-speed-log f5_hsl_dest
    
  3. 建立記錄發布者

    tmsh create sys log-config publisher f5_log_publisher destinations add { f5_remote_syslog_dest }
    
  4. 建立要求記錄設定檔

    tmsh create ltm profile request-log f5_ltm_request_log \
      request-log-pool f5_syslog_pool request-log-protocol mds-udp \
      request-log-template 'event_source="request_logging",hostname="$BIGIP_HOSTNAME",client_ip="$CLIENT_IP",server_ip="$SERVER_IP",http_method="$HTTP_METHOD",http_uri="$HTTP_URI",http_host="${host}",virtual_name="$VIRTUAL_NAME",event_timestamp="$DATE_HTTP"' \
      request-logging enabled \
      response-log-pool f5_syslog_pool response-log-protocol mds-udp \
      response-log-template 'event_source="response_logging",hostname="$BIGIP_HOSTNAME",client_ip="$CLIENT_IP",server_ip="$SERVER_IP",http_method="$HTTP_METHOD",http_uri="$HTTP_URI",http_host="${host}",virtual_name="$VIRTUAL_NAME",http_statcode="$HTTP_STATCODE",event_timestamp="$DATE_HTTP"' \
      response-logging enabled
    
  5. 將記錄設定檔套用至虛擬伺服器

    tmsh modify ltm virtual <VIRTUAL_SERVER_NAME> profiles add { f5_ltm_request_log }
    
    • <VIRTUAL_SERVER_NAME> 替換為虛擬伺服器的名稱。
  6. 儲存設定

    tmsh save sys config
    

選項 B:使用 F5 網頁 UI (設定公用程式)

  1. 為系統記錄目的地建立集區

    1. 登入 F5 BIG-IP LTM 網頁介面。
    2. 依序前往「Local Traffic」>「Pools」>「Pool List」
    3. 點選「建立」
    4. 提供下列設定詳細資料:
      • 「Name」(名稱):輸入 f5_syslog_pool
      • 健康狀態監控器:選取 gateway_icmp
    5. 在「資源」部分的「新成員」下方:
      • 地址:輸入 Bindplane 代理程式 IP 位址。
      • 服務連接埠:輸入 514
    6. 按一下「新增」。
    7. 按一下「完成」
  2. 建立遠端高速記錄目的地

    1. 依序前往「系統」>「記錄」>「設定」>「記錄目的地」
    2. 點選「建立」
    3. 提供下列設定詳細資料:
      • 「Name」(名稱):輸入 f5_hsl_dest
      • 類型:選取「遠端高速記錄」
      • 「通訊協定」:選取「UDP」
      • 「集區名稱」:選取 f5_syslog_pool
    4. 按一下「完成」
  3. 建立遠端系統記錄檔目的地

    1. 依序前往「系統」>「記錄」>「設定」>「記錄目的地」
    2. 點選「建立」
    3. 提供下列設定詳細資料:
      • 「Name」(名稱):輸入 f5_remote_syslog_dest
      • 類型:選取「遠端系統記錄檔」
      • Syslog 格式:選取 RFC5424
      • 遠端高速記錄:選取 f5_hsl_dest
    4. 按一下「完成」
  4. 建立記錄發布者

    1. 依序前往「系統」>「記錄」>「設定」>「記錄發布者」
    2. 點選「建立」
    3. 提供下列設定詳細資料:
      • 「Name」(名稱):輸入 f5_log_publisher
      • 目的地:將 f5_remote_syslog_dest 從「可用」移至「已選取」
    4. 按一下「完成」
  5. 建立要求記錄設定檔

    1. 依序前往「Local Traffic」>「Profiles」>「Other」>「Request Logging」
    2. 點選「建立」
    3. 提供下列設定詳細資料:
      • 「Name」(名稱):輸入 f5_ltm_request_log
      • 家長個人資料:選取 request-log
    4. 在「要求設定」下方:

      • 要求記錄:選取「已啟用」
      • 要求記錄通訊協定:選取 mds-udp
      • 要求記錄集區:選取 f5_syslog_pool
      • 要求記錄範本:輸入下列內容:

        event_source="request_logging",hostname="$BIGIP_HOSTNAME",client_ip="$CLIENT_IP",server_ip="$SERVER_IP",http_method="$HTTP_METHOD",http_uri="$HTTP_URI",http_host="${host}",virtual_name="$VIRTUAL_NAME",event_timestamp="$DATE_HTTP"
        
    5. 在「回覆設定」下方:

      • 回應記錄:選取「已啟用」
      • 回應記錄通訊協定:選取 mds-udp
      • 回應記錄集區:選取 f5_syslog_pool
      • 回應記錄範本:輸入下列內容:

        event_source="response_logging",hostname="$BIGIP_HOSTNAME",client_ip="$CLIENT_IP",server_ip="$SERVER_IP",http_method="$HTTP_METHOD",http_uri="$HTTP_URI",http_host="${host}",virtual_name="$VIRTUAL_NAME",http_statcode="$HTTP_STATCODE",event_timestamp="$DATE_HTTP"
        
  6. 按一下「完成」

將要求記錄設定檔套用至虛擬伺服器

  1. 依序前往「Local Traffic」>「Virtual Servers」>「Virtual Server List」
  2. 按一下虛擬伺服器名稱。
  3. 前往「資源」分頁。
  4. 在「iRules and Profiles」下方,按一下「Profiles」旁的「Manage」
  5. 在「可用」下方找到 f5_ltm_request_log,然後移至「已選取」
  6. 按一下「完成」
  7. 按一下「Update」

UDM 對應表

記錄欄位 UDM 對應 邏輯
hostname principal.hostname Syslog 主機名稱 (發出記錄的裝置)
client_ip principal.ip 用戶端的來源 IP 位址
client_port principal.port 來源通訊埠 (如果範本中包含)
server_ip target.ip 目的地 IP (集區成員)
server_port target.port 目的地通訊埠 (集區成員)
http_method network.http.method HTTP 要求方法
http_uri network.http.url HTTP 要求 URI (包括路徑/查詢,如有)
http_host network.http.host HTTP Host 標頭
http_statcode network.http.response_code HTTP 回應狀態碼
user_agent network.http.user_agent User-Agent 標頭
virtual_name target.application F5 虛擬伺服器的名稱
event_timestamp metadata.event_timestamp 裝置的事件時間
event_source metadata.product_event_type 事件類型標記 (request_logging、response_logging)

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