收集 Sophos Intercept EDR 記錄

支援的國家/地區:

本文說明如何使用 Bindplane 收集 Sophos Intercept EDR 記錄。剖析器會從 Sophos EDR JSON 記錄檔中擷取欄位,並轉換為統合式資料模型 (UDM)。這個外掛程式會剖析 message 欄位、將 Sophos 欄位對應至 UDM 欄位 (例如 suser 對應至 principal.user.userid)、根據欄位是否存在執行條件式合併,並根據 type 欄位分類事件,設定適當的 UDM 事件類型和安全性結果動作。

事前準備

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

  • Google SecOps 執行個體
  • Windows 2016 以上版本,或搭載 systemd 的 Linux 主機
  • 另一部 Windows 或 Linux 電腦,能夠持續執行 Python
  • 如果透過 Proxy 執行,請確保防火牆通訊埠已根據 Bindplane 代理程式需求開啟
  • Sophos Central 管理控制台的特殊權限

取得 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:
      udplog:
        # Replace the port and IP address as required
        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: '/path/to/ingestion-authentication-file.json'
        # Replace with your actual customer ID from Step 2
        customer_id: <customer_id>
        endpoint: malachiteingestion-pa.googleapis.com
        # Add optional ingestion labels for better organization
        log_type: 'SOPHOS_EDR'
        raw_log_field: body
        ingestion_labels:
    
    service:
      pipelines:
        logs/source0__chronicle_w_labels-0:
          receivers:
            - udplog
          exporters:
            - chronicle/chronicle_w_labels
    
    • 視基礎架構需求替換通訊埠和 IP 位址。
    • <customer_id> 替換為實際的客戶 ID。
    • /path/to/ingestion-authentication-file.json 更新為「取得 Google SecOps 擷取驗證檔案」部分中驗證檔案的儲存路徑。

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

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

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

    net stop BindPlaneAgent && net start BindPlaneAgent
    

設定 Sophos Central API 存取權

  1. 登入 Sophos Central Admin
  2. 依序選取「通用設定」>「API 權杖管理」
  3. 按一下「新增權杖」即可建立新權杖。
  4. 輸入權杖名稱並點選「儲存」;(系統會顯示所提供權杖的「API 權杖摘要」)。
  5. 在「API 權杖摘要」部分中,按一下「複製」,複製 API 存取網址和標頭。

在其他機器上安裝 Python

  1. 開啟網路瀏覽器,然後前往 Python 網站
  2. 按一下適用於您作業系統的「下載 Python」
  3. 安裝 Python:

    • Windows:
      1. 執行安裝程式。
      2. 勾選「Add Python to PATH」方塊。
      3. 按一下「立即安裝」
    • 使用 Mac 電腦:

      1. Python 可能已安裝完畢,如果沒有,您可以使用終端機安裝最新版本。
      2. 開啟「終端機」並輸入下列指令:

        python --version
        

下載 Sophos 整合指令碼

  1. 前往 Sophos Central SIEM Integration GitHub 存放區的 GitHub 頁面。
  2. 按一下綠色的「Code」按鈕 >「Download ZIP」
  3. 解壓縮 ZIP 檔案。

設定指令碼

  1. 在解壓縮 ZIP 封存檔的目錄中,開啟 config.ini 檔案。
  2. 編輯設定檔:
    • API 權杖:輸入先前從 Sophos Central 複製的 API 金鑰。
    • 系統記錄檔伺服器詳細資料:輸入系統記錄檔伺服器的詳細資料。
    • 主機:輸入 BindPlane 代理程式 IP 位址。
    • 「Port」(通訊埠):輸入 BindPlane 代理程式通訊埠編號。
    • 通訊協定:輸入 UDP (您也可以視設定使用 TCPTLS)。
  3. 儲存檔案。

執行指令碼

  1. 前往指令碼資料夾。

    • 使用 Windows 電腦:

      1. 按下 Windows 鍵,然後輸入 cmd
      2. 按一下「命令提示字元」
      3. 前往指令碼資料夾:
      cd C:/Users/YourName/Downloads/Sophos-Central-SIEM-Integration
      
    • 在 macOS 上執行下列操作:

      1. 依序前往「應用程式」>「工具程式」
      2. 開啟 [Terminal]
      3. 前往指令碼資料夾:
      cd /Users/YourName/Downloads/Sophos-Central-SIEM-Integration
      
  2. 執行指令碼:

    • 輸入下列指令來啟動指令碼:

      python siem.py
      

