使用 Cloud Run 威胁检测

本页介绍了如何为 Cloud Run 资源配置 Cloud Run 威胁检测

本页中的步骤仅适用于 Cloud Run 威胁检测运行时检测器。如需了解如何使用 Cloud Run 的控制平面检测器,请参阅使用 Event Threat Detection

准备工作

向 Cloud Run 服务账号授予所需的 IAM 权限

如果您的 Cloud Run 资源使用的是 Compute Engine 默认服务账号,并且您尚未撤消该服务账号的权限,则您已拥有运行 Cloud Run 威胁检测所需的权限。您可以跳过此部分。

如果您符合以下任一情况,请执行此任务:

  • 您更改了 Compute Engine 默认服务账号。
  • 您为 Cloud Run 服务创建了自己的服务账号。
  • 您使用的服务账号是为其他项目创建的,而该项目与包含 Cloud Run 服务的项目不同。

向您的 Cloud Run 资源用作服务身份的服务账号授予 Service Account Token Creator 角色:

gcloud iam service-accounts add-iam-policy-binding \
    PROJECT_NUMBER \
    --member=serviceAccount:SERVICE_ACCOUNT_NAME \
    --role=roles/iam.serviceAccountTokenCreator

替换以下内容:

  • PROJECT_NUMBER:部署 Cloud Run 服务的项目的数字标识符。此项目可以不同于包含该服务账号的项目。您可以在 Google Cloud 控制台的信息中心页面上找到项目编号。
  • SERVICE_ACCOUNT_NAME:运行时 Cloud Run 服务账号的电子邮件地址。

启用或停用 Cloud Run 威胁检测

为组织、文件夹或项目启用 Cloud Run Threat Detection 后,该服务会自动监控该范围内的所有受支持的 Cloud Run 资源

启用 Cloud Run 威胁检测后,您必须重新部署要监控的 Cloud Run 服务

如需启用或停用 Cloud Run Threat Detection,请按以下步骤操作:

控制台

  1. 在 Google Cloud 控制台中,前往 Cloud Run Threat Detection 的服务启用页面。

    前往“服务启用”页面

  2. 选择您的组织或项目。

  3. 服务启用标签页的 Cloud Run 威胁检测列中,选择要修改的组织、文件夹或项目的启用状态,然后选择以下任一选项:

    • 启用:启用 Cloud Run 威胁检测
    • 停用:停用 Cloud Run 威胁检测
    • 继承:从父级文件夹或组织继承启用状态;仅适用于项目和文件夹

gcloud

gcloud scc manage services update 命令用于更新 Security Command Center 服务或模块的状态。

