收集 Suricata EVE 記錄

支援的服務:

本文說明如何使用 Bindplane,將 Suricata EVE 記錄檔擷取至 Google Security Operations。

Suricata 是開放原始碼的高效能網路威脅偵測引擎,可提供入侵偵測 (IDS)、入侵防禦 (IPS) 和網路安全監控功能。EVE (可擴充事件格式) 記錄輸出提供完整的 JSON 格式記錄,涵蓋警告、流量、DNS、HTTP、TLS 和檔案交易資料。這個剖析器會從 Suricata EVE JSON 格式記錄中擷取欄位。這項服務會剖析 JSON 訊息,然後將這些值對應至統合式資料模型 (UDM)。並設定事件來源和類型的預設中繼資料值。

事前準備

請確認您符合下列必要條件:

  • Google SecOps 執行個體
  • Windows Server 2016 以上版本,或搭載 systemd 的 Linux 主機
  • 如果透過 Proxy 執行,請確保防火牆通訊埠已根據 Bindplane 代理程式需求開啟
  • Suricata 主機的特殊存取權 (root 或 sudo)

取得 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. 請提供下列設定詳細資料:
    • 服務帳戶名稱:輸入帳戶名稱 (例如 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 設定」>「收集代理程式」。
  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/chronicle_w_labels:
        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: '/path/to/ingestion-authentication-file.json'
        customer_id: 'YOUR_CUSTOMER_ID'
        endpoint: chronicle.googleapis.com
        log_type: 'SURICATA_EVE'
        raw_log_field: body
        ingestion_labels:
    
    service:
      pipelines:
        logs/source0__chronicle_w_labels-0:
          receivers:
            - udplog
          exporters:
            - chronicle/chronicle_w_labels
    

設定參數

  • 請替換下列預留位置:

    • 接收器設定:

      • udplog:如果是 UDP syslog,請使用 udplog;如果是 TCP syslog,請使用 tcplog
      • 0.0.0.0:要接聽的 IP 位址 (0.0.0.0 可接聽所有介面)
      • 514:要監聽的通訊埠編號 (標準 syslog 通訊埠)
    • 匯出工具設定:

      • creds_file_path:服務帳戶 JSON 金鑰檔案的完整路徑 (選項 1):
        • Linux:/opt/observiq-otel-collector/ingestion-auth.json
        • Windows:C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
      • YOUR_CUSTOMER_ID:「取得客戶 ID」部分的客戶 ID
      • location:將 <LOCATION> 替換為 Google SecOps 執行個體的區域 (例如 us、europe 或 asia-southeast1)。匯出工具會在這個值前面加上 chronicle.googleapis.com。如需完整清單,請參閱「區域性端點」。
      • project:依序前往「IAM 與管理」>「設定」,然後將 <PROJECT_NUMBER> 替換為專案編號。
      • endpoint:維持設為 chronicle.googleapis.com。
      • log_type:記錄類型,與 Chronicle 中顯示的完全相同 (SURICATA_EVE)

舊版 Ingestion API 匯出工具

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

    exporters:
      chronicle/chronicle_w_labels:
        compression: gzip
        creds_file_path: '/path/to/ingestion-authentication-file.json'
        customer_id: 'YOUR_CUSTOMER_ID'
        endpoint: malachiteingestion-pa.googleapis.com
        log_type: 'SURICATA_EVE'
        raw_log_field: body
        ingestion_labels:
    

儲存設定檔

  • 編輯完畢後,請儲存檔案:
    • Linux:依序按下 Ctrl+O、Enter 和 Ctrl+X
    • Windows:依序點選「檔案」>「儲存」

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

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

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

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

        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"
        

設定 Suricata EVE syslog 轉送

  1. 開啟 Suricata 設定檔 (通常是 /etc/suricata/suricata.yaml)。
  2. 找出 outputs 區段,並設定 Syslog 的 EVE 記錄輸出:

    outputs:
      - eve-log:
          enabled: yes
          filetype: syslog
          identity: "suricata"
          facility: local5
          level: Info
          types:
            - alert:
                payload: yes
                payload-printable: yes
                packet: yes
                metadata: yes
            - http:
                extended: yes
            - dns:
                query: yes
                answer: yes
            - tls:
                extended: yes
            - files:
                force-magic: no
            - flow
            - netflow
            - anomaly:
                enabled: yes
            - stats:
                enabled: yes
    
  3. 如果系統記錄檔精靈未設定轉送至 Bindplane,請設定 rsyslog 或 syslog-ng:

    • 適用於 rsyslog (編輯 /etc/rsyslog.conf 或建立 /etc/rsyslog.d/suricata.conf):

      local5.* @BINDPLANE_IP:514
      
      • 將 BINDPLANE_IP 替換為 Bindplane 代理程式主機的 IP 位址。
      • 如果是 UDP,請使用 @;如果是 TCP,請使用 @@。
    • syslog-ng (編輯 /etc/syslog-ng/syslog-ng.conf):

      destination d_bindplane { udp("BINDPLANE_IP" port(514)); };
      filter f_suricata { facility(local5); };
      log { source(s_src); filter(f_suricata); destination(d_bindplane); };
      
  4. 重新啟動 syslog daemon:

    sudo systemctl restart rsyslog
    
  5. 重新啟動 Suricata:

     sudo systemctl restart suricata
    
  6. 檢查 Bindplane 代理程式記錄,確認系統記錄訊息是否已傳送。

UDM 對應表

記錄欄位 UDM 對應 邏輯
時間戳記 metadata.event_timestamp 事件時間戳記
event_type metadata.product_event_type EVE 事件類型 (例如 alert、flow、dns、http、tls)
src_ip principal.ip 來源 IP 位址
src_port principal.port 來源通訊埠號碼
dest_ip target.ip 目的地 IP 位址
dest_port target.port 目的地通訊埠編號
proto network.ip_protocol 網路通訊協定 (例如 TCP、UDP、ICMP)
flow_id network.session_id 流程的專屬 ID
alert.signature security_result.rule_name 警告簽章名稱
alert.signature_id security_result.rule_id 快訊簽章 ID
alert.severity security_result.severity 警告嚴重性等級
alert.category security_result.category_details 快訊分類類別
alert.action security_result.action 採取的動作 (例如允許、封鎖)
alert.rev security_result.rule_version 規則修訂版本號碼
http.hostname target.hostname HTTP 要求主機名稱
http.url target.url HTTP 要求網址
http.http_method network.http.method HTTP 要求方法
http.status network.http.response_code HTTP 回應狀態碼
http.http_user_agent network.http.user_agent HTTP 使用者代理程式字串
http.http_refer network.http.referral_url HTTP 參照網址
http.length additional.fields HTTP 內容長度
dns.type network.dns.type DNS 查詢或回應
dns.rrname network.dns.questions.name DNS 查詢名稱
dns.rrtype network.dns.questions.type DNS 查詢類型
dns.rdata network.dns.answers.data DNS 回應資料
tls.subject network.tls.client.subject TLS 憑證主體
tls.issuerdn network.tls.client.issuer 傳輸層安全標準 (TLS) 憑證核發機構
tls.sni network.tls.client.server_name TLS 伺服器名稱指示
tls.version network.tls.version TLS 版本
tls.ja3.hash network.tls.client.ja3 JA3 用戶端指紋雜湊
tls.ja3s.hash network.tls.server.ja3s JA3S 伺服器指紋雜湊
app_proto network.application_protocol 偵測到應用程式層通訊協定
flow.bytes_toserver network.sent_bytes 從用戶端傳送至伺服器的位元組
flow.bytes_toclient network.received_bytes 從伺服器傳送至用戶端的位元組
flow.pkts_toserver additional.fields 從用戶端傳送至伺服器的封包
flow.pkts_toclient additional.fields 從伺服器傳送至用戶端的封包
in_iface additional.fields 輸入網路介面
community_id network.community_id 網路社群 ID 流量雜湊
flow.src_ip event.idm.read_only_udm.principal.ip/event.idm.read_only_udm.principal.asset.ip 從變更記錄對應
alert.source.ip event.idm.read_only_udm.principal.ip/event.idm.read_only_udm.principal.asset.ip 從變更記錄對應
flow.dest_ip event.idm.read_only_udm.target.ip/event.idm.read_only_udm.target.asset.ip 從變更記錄對應
alert.target.ip event.idm.read_only_udm.target.ip/event.idm.read_only_udm.target.asset.ip 從變更記錄對應
flow.pkts_toserver event.idm.read_only_udm.additional.fields 從變更記錄對應
flow.pkts_toclient event.idm.read_only_udm.additional.fields 從變更記錄對應
alert.source.port event.idm.read_only_udm.additional.fields 從變更記錄對應
alert.target.port event.idm.read_only_udm.additional.fields 從變更記錄對應
alert.rule event.idm.read_only_udm.additional.fields 從變更記錄對應
alert.metadata.attack_target event.idm.read_only_udm.security_result.detection_fields 從變更記錄對應
alert.metadata.confidence event.idm.read_only_udm.security_result.detection_fields 從變更記錄對應
alert.metadata.deployment event.idm.read_only_udm.security_result.detection_fields 從變更記錄對應
alert.metadata.tag event.idm.read_only_udm.security_result.detection_fields 從變更記錄對應
dhcp.client_ip event.idm.read_only_udm.network.dhcp.ciaddr 從變更記錄對應
dhcp.client_id event.idm.read_only_udm.network.dhcp.client_identifier 從變更記錄對應
dhcp.params event.idm.read_only_udm.additional.fields 從變更記錄對應
dhcp.hostname event.idm.read_only_udm.network.dhcp.client_hostname 從變更記錄對應
dhcp.vendor_class_identifier event.idm.read_only_udm.network.dhcp.options 從變更記錄對應
dhcp.type event.idm.read_only_udm.network.dhcp.opcode 從變更記錄對應
dhcp.dhcp_type event.idm.read_only_udm.network.dhcp.type 從變更記錄對應
dhcp.assigned_ip event.idm.read_only_udm.network.dhcp.yiaddr 從變更記錄對應
dhcp.client_mac event.idm.read_only_udm.network.dhcp.chaddr 從變更記錄對應
dns.qr event.idm.read_only_udm.additional.fields 從變更記錄對應
dns_qr event.idm.read_only_udm.additional.fields 從變更記錄對應
tls.ja3.string event.idm.read_only_udm.additional.fields 從變更記錄對應
tls_ja3_string event.idm.read_only_udm.additional.fields 從變更記錄對應
tls.ja3s.string event.idm.read_only_udm.additional.fields 從變更記錄對應
tls_ja3s_string event.idm.read_only_udm.additional.fields 從變更記錄對應
tls.ja4 event.idm.read_only_udm.additional.fields 從變更記錄對應
tls_ja4 event.idm.read_only_udm.additional.fields 從變更記錄對應
dns.version event.idm.read_only_udm.additional.fields 從變更記錄對應
dns_version event.idm.read_only_udm.additional.fields 從變更記錄對應
dns.type event.idm.read_only_udm.additional.fields 從變更記錄對應
dns_type event.idm.read_only_udm.additional.fields 從變更記錄對應
dns.opcode event.idm.read_only_udm.additional.fields 從變更記錄對應
dns_opcode event.idm.read_only_udm.additional.fields 從變更記錄對應
dns.tx_id event.idm.read_only_udm.additional.fields 從變更記錄對應
dns_tx_id event.idm.read_only_udm.additional.fields 從變更記錄對應
dns.flags event.idm.read_only_udm.additional.fields 從變更記錄對應
dns_flags event.idm.read_only_udm.additional.fields 從變更記錄對應
audata.soa.mname event.idm.read_only_udm.additional.fields 從變更記錄對應
soa_mname_%{index} event.idm.read_only_udm.additional.fields 從變更記錄對應
audata.soa.rname event.idm.read_only_udm.additional.fields 從變更記錄對應
soa_rname_%{index} event.idm.read_only_udm.additional.fields 從變更記錄對應
audata.soa.serial event.idm.read_only_udm.additional.fields 從變更記錄對應
soa_serial_%{index} event.idm.read_only_udm.additional.fields 從變更記錄對應
audata.soa.refresh event.idm.read_only_udm.additional.fields 從變更記錄對應
soa_refresh_%{index} event.idm.read_only_udm.additional.fields 從變更記錄對應
audata.soa.retry event.idm.read_only_udm.additional.fields 從變更記錄對應
soa_retry_%{index} event.idm.read_only_udm.additional.fields 從變更記錄對應
audata.soa.expire event.idm.read_only_udm.additional.fields 從變更記錄對應
soa_expire_%{index} event.idm.read_only_udm.additional.fields 從變更記錄對應
audata.soa.minimum event.idm.read_only_udm.additional.fields 從變更記錄對應
soa_minimum_%{index} event.idm.read_only_udm.additional.fields 從變更記錄對應
dns.rd event.idm.read_only_udm.network.dns.recursion_desired 從變更記錄對應
dns.ra event.idm.read_only_udm.network.dns.recursion_available 從變更記錄對應
dns.answers event.idm.read_only_udm.network.dns.answers 從變更記錄對應
dns.authorities event.idm.read_only_udm.network.dns.answers 從變更記錄對應
event_type event.idm.read_only_udm.network.application_protocol 從變更記錄對應
dns.answers.ttl event.idm.read_only_udm.network.dns.answers.ttl 從變更記錄對應
dns.authorities.ttl event.idm.read_only_udm.network.dns.answers.ttl 從變更記錄對應
dns.authorities.rrtype event.idm.read_only_udm.network.dns.answers.type 從變更記錄對應
dns.answers.rrtype event.idm.read_only_udm.network.dns.answers.type 從變更記錄對應
dns.authorities.rrname event.idm.read_only_udm.network.dns.answers.name 從變更記錄對應
dns.answers.rrname event.idm.read_only_udm.network.dns.answers.name 從變更記錄對應
dns.answers.rdata event.idm.read_only_udm.network.dns.answers.data 從變更記錄對應
dns.rcode event.idm.read_only_udm.network.dns.response_code 從變更記錄對應
ssh.server.hassh.software_version", "ssh.server.hassh.proto_version", "ssh.server.hassh.string", "ssh.client.hassh.software_version", "ssh.client.hassh.proto_version", "ssh.client.hassh.string additional.fields 從變更記錄對應
alert.metadata.stamus_classification additional.fields 從變更記錄對應
alert.metadata.sightings_key additional.fields 從變更記錄對應
alert.metadata.sightings_asset additional.fields 從變更記錄對應
discovery additional.fields 從變更記錄對應
dns.id network.dns.id 從變更記錄對應
see_id network.session_id 從變更記錄對應
payload_printable additional.fields 從變更記錄對應
process.executable principal.process.file.full_path 從變更記錄對應
process.pid principal.process.pid 從變更記錄對應
process.command_line principal.process.command_line 從變更記錄對應
service.type additional.fields 從變更記錄對應
event.dataset about.labels 從變更記錄對應
event.module about.labels 從變更記錄對應
event.duration about.labels 從變更記錄對應
agent.id metadata.product_log_id 從變更記錄對應
agent.type metadata.product_event_type 從變更記錄對應
agent.version metadata.product_version 從變更記錄對應
agent.hostname principal.hostname 從變更記錄對應
agent.name principal.hostname 從變更記錄對應
agent.ephemeral_id additional.fields 從變更記錄對應
ecs.version principal.asset.attribute.labels 從變更記錄對應
process.args about.file.capabilities_tags 從變更記錄對應

變更記錄

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

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