在 Windows 上自動執行指令碼 (使用工作排程器):

  1. 在「開始」選單中輸入「工作排程器」,開啟工作排程器。
  2. 按一下「建立工作」
  3. 在「一般」分頁中:
    • 為工作命名 (例如 Sophos AV Log Export)。
  4. 在「觸發條件」分頁中:
    • 按一下「新增」,然後視需要將工作設為「每日」或「啟動時」執行。
  5. 在「動作」分頁中:
    • 按一下「新增」,然後選取「開始計畫」
    • 瀏覽 python.exe 可執行檔 (通常位於 C:/Python/XX/python.exe)。
    • 在「Add arguments」(新增引數) 欄位中,輸入指令碼的路徑 (例如 C:/Users/YourName/Downloads/Sophos-Central-SIEM-Integrationsiem.py)。
  6. 按一下「確定」儲存工作。

自動執行指令碼,在 Mac 上持續運作 (使用 Cron Jobs):

  1. 開啟終端機。
  2. 輸入 crontab -e,然後按下 Enter 鍵。
  3. 在檔案結尾處加上新的一行:

    * * * * * /usr/bin/python /Users/YourName/Downloads/Sophos-Central-SIEM-Integration/siem.py
    
  4. 按一下「儲存」並結束編輯器。

UDM 對應表

記錄欄位 UDM 對應 邏輯
appSha256 principal.process.file.sha256 原始記錄中的 appSha256 值會指派給這個 UDM 欄位。
core_remedy_items.items[].descriptor principal.process.file.names 原始記錄中 core_remedy_itemsitems 陣列內每個 descriptor 的值,都會以個別的 names 項目新增至 UDM。
customer_id target.resource.id 原始記錄中的 customer_id 值會指派給這個 UDM 欄位。
detection_identity_name security_result.threat_feed_name 原始記錄中的 detection_identity_name 值會指派給這個 UDM 欄位。
dhost target.hostname 原始記錄中的 dhost 值會指派給這個 UDM 欄位。
endpoint_id target.resource.attribute.labels[].value 原始記錄中的 endpoint_id 值會指派為 target.resource.attribute.labels 中標籤的值。這個標籤的鍵是「endpoint_id」。
endpoint_type target.resource.attribute.labels[].value 原始記錄中的 endpoint_type 值會指派為 target.resource.attribute.labels 中標籤的值。這個標籤的鍵是「endpoint_type」。
filePath target.file.full_path 原始記錄中的 filePath 值會指派給這個 UDM 欄位。
group principal.group.group_display_name 原始記錄中的 group 值會指派給這個 UDM 欄位。
id target.process.pid 原始記錄中的 id 值會指派給這個 UDM 欄位。
name metadata.description 原始記錄中的 name 值會指派給這個 UDM 欄位。這個值是透過剖析器中的條件邏輯,從原始記錄的 type 欄位衍生而來。預設值為 NETWORK_UNCATEGORIZED。特定 type 值會對應至不同的 UDM 事件類型 (例如 「UpdateSuccess」對應至 STATUS_UPDATE,「ServiceNotRunning」對應至 SERVICE_STOP 等。硬式編碼為「SOPHOS_EDR」。原始記錄中的 type 值會指派給這個 UDM 欄位。硬式編碼為「Sophos EDR」。已硬式編碼為「SOPHOS」。
rt metadata.event_timestamptimestamp 系統會剖析原始記錄中的 rt 值 (代表事件時間),並用來填入 UDM 中的 metadata.event_timestamp 和頂層 timestamp 欄位。
security_result.severity security_result.severity 原始記錄中的 severity 值會轉換為大寫,並指派給這個 UDM 欄位。
source_info.ip principal.ip 原始記錄中 source_info 內的 ip 值會指派給這個 UDM 欄位。
suser principal.user.userid 原始記錄中的 suser 值會指派給這個 UDM 欄位。
threat security_result.threat_name 原始記錄中的 threat 值會指派給這個 UDM 欄位。
security_result.action 這個值是從原始記錄中的 type 欄位衍生而來。如果 type 包含「Blocked」或「Warn」(不區分大小寫),則值會設為「BLOCK」。如果 type 包含「Allow」(不區分大小寫),值會設為「ALLOW」。如果原始記錄中的 type 欄位為「ScheduledDataUploadResumed」或「ScheduledDailyLimitExceeded」,則值會設為「TASK」。

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