在使用下面的命令数据之前,请先进行以下替换:

  • RESOURCE_TYPE:要更新的资源类型(organizationfolderproject
  • RESOURCE_ID:要更新的组织、文件夹或项目的数字标识符;对于项目,您还可以使用字母数字项目 ID
  • NEW_STATEENABLED 用于启用 Cloud Run 威胁检测;DISABLED 用于停用 Cloud Run 威胁检测;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:要更新的资源类型(organizationsfoldersprojects
  • QUOTA_PROJECT:用于结算和配额跟踪的项目 ID
  • RESOURCE_ID:要更新的组织、文件夹或项目的数字标识符;对于项目,您还可以使用字母数字项目 ID
  • NEW_STATEENABLED 用于启用 Cloud Run 威胁检测;DISABLED 用于停用 Cloud Run 威胁检测;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 Threat Detection 模块,请按照以下步骤操作。如需了解所有 Cloud Run 威胁检测威胁发现结果及其模块,请参阅 Cloud Run 威胁检测检测器

gcloud

gcloud scc manage services update 命令用于更新 Security Command Center 服务或模块的状态。

在使用下面的命令数据之前,请先进行以下替换:

  • RESOURCE_TYPE:要更新的资源类型(organizationfolderproject
  • RESOURCE_ID:要更新的组织、文件夹或项目的数字标识符;对于项目,您还可以使用字母数字项目 ID
  • MODULE_NAME:要启用或停用的模块的名称;如需了解有效值,请参阅 Cloud Run Threat Detection 检测器
  • NEW_STATEENABLED 用于启用模块;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:要更新的资源类型(organizationsfoldersprojects
  • QUOTA_PROJECT:用于结算和配额跟踪的项目 ID
  • RESOURCE_ID:要更新的组织、文件夹或项目的数字标识符;对于项目,您还可以使用字母数字项目 ID
  • MODULE_NAME:要启用或停用的模块的名称;如需了解有效值,请参阅 Cloud Run Threat Detection 检测器
  • NEW_STATEENABLED 用于启用模块;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 Threat Detection 发现结果中排除进程环境变量,请将 CLOUD_RUN_REPORT_ENVIRONMENT_VARIABLES 模块设置为 DISABLED

  • 如需在 Cloud Run 威胁检测结果中包含进程环境变量,请将 CLOUD_RUN_REPORT_ENVIRONMENT_VARIABLES 模块设置为 ENABLED

如需了解相关说明,请参阅本页面上的启用或停用 Cloud Run Threat Detection 模块

从发现结果中排除 CLI 参数

所有进程都有一个或多个命令行界面 (CLI) 参数。默认情况下,当 Cloud Run Threat Detection 在发现结果中添加进程详细信息时,它会记录该进程的 CLI 参数。CLI 参数值在威胁调查中可能很重要。

不过,您可以决定从发现结果中排除 CLI 参数,因为某些用户可能会在 CLI 参数中传递密钥和其他敏感信息。

  • 如需从 Cloud Run Threat Detection 发现结果中排除 CLI 参数,请将 CLOUD_RUN_REPORT_CLI_ARGUMENTS 模块设置为 DISABLED

  • 如需在 Cloud Run Threat Detection 发现结果中包含 CLI 参数,请将 CLOUD_RUN_REPORT_CLI_ARGUMENTS 模块设为 ENABLED

如需了解相关说明,请参阅本页面上的启用或停用 Cloud Run Threat Detection 模块

查看 Cloud Run Threat Detection 模块的设置

如需了解所有 Cloud Run 威胁检测威胁发现结果,请参阅 Cloud Run 威胁检测检测器表格。

gcloud

gcloud scc manage services describe 命令用于获取 Security Command Center 服务或模块的状态。

在使用下面的命令数据之前,请先进行以下替换:

  • RESOURCE_TYPE:要获取的资源类型(organizationfolderproject
  • QUOTA_PROJECT:用于结算和配额跟踪的项目 ID
  • RESOURCE_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:要获取的资源类型(organizationsfoldersprojects
  • QUOTA_PROJECT:用于结算和配额跟踪的项目 ID
  • RESOURCE_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 Threat Detection 生成发现结果后,您可以在 Security Command Center 中查看它们。

Security Command Center 的 IAM 角色可以在组织、文件夹或项目级层授予。您能否查看、修改、创建或更新发现结果、资产和安全来源,取决于您获授予的访问权限级别。如需详细了解 Security Command Center 角色,请参阅访问权限控制

如需在 Security Command Center 中查看 Cloud Run Threat Detection 发现结果,请按以下步骤操作:

  1. 在 Google Cloud 控制台中,前往 Security Command Center 的发现结果页面。

    前往“发现结果”页面

  2. 选择您的 Google Cloud 项目或组织。
  3. 快速过滤条件部分的来源显示名称子部分中,选择 Cloud Run Threat Detection。发现结果的查询结果会更新为仅显示此来源的发现结果。
  4. 如需查看特定发现结果的详细信息,请点击类别列中的发现结果名称。 系统会打开发现结果的详细信息面板,并显示摘要标签页。
  5. 摘要标签页上,查看发现结果的详细信息,包括有关检测到的内容、受影响的资源的信息,以及您可以采取的发现结果修复步骤(如果有)。
  6. 可选:如需查看发现结果的完整 JSON 定义,请点击 JSON 标签页。

为了帮助您进行调查,威胁发现结果还包含指向以下外部资源的链接:

  • MITRE ATT&CK 框架条目。该框架解释了针对云资源的攻击伎俩,并提供修复指南。
  • VirusTotal,这是一项 Alphabet 自有服务,用于提供有关潜在恶意文件、脚本、网址和网域的上下文。

如需查看 Cloud Run Threat Detection 发现结果类型的列表,请参阅 Cloud Run Threat Detection 检测器

后续步骤