本頁說明如何為 Cloud Run 資源設定 Cloud Run 威脅偵測。
本頁面的程序僅適用於 Cloud Run Threat Detection 執行階段偵測器。如要瞭解如何使用 Cloud Run 的控制平面偵測器,請參閱「使用事件威脅偵測」。
事前準備
-
如要取得管理 Cloud Run 威脅偵測服務及其模組所需的權限,請要求管理員為您授予機構、資料夾或專案的安全中心管理管理員 (
roles/securitycentermanagement.admin
) 身分與存取權管理角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。 使用第 2 代執行環境測試 Cloud Run 容器,確保沒有相容性問題。詳情請參閱「支援的執行環境」。
確認您要監控的 Cloud Run 服務所在的所有專案,都已啟用 Container Threat Detection API。如果相關專案未啟用,請啟用這項服務。
啟用或停用 Cloud Run Threat Detection
在機構、資料夾或專案中啟用 Cloud Run 威脅偵測功能後,系統會自動監控該範圍內所有支援的 Cloud Run 資源。
啟用 Cloud Run Threat Detection 後,您必須重新部署要監控的 Cloud Run 服務。
如要啟用或停用 Cloud Run 威脅偵測功能,請按照下列步驟操作:
控制台
在 Google Cloud 控制台中,前往 Cloud Run 威脅偵測的「Service Enablement」(服務啟用) 頁面。
選取您的機構或專案。
在「服務啟用」分頁的「Cloud Run 威脅偵測」欄中,選取要修改的機構、資料夾或專案啟用狀態,然後選取下列其中一個選項:
- 啟用:啟用 Cloud Run 威脅偵測功能
- 停用:停用 Cloud Run 威脅偵測
- 沿用:沿用上層資料夾或機構的啟用狀態;僅適用於專案和資料夾
gcloud
gcloud scc manage services update
指令會更新 Security Command Center 服務或模組的狀態。
使用下方的任何指令資料之前,請先替換以下項目:
-
RESOURCE_TYPE
:要更新的資源類型 (organization
、folder
或project
) -
RESOURCE_ID
:要更新的機構、資料夾或專案的數值 ID;如果是專案,您也可以使用英數字元的專案 ID -
NEW_STATE
:ENABLED
啟用 Cloud Run Threat Detection;DISABLED
停用 Cloud Run Threat Detection;或INHERITED
沿用父項資源的啟用狀態 (僅適用於專案和資料夾)
執行
gcloud scc manage services update
指令:
Linux、macOS 或 Cloud Shell
gcloud scc manage services update cloud-run-threat-detection \ --RESOURCE_TYPE=RESOURCE_ID \ --enablement-state=NEW_STATE
Windows (PowerShell)
gcloud scc manage services update cloud-run-threat-detection ` --RESOURCE_TYPE=RESOURCE_ID ` --enablement-state=NEW_STATE
Windows (cmd.exe)
gcloud scc manage services update cloud-run-threat-detection ^ --RESOURCE_TYPE=RESOURCE_ID ^ --enablement-state=NEW_STATE
您應該會收到類似以下的回應:
effectiveEnablementState: ENABLED intendedEnablementState: ENABLED modules: CLOUD_RUN_ADDED_BINARY_EXECUTED: effectiveEnablementState: DISABLED intendedEnablementState: DISABLED CLOUD_RUN_ADDED_LIBRARY_LOADED: effectiveEnablementState: DISABLED intendedEnablementState: DISABLED CLOUD_RUN_ADDED_MALICIOUS_BINARY_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_ADDED_MALICIOUS_LIBRARY_LOADED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_BUILT_IN_MALICIOUS_BINARY_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_CONTAINER_ESCAPE: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_KUBERNETES_ATTACK_TOOL_EXECUTION: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_LOCAL_RECONNAISSANCE_TOOL_EXECUTION: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MALICIOUS_PYTHON_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MALICIOUS_SCRIPT_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MALICIOUS_URL_OBSERVED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MODIFIED_MALICIOUS_BINARY_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MODIFIED_MALICIOUS_LIBRARY_LOADED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_REPORT_CLI_ARGUMENTS: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_REPORT_ENVIRONMENT_VARIABLES: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_REVERSE_SHELL: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_UNEXPECTED_CHILD_SHELL: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED name: projects/1234567890123/locations/global/securityCenterServices/cloud-run-threat-detection updateTime: '2025-03-14T00:27:36.589993683Z'
REST
Security Command Center Management API 的 RESOURCE_TYPE.locations.securityCenterServices.patch
方法會更新 Security Command Center 服務或模組的狀態。
使用任何要求資料之前,請先替換以下項目:
-
RESOURCE_TYPE
:要更新的資源類型 (organizations
、folders
或projects
) -
QUOTA_PROJECT
:用於帳單和配額追蹤的專案 ID -
RESOURCE_ID
:要更新的機構、資料夾或專案的數值 ID;如果是專案,您也可以使用英數字元的專案 ID -
NEW_STATE
:ENABLED
啟用 Cloud Run Threat Detection;DISABLED
停用 Cloud Run Threat Detection;或INHERITED
沿用父項資源的啟用狀態 (僅適用於專案和資料夾)
HTTP 方法和網址:
PATCH https://securitycentermanagement.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID/locations/global/securityCenterServices/cloud-run-threat-detection?updateMask=intendedEnablementState
JSON 要求主體:
{ "intendedEnablementState": "NEW_STATE" }
如要傳送要求,請展開以下其中一個選項:
您應該會收到如下的 JSON 回應:
{ "name": "projects/1234567890123/locations/global/securityCenterServices/cloud-run-threat-detection", "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED", "modules": { "CLOUD_RUN_REPORT_CLI_ARGUMENTS": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_CONTAINER_ESCAPE": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_MALICIOUS_SCRIPT_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_MODIFIED_MALICIOUS_BINARY_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_ADDED_MALICIOUS_BINARY_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_ADDED_LIBRARY_LOADED": { "intendedEnablementState": "DISABLED", "effectiveEnablementState": "DISABLED" }, "CLOUD_RUN_REVERSE_SHELL": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_LOCAL_RECONNAISSANCE_TOOL_EXECUTION": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_KUBERNETES_ATTACK_TOOL_EXECUTION": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_REPORT_ENVIRONMENT_VARIABLES": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_UNEXPECTED_CHILD_SHELL": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_ADDED_BINARY_EXECUTED": { "intendedEnablementState": "DISABLED", "effectiveEnablementState": "DISABLED" }, "CLOUD_RUN_MODIFIED_MALICIOUS_LIBRARY_LOADED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_ADDED_MALICIOUS_LIBRARY_LOADED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_BUILT_IN_MALICIOUS_BINARY_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_MALICIOUS_PYTHON_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_MALICIOUS_URL_OBSERVED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" } }, "updateTime": "2025-03-14T00:27:36.589993683Z" }
啟用或停用 Cloud Run Threat Detection 模組
如要啟用或停用個別 Cloud Run 威脅偵測模組,請按照下列步驟操作。如要瞭解所有 Cloud Run Threat Detection 威脅發現項目及其模組,請參閱 Cloud Run Threat Detection 偵測器。
gcloud
gcloud scc manage services update
指令會更新 Security Command Center 服務或模組的狀態。
使用下方的任何指令資料之前,請先替換以下項目:
-
RESOURCE_TYPE
:要更新的資源類型 (organization
、folder
或project
) -
RESOURCE_ID
:要更新的機構、資料夾或專案的數值 ID;如果是專案,您也可以使用英數字元的專案 ID -
:要啟用或停用模組的名稱;如需有效值,請參閱
Cloud Run Threat Detection 偵測器
MODULE_NAME
-
NEW_STATE
:ENABLED
啟用模組;DISABLED
停用模組;或INHERITED
沿用父項資源的啟用狀態 (僅適用於專案和資料夾)
將下列內容儲存到名為 request.json
的檔案:
{ "MODULE_NAME": { "intendedEnablementState": "NEW_STATE" } }
執行
gcloud scc manage services update
指令:
Linux、macOS 或 Cloud Shell
gcloud scc manage services update cloud-run-threat-detection \ --RESOURCE_TYPE=RESOURCE_ID \ --enablement-state=ENABLED \ --module-config-file=request.json
Windows (PowerShell)
gcloud scc manage services update cloud-run-threat-detection ` --RESOURCE_TYPE=RESOURCE_ID ` --enablement-state=ENABLED \ --module-config-file=request.json
Windows (cmd.exe)
gcloud scc manage services update cloud-run-threat-detection ^ --RESOURCE_TYPE=RESOURCE_ID ^ --enablement-state=ENABLED \ --module-config-file=request.json
您應該會收到類似以下的回應:
effectiveEnablementState: ENABLED intendedEnablementState: ENABLED modules: CLOUD_RUN_ADDED_BINARY_EXECUTED: effectiveEnablementState: DISABLED intendedEnablementState: DISABLED CLOUD_RUN_ADDED_LIBRARY_LOADED: effectiveEnablementState: DISABLED intendedEnablementState: DISABLED CLOUD_RUN_ADDED_MALICIOUS_BINARY_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_ADDED_MALICIOUS_LIBRARY_LOADED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_BUILT_IN_MALICIOUS_BINARY_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_CONTAINER_ESCAPE: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_KUBERNETES_ATTACK_TOOL_EXECUTION: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_LOCAL_RECONNAISSANCE_TOOL_EXECUTION: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MALICIOUS_PYTHON_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MALICIOUS_SCRIPT_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MALICIOUS_URL_OBSERVED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MODIFIED_MALICIOUS_BINARY_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MODIFIED_MALICIOUS_LIBRARY_LOADED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_REPORT_CLI_ARGUMENTS: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_REPORT_ENVIRONMENT_VARIABLES: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_REVERSE_SHELL: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_UNEXPECTED_CHILD_SHELL: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED name: projects/1234567890123/locations/global/securityCenterServices/cloud-run-threat-detection updateTime: '2025-03-14T00:27:36.589993683Z'
REST
Security Command Center Management API 的 RESOURCE_TYPE.locations.securityCenterServices.patch
方法會更新 Security Command Center 服務或模組的狀態。
使用任何要求資料之前,請先替換以下項目:
-
RESOURCE_TYPE
:要更新的資源類型 (organizations
、folders
或projects
) -
QUOTA_PROJECT
:用於帳單和配額追蹤的專案 ID -
RESOURCE_ID
:要更新的機構、資料夾或專案的數值 ID;如果是專案,您也可以使用英數字元的專案 ID -
:要啟用或停用模組的名稱;如需有效值,請參閱
Cloud Run Threat Detection 偵測器
MODULE_NAME
-
NEW_STATE
:ENABLED
啟用模組;DISABLED
停用模組;或INHERITED
沿用父項資源的啟用狀態 (僅適用於專案和資料夾)
HTTP 方法和網址:
PATCH https://securitycentermanagement.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID/locations/global/securityCenterServices/cloud-run-threat-detection?updateMask=modules
JSON 要求主體:
{ "modules": { "MODULE_NAME": { "intendedEnablementState": "NEW_STATE" } } }
如要傳送要求,請展開以下其中一個選項:
您應該會收到如下的 JSON 回應:
{ "name": "projects/1234567890123/locations/global/securityCenterServices/cloud-run-threat-detection", "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED", "modules": { "CLOUD_RUN_REPORT_CLI_ARGUMENTS": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_CONTAINER_ESCAPE": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_MALICIOUS_SCRIPT_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_MODIFIED_MALICIOUS_BINARY_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_ADDED_MALICIOUS_BINARY_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_ADDED_LIBRARY_LOADED": { "intendedEnablementState": "DISABLED", "effectiveEnablementState": "DISABLED" }, "CLOUD_RUN_REVERSE_SHELL": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_LOCAL_RECONNAISSANCE_TOOL_EXECUTION": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_KUBERNETES_ATTACK_TOOL_EXECUTION": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_REPORT_ENVIRONMENT_VARIABLES": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_UNEXPECTED_CHILD_SHELL": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_ADDED_BINARY_EXECUTED": { "intendedEnablementState": "DISABLED", "effectiveEnablementState": "DISABLED" }, "CLOUD_RUN_MODIFIED_MALICIOUS_LIBRARY_LOADED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_ADDED_MALICIOUS_LIBRARY_LOADED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_BUILT_IN_MALICIOUS_BINARY_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_MALICIOUS_PYTHON_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_MALICIOUS_URL_OBSERVED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" } }, "updateTime": "2025-03-14T00:27:36.589993683Z" }
從發現項目中排除環境變數
根據預設,Cloud Run 威脅偵測功能產生發現項目時,會回報發現項目中參照的所有程序所用的環境變數。環境變數的值在威脅調查中可能非常重要。
不過,您可能會決定從調查結果中排除環境變數,因為部分軟體套件會將密鑰和其他私密資訊儲存在環境變數中。
如要從 Cloud Run 威脅偵測結果中排除程序環境變數,請將
CLOUD_RUN_REPORT_ENVIRONMENT_VARIABLES
模組設為DISABLED
。如要在 Cloud Run Threat Detection 發現項目中加入程序環境變數,請將
CLOUD_RUN_REPORT_ENVIRONMENT_VARIABLES
模組設為ENABLED
。
如需操作說明,請參閱本頁的「啟用或停用 Cloud Run 威脅偵測模組」。
從發現項目中排除 CLI 引數
所有程序都有一或多個指令列介面 (CLI) 引數。根據預設,當 Cloud Run 威脅偵測在發現項目中加入程序詳細資料時,會記錄程序的 CLI 引數。CLI 引數值在威脅調查中可能非常重要。
不過,您可能會決定從發現項目中排除 CLI 引數,因為部分使用者可能會在 CLI 引數中傳遞密碼和其他機密資訊。
如要從 Cloud Run 威脅偵測發現項目中排除 CLI 引數,請將
CLOUD_RUN_REPORT_CLI_ARGUMENTS
模組設為DISABLED
。如要在 Cloud Run 威脅偵測結果中加入 CLI 引數,請將
CLOUD_RUN_REPORT_CLI_ARGUMENTS
模組設為ENABLED
。
如需操作說明,請參閱本頁的「啟用或停用 Cloud Run 威脅偵測模組」。
查看 Cloud Run Threat Detection 模組的設定
如要瞭解所有 Cloud Run Threat Detection 威脅發現項目,請參閱「Cloud Run Threat Detection 偵測器」表格。
gcloud
gcloud scc manage services describe
指令會取得 Security Command Center 服務或模組的狀態。
使用下方的任何指令資料之前,請先替換以下項目:
-
RESOURCE_TYPE
:要取得的資源類型 (organization
、folder
或project
) -
QUOTA_PROJECT
:用於帳單和配額追蹤的專案 ID -
RESOURCE_ID
:要取得的機構、資料夾或專案的數值 ID;如果是專案,您也可以使用英數字元的專案 ID
執行
gcloud scc manage services describe
指令:
Linux、macOS 或 Cloud Shell
gcloud scc manage services describe cloud-run-threat-detection \ --RESOURCE_TYPE=RESOURCE_ID
Windows (PowerShell)
gcloud scc manage services describe cloud-run-threat-detection ` --RESOURCE_TYPE=RESOURCE_ID
Windows (cmd.exe)
gcloud scc manage services describe cloud-run-threat-detection ^ --RESOURCE_TYPE=RESOURCE_ID
您應該會收到類似以下的回應:
effectiveEnablementState: ENABLED intendedEnablementState: ENABLED modules: CLOUD_RUN_ADDED_BINARY_EXECUTED: effectiveEnablementState: DISABLED intendedEnablementState: DISABLED CLOUD_RUN_ADDED_LIBRARY_LOADED: effectiveEnablementState: DISABLED intendedEnablementState: DISABLED CLOUD_RUN_ADDED_MALICIOUS_BINARY_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_ADDED_MALICIOUS_LIBRARY_LOADED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_BUILT_IN_MALICIOUS_BINARY_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_CONTAINER_ESCAPE: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_KUBERNETES_ATTACK_TOOL_EXECUTION: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_LOCAL_RECONNAISSANCE_TOOL_EXECUTION: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MALICIOUS_PYTHON_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MALICIOUS_SCRIPT_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MALICIOUS_URL_OBSERVED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MODIFIED_MALICIOUS_BINARY_EXECUTED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_MODIFIED_MALICIOUS_LIBRARY_LOADED: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_REPORT_CLI_ARGUMENTS: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_REPORT_ENVIRONMENT_VARIABLES: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_REVERSE_SHELL: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED CLOUD_RUN_UNEXPECTED_CHILD_SHELL: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED name: projects/1234567890123/locations/global/securityCenterServices/cloud-run-threat-detection updateTime: '2025-03-14T00:27:36.589993683Z'
REST
Security Command Center Management API 的
RESOURCE_TYPE.locations.securityCenterServices.get
方法會取得 Security Command Center 服務或模組的狀態。
使用任何要求資料之前,請先替換以下項目:
-
RESOURCE_TYPE
:要取得的資源類型 (organizations
、folders
或projects
) -
QUOTA_PROJECT
:用於帳單和配額追蹤的專案 ID -
RESOURCE_ID
:要取得的機構、資料夾或專案的數值 ID;如果是專案,您也可以使用英數字元的專案 ID
HTTP 方法和網址:
GET https://securitycentermanagement.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID/locations/global/securityCenterServices/cloud-run-threat-detection
如要傳送要求,請展開以下其中一個選項:
您應該會收到如下的 JSON 回應:
{ "name": "projects/1234567890123/locations/global/securityCenterServices/cloud-run-threat-detection", "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED", "modules": { "CLOUD_RUN_REPORT_CLI_ARGUMENTS": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_CONTAINER_ESCAPE": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_MALICIOUS_SCRIPT_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_MODIFIED_MALICIOUS_BINARY_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_ADDED_MALICIOUS_BINARY_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_ADDED_LIBRARY_LOADED": { "intendedEnablementState": "DISABLED", "effectiveEnablementState": "DISABLED" }, "CLOUD_RUN_REVERSE_SHELL": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_LOCAL_RECONNAISSANCE_TOOL_EXECUTION": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_KUBERNETES_ATTACK_TOOL_EXECUTION": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_REPORT_ENVIRONMENT_VARIABLES": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_UNEXPECTED_CHILD_SHELL": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_ADDED_BINARY_EXECUTED": { "intendedEnablementState": "DISABLED", "effectiveEnablementState": "DISABLED" }, "CLOUD_RUN_MODIFIED_MALICIOUS_LIBRARY_LOADED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_ADDED_MALICIOUS_LIBRARY_LOADED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_BUILT_IN_MALICIOUS_BINARY_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_MALICIOUS_PYTHON_EXECUTED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" }, "CLOUD_RUN_MALICIOUS_URL_OBSERVED": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" } }, "updateTime": "2025-03-14T00:27:36.589993683Z" }
查看調查結果
Cloud Run 威脅偵測功能產生發現項目後,您可以在 Security Command Center 中查看。
您可以在機構、資料夾或專案層級授予 Security Command Center 的 IAM 角色。您能否查看、編輯、建立或更新發現項目、資產和安全性來源,取決於您獲准的存取層級。如要進一步瞭解 Security Command Center 角色,請參閱存取權控管。
如要在 Security Command Center 中查看 Cloud Run Threat Detection 發現項目,請按照下列步驟操作:
- 在 Google Cloud 控制台中,前往 Security Command Center 的「發現項目」頁面。
- 選取 Google Cloud 專案或機構。
- 在「快速篩選器」部分的「來源顯示名稱」子部分中,選取「Cloud Run 威脅偵測」。發現項目查詢結果會更新,只顯示來自這個來源的發現項目。
- 如要查看特定發現項目的詳細資料,請按一下「類別」欄中的發現項目名稱。 系統會開啟發現項目的詳細資料面板,並顯示「摘要」分頁。
- 在「摘要」分頁中,查看發現項目的詳細資料,包括偵測到的內容、受影響的資源,以及 (如有) 可採取哪些步驟來修正發現項目。
- 選用:如要查看調查結果的完整 JSON 定義,請按一下「JSON」JSON分頁。
為協助您進行調查,威脅發現結果也包含下列外部資源的連結:
- MITRE ATT&CK 架構項目。這個架構說明針對雲端資源的攻擊技術,並提供補救指引。
- VirusTotal:Alphabet 旗下服務,可提供潛在惡意檔案、指令碼、網址和網域的相關資訊。
如需 Cloud Run Threat Detection 發現項目類型的清單,請參閱 Cloud Run Threat Detection 偵測工具。
後續步驟
- 進一步瞭解 Cloud Run Threat Detection。
- 瞭解如何重新部署 Cloud Run 服務。
- 瞭解 Cloud Run 如何實作安全性最佳做法。