全部產品
Search
文件中心

Cloud Config:GetCompliancePack - 查詢合規包詳情

更新時間:Oct 15, 2025

查詢指定的合規包詳情。

介面說明

本文將提供一個樣本,查詢合規包cp-fdc8626622af00f9****的詳情。返回結果顯示,合規包名稱為等保三級預檢合規包、合規包狀態為ACTIVE(正常)、合規包中規則的風險等級為1(高風險)等。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

config:GetCompliancePack

get

*CompliancePack

acs:config:*:{#accountId}:compliancepack/{#CompliancePackId}

請求參數

名稱

類型

必填

描述

樣本值

CompliancePackId

string

合規包 ID。

關於如何擷取合規包 ID,請參見 ListCompliancePacks

cp-a8a8626622af0082****

Tag deprecated

array<object>

資源的標籤。該入參已棄用,請忽略,傳入不會生效。

最多支援綁定 20 個標籤。

object

資源的標籤。

最多支援綁定 20 個標籤。

Key

string

資源的標籤鍵。

一旦傳入該值,則不允許為空白字串。最多支援 64 個字元,不能以aliyun或者acs:開頭,不能包含http://或者https://

一次最多支援輸入 20 個標籤的標籤鍵。

key-1

Value

string

資源的標籤值。

標籤值可以為空白或輸入不超過 128 個字元的字串,不能以aliyun或者acs:開頭,不能包含http://或者https://

每一個標籤鍵對應一個標籤值,一次最多支援輸入 20 個標籤鍵對應的標籤值。

value-1

返回參數

名稱

類型

描述

樣本值

object

無。

RequestId

string

請求 ID。

6EC7AED1-172F-42AE-9C12-295BC2ADB751

CompliancePack

object

合規包資訊。

Status

string

合規包狀態。取值:

  • ACTIVE:正常。

  • CREATING:建立中。

ACTIVE

CompliancePackId

string

合規包 ID。

cp-a8a8626622af0082****

RiskLevel

integer

合規包風險等級。取值:

  • 1:高風險。

  • 2:中風險。

  • 3:低風險。

1

Description

string

合規包描述。

基於等保2.0三級標準,提供持續檢測合規性的建議模板,協助您提前自檢並修複問題,以便快速通過正式檢測。

ConfigRules

array<object>

合規包中的規則列表。

object

無。

ManagedRuleIdentifier

string

規則模板標識。

eip-bandwidth-limit

ConfigRuleName

string

規則名稱。

彈性IP執行個體頻寬滿足最低要求

ConfigRuleId

string

規則 ID。

cr-a260626622af0005****

ConfigRuleParameters

array<object>

規則參數資訊。

object

無。

Required

boolean

規則中參數是否必填。取值:

  • true:必填。

  • false:非必填。

true

ParameterName

string

規則參數名稱。

bandwidth

ParameterValue

string

規則參數值。

10

Description

string

規則描述。

彈性IP執行個體可用頻寬大於等於指定參數值,視為“合規”。預設值:10 MB。

RiskLevel

integer

規則風險等級。取值:

  • 1:高風險。

  • 2:中風險。

  • 3:低風險。

1

ResourceTypesScope

string

規則評估的資源類型。多個資源類型之間用半形逗號(,)分隔。

ACS::EIP::EipAddress

TemplateContent

string

當前合規包模板資訊,模板中規則列表不包含自訂函數規則。可基於模板資訊快速為其他帳號或帳號組建立同樣的合規包。

{ "configRuleTemplates": [ { "configRuleName": "自訂條件規則樣本", "scope": { "complianceResourceTypes": [ "ACS::ECS::Instance" ] }, "description": "", "source": { "owner": "CUSTOM_CONFIGURATION", "identifier": "acs-config-configuration", "sourceDetails": [ { "messageType": "ScheduledNotification", "maximumExecutionFrequency": "Twelve_Hours" }, { "messageType": "ConfigurationItemChangeNotification" } ], "conditions": "{\"ComplianceConditions\":\"{\\\"operator\\\":\\\"and\\\",\\\"children\\\":[{\\\"operator\\\":\\\"GreaterOrEquals\\\",\\\"featurePath\\\":\\\"$.Cpu\\\",\\\"featureSource\\\":\\\"CONFIGURATION\\\",\\\"desired\\\":\\\"2\\\"}]}\"}" }, "inputParameters": {} }, { "configRuleName": "OSS儲存空間Referer在指定的防盜鏈白名單中", "scope": { "complianceResourceTypes": [ "ACS::OSS::Bucket" ] }, "description": "OSS儲存空間開啟防盜鏈並且Referer在指定白名單中,視為“合規”。", "source": { "owner": "ALIYUN", "identifier": "oss-bucket-referer-limit", "sourceDetails": [ { "messageType": "ConfigurationItemChangeNotification" } ] }, "inputParameters": { "allowEmptyReferer": "true", "allowReferers": "http://www.aliyun.com" } } ] }

CompliancePackName

string

合規包名稱。

等保三級預檢合規包

AccountId

integer

合規包歸屬的阿里雲帳號 ID。

100931896542****

CompliancePackTemplateId

string

合規包模板 ID。

ct-5f26ff4e06a300c4****

CreateTimestamp

integer

建立合規包的時間戳記。單位:毫秒。

1624245766000

Scope

object

資源群組生效範圍。

ExcludeRegionIdsScope

string

排除的地區範圍,多個地區 ID 之間用半形逗號(,)分隔。

cn-hangzhou

ResourceIdsScope

string

規則對指定資源 ID 生效。多個資源 ID 之間用半形逗號(,)分隔。

eip-8vbf3x310fn56ijfd****

ExcludeResourceGroupIdsScope

string

合規包僅對指定資源群組 ID 中的資源不生效。多個資源群組 ID 之間用半形逗號(,)分隔。

rg-aekzc7r7rhx****

TagKeyScope

string

合規包僅對綁定指定標籤鍵的資源生效。

ECS

TagsScope

array<object>

標籤範圍

object

標籤範圍

TagKey

string

標籤鍵。

key-1

TagValue

string

標籤值。

value-1

ExcludeTagsScope

array<object>

排除的標籤範圍

object

排除的標籤範圍

TagKey

string

標籤鍵。

key-2

TagValue

string

標籤值。

value-2

TagValueScope

string

合規包僅對綁定指定標籤索引值對的資源生效。

test

RegionIdsScope

string

合規包僅對指定地區 ID 中的資源生效。

cn-hangzhou

ExcludeResourceIdsScope

string

合規包對指定資源 ID 無效,即不對該資源執行評估。

eip-8vbf3x310fn56ijfd****

ResourceGroupIdsScope

string

合規包僅對指定資源群組 ID 中的資源生效。

rg-aekzc7r7rhx****

Tags

array<object>

資源標籤。

object

資源標籤。

TagKey

string

標籤鍵。

key-1

TagValue

string

標籤值。

value-1

樣本

正常返回樣本

JSON格式

{
  "RequestId": "6EC7AED1-172F-42AE-9C12-295BC2ADB751",
  "CompliancePack": {
    "Status": "ACTIVE",
    "CompliancePackId": "cp-a8a8626622af0082****",
    "RiskLevel": 1,
    "Description": "基於等保2.0三級標準,提供持續檢測合規性的建議模板,協助您提前自檢並修複問題,以便快速通過正式檢測。",
    "ConfigRules": [
      {
        "ManagedRuleIdentifier": "eip-bandwidth-limit",
        "ConfigRuleName": "彈性IP執行個體頻寬滿足最低要求",
        "ConfigRuleId": "cr-a260626622af0005****",
        "ConfigRuleParameters": [
          {
            "Required": true,
            "ParameterName": "bandwidth",
            "ParameterValue": "10"
          }
        ],
        "Description": "彈性IP執行個體可用頻寬大於等於指定參數值,視為“合規”。預設值:10 MB。",
        "RiskLevel": 1,
        "ResourceTypesScope": "ACS::EIP::EipAddress"
      }
    ],
    "TemplateContent": "{\n    \"configRuleTemplates\": [\n        {\n            \"configRuleName\": \"自訂條件規則樣本\",\n            \"scope\": {\n                \"complianceResourceTypes\": [\n                    \"ACS::ECS::Instance\"\n                ]\n            },\n            \"description\": \"\",\n            \"source\": {\n                \"owner\": \"CUSTOM_CONFIGURATION\",\n                \"identifier\": \"acs-config-configuration\",\n                \"sourceDetails\": [\n                    {\n                        \"messageType\": \"ScheduledNotification\",\n                        \"maximumExecutionFrequency\": \"Twelve_Hours\"\n                    },\n                    {\n                        \"messageType\": \"ConfigurationItemChangeNotification\"\n                    }\n                ],\n                \"conditions\": \"{\\\"ComplianceConditions\\\":\\\"{\\\\\\\"operator\\\\\\\":\\\\\\\"and\\\\\\\",\\\\\\\"children\\\\\\\":[{\\\\\\\"operator\\\\\\\":\\\\\\\"GreaterOrEquals\\\\\\\",\\\\\\\"featurePath\\\\\\\":\\\\\\\"$.Cpu\\\\\\\",\\\\\\\"featureSource\\\\\\\":\\\\\\\"CONFIGURATION\\\\\\\",\\\\\\\"desired\\\\\\\":\\\\\\\"2\\\\\\\"}]}\\\"}\"\n            },\n            \"inputParameters\": {}\n        },\n        {\n            \"configRuleName\": \"OSS儲存空間Referer在指定的防盜鏈白名單中\",\n            \"scope\": {\n                \"complianceResourceTypes\": [\n                    \"ACS::OSS::Bucket\"\n                ]\n            },\n            \"description\": \"OSS儲存空間開啟防盜鏈並且Referer在指定白名單中,視為“合規”。\",\n            \"source\": {\n                \"owner\": \"ALIYUN\",\n                \"identifier\": \"oss-bucket-referer-limit\",\n                \"sourceDetails\": [\n                    {\n                        \"messageType\": \"ConfigurationItemChangeNotification\"\n                    }\n                ]\n            },\n            \"inputParameters\": {\n                \"allowEmptyReferer\": \"true\",\n                \"allowReferers\": \"http://www.aliyun.com\"\n            }\n        }\n    ]\n}",
    "CompliancePackName": "等保三級預檢合規包",
    "AccountId": 0,
    "CompliancePackTemplateId": "ct-5f26ff4e06a300c4****",
    "CreateTimestamp": 1624245766000,
    "Scope": {
      "ExcludeRegionIdsScope": "cn-hangzhou",
      "ResourceIdsScope": "eip-8vbf3x310fn56ijfd****\n",
      "ExcludeResourceGroupIdsScope": "rg-aekzc7r7rhx****",
      "TagKeyScope": "ECS",
      "TagsScope": [
        {
          "TagKey": "key-1",
          "TagValue": "value-1"
        }
      ],
      "ExcludeTagsScope": [
        {
          "TagKey": "key-2",
          "TagValue": "value-2"
        }
      ],
      "TagValueScope": "test",
      "RegionIdsScope": "cn-hangzhou",
      "ExcludeResourceIdsScope": "eip-8vbf3x310fn56ijfd****",
      "ResourceGroupIdsScope": "rg-aekzc7r7rhx****"
    },
    "Tags": [
      {
        "TagKey": "key-1",
        "TagValue": "value-1"
      }
    ]
  }
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 Invalid.CompliancePackId.Value The specified CompliancePackId does not exist. 合規包ID不存在。
404 AccountNotExisted Your account does not exist.
503 ServiceUnavailable The request has failed due to a temporary failure of the server. 服務不可用。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情