收集 Juniper SRX 系列防火牆記錄

支援的國家/地區:

本文說明如何使用 Bindplane,將 Juniper SRX 系列防火牆記錄擷取至 Google Security Operations。

Juniper SRX 系列防火牆是高效能的網路安全裝置,提供新一代防火牆 (NGFW) 功能,包括有狀態檢查、入侵偵測與防禦 (IDP)、應用程式安全性和 VPN。SRX 防火牆會針對流量、安全性、系統和工作階段事件產生系統記錄訊息,並轉送至外部 SIEM 平台,以進行集中式安全監控。

事前準備

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

  • Google SecOps 執行個體。
  • Windows Server 2016 以上版本,或搭載 systemd 的 Linux 主機。
  • Bindplane 代理程式與 Juniper SRX 防火牆之間的網路連線。
  • 如果透過 Proxy 執行,請確保防火牆通訊埠已根據 Bindplane 代理程式需求開啟。
  • Juniper SRX 防火牆的特殊權限 (透過 J-Web 或 CLI 的根層級或超級使用者層級存取權)。

取得 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](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](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 /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/juniper_firewall:
        compression: gzip
        creds_file_path: '/etc/bindplane-agent/ingestion-auth.json'
        customer_id: 'your-customer-id-here'
        endpoint: malachiteingestion-pa.googleapis.com
        log_type: JUNIPER_FIREWALL
        raw_log_field: body
        ingestion_labels:
        env: production
    
    service:
    pipelines:
        logs/juniper_to_chronicle:
        receivers:
            - udplog
        exporters:
            - chronicle/juniper_firewall
    

設定參數

替換下列預留位置:

  • 接收器設定:

    • 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
      • 如需完整清單,請參閱「區域端點」。
    • ingestion_labels:YAML 格式的選用標籤 (例如 env: production)。

儲存設定檔

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

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

如要在 Linux 中重新啟動 Bindplane 代理程式,請按照下列步驟操作:

  1. 執行下列指令:

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

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

    sudo journalctl -u observiq-otel-collector -f
    

如要在 Windows 中重新啟動 Bindplane 代理程式,請按照下列步驟操作:

  1. 您可以選擇下列其中一個選項:

    • 以管理員身分開啟命令提示字元或 PowerShell:
    net stop observiq-otel-collector && net start observiq-otel-collector
    
    • 服務控制台:
      1. 按下 Win+R,輸入 services.msc,然後按下 Enter 鍵。
      2. 找出 observIQ OpenTelemetry Collector
      3. 按一下滑鼠右鍵,然後選取「重新啟動」
  2. 確認服務正在執行:

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

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

設定 Juniper SRX Syslog 轉送

設定 Juniper SRX 防火牆,將系統記錄訊息轉寄至 Bindplane 代理程式。

使用 J-Web 介面

  1. 登入 Juniper SRX J-Web 介面。
  2. 依序前往「Configure」>「System Properties」>「Syslog」
  3. 按一下「主機」部分下方的「新增」,即可新增 Syslog 伺服器。
  4. 請提供下列設定詳細資料:
    • 主機名稱:輸入 Bindplane 代理程式主機的 IP 位址 (例如 192.168.1.100)。
    • 通訊埠:輸入 514 (或在 Bindplane 代理程式中設定的通訊埠)。
    • 記錄前置字串:記錄訊息的選用前置字串。
    • 設施:選取要轉送的設施和嚴重程度:
      • any:選取「info」以上的嚴重性等級。
  5. 在「來源位址」欄位中,輸入 SRX 管理介面 IP (選填,但建議填寫,以確保來源識別資訊一致)。
  6. 按一下「確定」即可儲存。
  7. 按一下「Commit」(提交) 套用設定。

使用 Junos CLI

  1. 透過 SSH 或控制台連線至 Juniper SRX。
  2. 進入設定模式:

    configure
    
  3. 設定系統記錄主機:

    set system syslog host BINDPLANE_IP any info
    set system syslog host BINDPLANE_IP port 514
    set system syslog host BINDPLANE_IP source-address SRX_MGMT_IP
    set system syslog host BINDPLANE_IP structured-data
    

    更改項目:

    • BINDPLANE_IP:Bindplane 代理程式主機的 IP 位址。
    • SRX_MGMT_IP:SRX 防火牆的管理 IP 位址。
  4. 設定安全記錄串流 (適用於流量和工作階段記錄):

    set security log mode stream
    set security log source-address SRX_MGMT_IP
    set security log stream chronicle-stream host BINDPLANE_IP
    set security log stream chronicle-stream port 514
    set security log stream chronicle-stream transport protocol udp
    set security log stream chronicle-stream format sd-syslog
    set security log stream chronicle-stream severity info
    set security log stream chronicle-stream category all
    

    更改項目:

    • BINDPLANE_IP:Bindplane 代理程式主機的 IP 位址。
    • SRX_MGMT_IP:SRX 防火牆的管理 IP 位址。
  5. 提交設定:

    commit
    
  6. 驗證系統記錄設定:

    show system syslog
    show security log
    

設定特定記錄類別

  • 如要轉送特定記錄類型,請設定個別設施:

    set system syslog host BINDPLANE_IP firewall any
    set system syslog host BINDPLANE_IP authorization info
    set system syslog host BINDPLANE_IP daemon info
    set system syslog host BINDPLANE_IP kernel info
    set system syslog host BINDPLANE_IP interactive-commands info
    

BINDPLANE_IP 替換為 Bindplane 代理程式主機的 IP 位址。

驗證系統記錄檔轉送功能

  1. 在 SRX 上執行下列指令,查看有效的系統記錄目的地:

    show system syslog
    
  2. 透過防火牆產生測試流量,並確認記錄顯示在 Bindplane 代理程式記錄中。

詳情請參閱 Juniper SRX 系列說明文件

UDM 對應表

記錄欄位 UDM 對應 邏輯
source-address event.idm.read_only_udm.principal.ip 取自 source-address 的值。
source-port event.idm.read_only_udm.principal.port source-port 取得值並轉換為整數。
destination-address event.idm.read_only_udm.target.ip 取自 destination-address 的值。
destination-port event.idm.read_only_udm.target.port destination-port 取得值並轉換為整數。
protocol-id event.idm.read_only_udm.network.ip_protocol 從通訊協定號碼對應至名稱 (6=TCP、17=UDP、1=ICMP)。
policy-name event.idm.read_only_udm.security_result.rule_name 取自 policy-name 的值。
source-zone-name event.idm.read_only_udm.additional.fields source-zone-name 取得的值,並以鍵 source-zone-name 新增。
destination-zone-name event.idm.read_only_udm.additional.fields destination-zone-name 取得的值,並以鍵 destination-zone-name 新增。
service-name event.idm.read_only_udm.target.application 取自 service-name 的值。
application event.idm.read_only_udm.target.application application 取得的值 (如果沒有 service-name)。
nat-source-address event.idm.read_only_udm.principal.nat_ip 取自 nat-source-address 的值。
nat-source-port event.idm.read_only_udm.principal.nat_port nat-source-port 取得值並轉換為整數。
nat-destination-address event.idm.read_only_udm.target.nat_ip 取自 nat-destination-address 的值。
nat-destination-port event.idm.read_only_udm.target.nat_port nat-destination-port 取得值並轉換為整數。
bytes-from-client event.idm.read_only_udm.network.sent_bytes bytes-from-client 取得的值,並轉換為無正負號整數。
bytes-from-server event.idm.read_only_udm.network.received_bytes bytes-from-server 取得的值,並轉換為無正負號整數。
packets-from-client event.idm.read_only_udm.additional.fields packets-from-client 取得的值,並以鍵 packets-from-client 新增。
packets-from-server event.idm.read_only_udm.additional.fields packets-from-server 取得的值,並以鍵 packets-from-server 新增。
elapsed-time event.idm.read_only_udm.additional.fields elapsed-time 取得的值,並以鍵 elapsed-time 新增。
username event.idm.read_only_udm.principal.user.userid 取自 username 的值。
reason event.idm.read_only_udm.security_result.description 取自 reason 的值。
action event.idm.read_only_udm.security_result.action 如果 actionacceptpermit,請設為 ALLOW。如果 actiondenydroprejectclose,請設為 BLOCK
hostname event.idm.read_only_udm.principal.hostname 取自系統記錄主機名稱欄位的值。
attack-name event.idm.read_only_udm.security_result.threat_name 取自 attack-name 的值 (IDP 事件)。
severity event.idm.read_only_udm.security_result.severity 從嚴重性字串對應:info 對應至 INFORMATIONALwarning 對應至 MEDIUMerrormajor 對應至 ERRORcritical 對應至 CRITICAL
event.idm.read_only_udm.metadata.vendor_name 設為 Juniper Networks
event.idm.read_only_udm.metadata.product_name 設為 SRX Series Firewall

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