收集 Palo Alto Cortex XDR 事件記錄
本文將說明如何使用 Google Cloud Storage 將 Palo Alto Cortex XDR 事件記錄匯入 Google 安全作業。剖析器會從 Palo Alto Networks Cortex XDR JSON 記錄中擷取安全性事件資料。這項服務會根據與 event_type
和 event_sub_type
欄位相關聯的條件邏輯,將欄位對應、轉換資料類型,並在事件中加入供應商、產品和事件類型等中繼資料,將資料正規化為統一資料模型 (UDM)。並處理網路連線、檔案和登錄作業、處理序資訊和使用者活動。
事前準備
請確認您已具備下列必要條件:
- Google SecOps 執行個體
- Google Cloud 儲存空間已在您的 Google Cloud 環境中設定並啟用
- Google Cloud 的特殊存取權和適當權限
- 可存取 Palo Alto Cortex XDR 的特殊權限
建立 Google Cloud Storage 值區
- 登入 Google Cloud 控制台。
前往「Cloud Storage Buckets」(Cloud Storage 值區) 頁面。
按一下 [建立]。
在「Create a bucket」(建立值區) 頁面中輸入值區資訊。完成下列每個步驟後,請按一下「繼續」繼續下一步:
在「開始使用」專區中,請執行下列操作: * 輸入符合值區名稱規定的不重複名稱 (例如 cortex-xdr-events-googlesecops)。 * 如要啟用階層命名空間,請按一下展開箭頭,展開「為檔案導向和資料密集型工作負載進行最佳化」部分,然後選取「為這個值區啟用階層命名空間」。
Note: You can't enable hierarchical namespace in an existing bucket. * To add a bucket label, click the expander arrow to expand the **Labels** section. * Click **Add label** and specify a key and a value for your label.
在「Choose where to store your data」(選擇資料的儲存位置) 專區中執行下列操作: * 選取「位置類型」。 * 使用位置類型的選單,選取要永久儲存值區內物件資料的位置。
Note: If you select the **dual-region** location type, you can also choose to enable **turbo replication** by selecting the relevant checkbox. * To set up cross-bucket replication, expand the **Set up cross-bucket replication** section.
在「Choose a storage class for your data」專區中,為值區選取預設儲存空間級別,或選取「Autoclass」,讓系統自動管理值區的資料儲存空間級別。
在「選取如何控制物件的存取權」專區中,選取「否」來強制執行公開存取防護,然後為值區物件選取存取權控管模型。
在「Choose how to protect object data」(選擇保護物件資料的方式) 專區中,請執行下列操作: * 選取要為儲存桶設定的「Data protection」(資料保護) 下方的任一選項。* 如要選擇物件資料的加密方式,請按一下「資料加密」展開箭頭,然後選取「資料加密方法」。
按一下 [建立]。
設定 Cortex XDR 事件轉送
- 登入 Cortex XDR 網頁式使用者介面。
- 依序前往「設定」>「設定」>「資料管理」>「事件轉送」。
- 在「啟用」部分中啟用授權。
- 啟用 GB 事件轉送功能,將 Cortex XDR Pro 每 GB 的剖析記錄匯出至外部 SIEM 進行儲存。
- 啟用「Endpoints Event Forwarding」,為 Cortex XDR Pro EP 和 Cloud Endpoints 匯出原始端點資料。
- 儲存所選項目。
- 複製顯示的儲存路徑。
- 產生並下載服務帳戶 JSON Web Token,其中包含存取金鑰。
- 儲存至安全的位置。
設定 Google Cloud Secret Manager
- 登入 GCP。
- 前往「Secret Manager」頁面。
- 如果這是您第一次啟用,系統會提示您啟用 Secret Manager API。
- 建立名為 EVENT_FRWD_CRTX_KEY 的密鑰,然後將下載的 JSON 檔案 xdr_sa_key.json 內容複製為密鑰的值。
在 Google SecOps 中設定動態饋給,以便擷取 Palo Alto Cortex XDR 事件記錄
- 依序前往「SIEM 設定」>「動態」。
- 按一下「新增」。
- 在「動態饋給名稱」欄位中,輸入動態饋給的名稱 (例如 PANW Cortex XDR 事件記錄)。
- 選取「Google Cloud Storage」做為「來源類型」。
- 選取「Palo Alto Cortex XDR 事件」做為「記錄類型」。
- 按一下「取得服務帳戶」,並將其設為「Chronicle 服務帳戶」。
- 點選「下一步」。
指定下列輸入參數的值:
- Storage Bucket URI: Google Cloud storage bucket 網址 (例如
gs://cortex-xdr-events-chronicle
)。 - URI 是:選取「Directory which includes subdirectories」。
- 來源刪除選項:根據偏好選取刪除選項。
- 資產命名空間:資產命名空間。
- 攝入標籤:套用至這個動態饋給事件的標籤。
- Storage Bucket URI: Google Cloud storage bucket 網址 (例如
點選「下一步」。
在「完成」畫面中查看新的動態饋給設定,然後按一下「提交」。
建立動態饋給後,請在「動態饋給」清單中找到該動態饋給,然後按一下該行右側的三點圖示。
選取「停用動態饋給」。
設定 Cloud Storage 的 JSON 密鑰存取權
- 登入 GCP。
- 前往「Secret Manager」頁面。
- 選取 EVENT_FRWD_CRTX_KEY 這個密鑰。
- 前往「權限」分頁。
- 為Storage 物件管理員和 Storage 舊版值區讀取者提供先前建立的 cortex-xdr-events-chronicle 值區存取權。
為 Cloud Storage 設定 Google SecOps 權限
- 依序前往「IAM 與管理」>「身分與存取權管理」。
- 找出 Chronicle 服務帳戶。
- 將先前建立的 cortex-xdr-events-chronicle 值區的存取權授予 Storage 物件檢視者 (roles/storage.objectViewer)。
設定 PANW Cortex XDR 事件記錄擷取作業,將記錄匯入 Project Cloud Storage
- 在 Google Cloud中,依序前往「API 和服務」>「程式庫」。
- 啟用 Cloud Run 和 Artifact Registry API。
- 按一下頂端導覽列中的圖示,即可開啟 Cloud Shell。
使用下列指令下載自訂程式碼:
git clone https://github.com/PaloAltoNetworks/google-cloud-cortex-chronicle.git
執行下列指令前往目錄:
cd google-cloud-cortex-chronicle/
使用
vi
等編輯器開啟檔案env.properties
。請提供下列設定詳細資料:
REGION=us-central1 # Update according to your project region REPO_NAME=panw-chronicle IMAGE_NAME=sync_cortex_bucket GCP_PROJECT_ID=chrxxxxxxxxx # Update according to your project ID JOB_NAME=cloud-run-job-cortex-data-sync # The Cloud Job name ROJECT_NUMBER=80xxxxx9 # Update according to your project number # JOB ENV VARIABLES SRC_BUCKET=xdr-us-xxxxx-event-forwarding # Update with the Cortex XDR GCS bucket name DEST_BUCKET=cortex-xdr-events-chronicle # Update with the GCS name of the bucket you created SECRET_NAME=EVENT_FRWD_CRTX_KEY # Need to match the secret you created JOB_SCHEDULE_MINS=30
為
deploy.sh
指令碼提供必要權限:chmod 744 deploy.sh
執行
deploy.sh
指令碼:./deploy.sh
從指令碼輸出內容中找出使用的 Cloud Job 服務帳戶。
將 Secret Manager 密鑰祖系權限授予 Cloud Job 服務帳戶,以便存取先前建立的密鑰 (如本例中的 EVENT_FRWD_CRTX_KEY)。
依序前往「Secret Manager」>「EVENT_FRWD_CRTX_KEY」(密鑰) >「Permissions」(權限)。
在 Google SecOps 平台中,依序前往「SIEM 設定」>「動態饋給」>「XDR 事件動態饋給名稱」>「啟用動態饋給」。
UDM 對應表
記錄欄位 | UDM 對應 | 邏輯 |
---|---|---|
action_file_path |
target.file.full_path |
直接對應 |
action_file_size |
target.file.size |
直接對應並轉換為無符號整數 |
action_local_ip |
principal.ip |
直接對應並合併其他 IP 位址 |
action_local_port |
principal.port |
直接對應並轉換為整數 |
action_module_path |
target.process.file.full_path |
直接對應 |
action_network_connection_id |
network.session_id |
直接對應 |
action_network_protocol |
network.ip_protocol |
已重新命名為 protocol_number_src ,並使用 parse_ip_protocol.include 剖析,再對應至 network.ip_protocol |
action_process_image_command_line |
target.process.command_line |
直接對應 |
action_process_image_md5 |
target.process.file.md5 |
直接對應 |
action_process_image_path |
target.process.file.full_path |
直接對應 |
action_process_image_sha256 |
target.process.file.sha256 |
直接對應 |
action_process_os_pid |
target.process.pid |
直接對應並轉換為字串 |
action_process_user_sid |
target.user.windows_sid |
直接對應 |
action_process_username |
target.user.userid 、target.administrative_domain |
將網域和使用者名稱轉為小寫並剖析,再進行對應 |
action_registry_data |
target.registry.registry_value_data |
直接對應 |
action_registry_key_name |
target.registry.registry_key |
直接對應 |
action_registry_value_name |
target.registry.registry_value_name |
直接對應 |
action_remote_ip |
target.ip |
直接對應並合併其他 IP 位址 |
action_remote_port |
target.port |
直接對應並轉換為整數 |
action_total_download |
network.received_bytes |
直接對應並轉換為無符號整數 |
action_total_upload |
network.sent_bytes |
直接對應並轉換為無符號整數 |
agent_hostname |
principal.hostname 、observer.hostname |
已轉為小寫並對應 |
agent_ip_addresses |
observer.ip |
以 JSON 格式剖析、拆分為個別 IP,然後合併 |
agent_os_sub_type |
target.platform_version |
直接對應 |
event_id |
metadata.product_log_id |
直接對應 |
event_sub_type |
metadata.product_event_type |
已轉換為字串,用於 metadata.event_type 和 metadata.product_event_type 的條件對應 |
event_timestamp |
metadata.event_timestamp 、timestamp |
轉換為字串、解析為 UNIX_MS 時間戳記,並進行對應 |
event_type |
metadata.event_type |
已轉換為字串,用於 metadata.event_type 和 metadata.product_event_type 的條件對應 |
os_actor_process_command_line |
principal.process.command_line |
直接對應 |
os_actor_process_image_md5 |
principal.process.file.md5 |
直接對應 |
os_actor_process_image_path |
principal.process.file.full_path |
直接對應 |
os_actor_process_image_sha256 |
principal.process.file.sha256 |
直接對應 |
os_actor_process_instance_id |
principal.process.product_specific_process_id |
前面加上「PAN:」並對應 |
os_actor_process_os_pid |
principal.process.pid |
已轉換為字串並對應 |
os_actor_primary_user_sid |
principal.user.windows_sid |
如果開頭為「S-」或「s-」,則已對應 |
os_actor_primary_username |
principal.user.userid 、principal.administrative_domain |
將網域和使用者名稱轉為小寫並剖析,再進行對應 |
_action |
security_result.action |
已合併至 _security_result ,然後對應 |
metadata.log_type |
metadata.log_type |
硬式編碼為「PAN_CORTEX_XDR_EVENTS」 |
metadata.product_name |
metadata.product_name |
硬式編碼為「Cortex XDR」 |
metadata.vendor_name |
metadata.vendor_name |
已硬式編碼為「PAN」 |
target.platform |
target.platform |
如果 agent_os_sub_type 包含「Windows」,請將其設為「WINDOWS」 |
還有其他問題嗎?向社群成員和 Google SecOps 專家尋求解答。