文档首页/ 企业主机安全 HSS/ API参考/ API说明/ 集群防护/ 获取集群所有防护项 - ListClusterProtectionItem
更新时间:2025-10-31 GMT+08:00
分享

获取集群所有防护项 - ListClusterProtectionItem

功能介绍

获取集群所有防护项

授权信息

账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。

  • 如果使用角色与策略授权,具体权限要求请参见权限和授权项
  • 如果使用身份策略授权,当前API调用无需身份策略权限。

URI

GET /v5/{project_id}/cluster-protect/protection-item

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

参数解释:

项目ID,用于明确项目归属,配置后可通过该ID查询项目下资产。获取方式请参见获取项目ID

约束限制:

不涉及

取值范围:

字符长度1-256位

默认取值:

不涉及

表2 Query参数

参数

是否必选

参数类型

描述

enterprise_project_id

String

参数解释:

企业项目ID,用于过滤不同企业项目下的资产。获取方式请参见获取企业项目ID

如需查询所有企业项目下的资产请传参“all_granted_eps”。

约束限制:

开通企业项目功能后才需要配置企业项目ID参数。

取值范围:

字符长度1-256位

默认取值:

0,表示默认企业项目(default)。

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

参数解释:

用户Token,包含了用户的身份、权限等信息,在调用API接口时,可通过Token进行身份认证。获取方式请参见获取用户Token

约束限制:

不涉及

取值范围:

字符长度1-32768位

默认取值:

不涉及

响应参数

状态码:200

表4 响应Body参数

参数

参数类型

描述

total_num

Integer

总数

vuls

Array of strings

漏洞信息

baselines

Array of ClusterBaselineResponseInfo objects

基线信息

malwares

Array of ClusterMalwareResponseInfo objects

恶意文件信息

images

Array of ClusterImageResponseInfo objects

镜像信息

clusters

Array of ClusterItemResponseInfo objects

集群信息

表5 ClusterBaselineResponseInfo

参数

参数类型

描述

baseline_desc

String

检查项描述

baseline_index

String

检查项ID

baseline_type

String

检查项类型

表6 ClusterMalwareResponseInfo

参数

参数类型

描述

malware_type

String

恶意文件类型

表7 ClusterImageResponseInfo

参数

参数类型

描述

image_name

String

镜像名称

image_version

String

镜像版本

id

String

ID

表8 ClusterItemResponseInfo

参数

参数类型

描述

cluster_id

String

集群id

cluster_name

String

集群名称

cluster_ns

Array of strings

集群命名空间

cluster_labels

Array of strings

集群标签

protect_status

String

参数解释

集群防护状态

取值范围:

  • unprotected:未受保护。

  • plugin error:插件错误。

  • protected with policy:受策略保护。

  • deploy policy failed:部署策略失败。

  • protected without policy:无策略保护。

  • uninstall failed:卸载失败。

  • uninstall:卸载。

  • installing:正在安装。

请求示例

获取集群所有防护项

GET https://{endpoint}/v5/{project_id}/cluster-protect/protection-item?enterprise_project_id=all_granted_eps

响应示例

状态码:200

请求已成功

{
  "vuls" : [ "CVE-2002-2443", "CVE-2005-1849", "CVE-2009-5155", "CVE-2011-2895", "CVE-2011-5325", "CVE-2012-3425", "CVE-2012-5630" ],
  "baselines" : [ {
    "baseline_desc" : "规则:需限制/etc/ssh/sshd_config的访问权限",
    "baseline_index" : "1.1",
    "baseline_type" : "SSH"
  }, {
    "baseline_desc" : "规则:使用更加安全的Ciphers算法",
    "baseline_index" : "1.10",
    "baseline_type" : "SSH"
  } ],
  "malwares" : [ {
    "malware_type" : "malwares"
  } ],
  "images" : [ {
    "id" : "43170",
    "image_name" : "anp-agent",
    "image_version" : "0.0.2"
  }, {
    "id" : "17518",
    "image_name" : "webshell-ljx",
    "image_version" : "v1"
  } ],
  "clusters" : [ {
    "cluster_id" : "08e932a3-a7f0-4d60-ae45-09a629eb3be7",
    "cluster_name" : "test-617-rrrrrrrr",
    "protect_status" : "1"
  }, {
    "cluster_id" : "441e4d05-7f90-11ee-b311-0255ac1001b2",
    "cluster_name" : "ops-show-cluster-1110",
    "cluster_ns" : [ "default", "cgs-provider", "monitoring", "test-dasd", "hss", "ljx-test" ],
    "protect_status" : "0"
  }, {
    "cluster_id" : "ba732ee6-3067-11ef-8743-0255ac1001b4",
    "cluster_name" : "liuzhaoling-tarenwudong",
    "cluster_ns" : [ "default", "hss" ],
    "protect_status" : "0"
  }, {
    "cluster_id" : "a24b6cb6-3469-11ef-846b-0255ac100b03",
    "cluster_name" : "cce-lxl-0627-2",
    "protect_status" : "0"
  } ],
  "total_num" : 2817
}

状态码

状态码

描述

200

请求已成功

错误码

请参见错误码

相关文档