All Products
Search
Document Center

Cloud Config:GetCompliancePack

Last Updated:Jun 21, 2024

Queries the details of a compliance package.

Operation description

This topic provides an example on how to query the details of a compliance package whose ID is cp-fdc8626622af00f9****. The returned result shows that the name of the compliance package is ClassifiedProtectionPreCheck, the compliance package is in the ACTIVE state, and the risk level of the rules in the compliance package is 1, which indicates high risk level.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
config:GetCompliancePackRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
CompliancePackIdstringYes

The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see ListCompliancePacks .

cp-a8a8626622af0082****

Response parameters

ParameterTypeDescriptionExample
object

This operation does not return any operation-specific parameters.

RequestIdstring

The request ID.

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

The details of the compliance package.

Statusstring

The status of the compliance package. Valid values:

  • ACTIVE: The compliance package is normal.
  • CREATING: The compliance package is being created.
ACTIVE
CompliancePackIdstring

The ID of the compliance package.

cp-a8a8626622af0082****
RiskLevelinteger

The risk level of the resources that are not compliant with the rules in the compliance package. Valid values:

  • 1: high
  • 2: medium
  • 3: low
1
Descriptionstring

The description of the compliance package.

ConfigRulesobject []

The rules in the compliance package.

ManagedRuleIdentifierstring

The identifier of the managed rule.

eip-bandwidth-limit
ConfigRuleNamestring

The rule name.

ConfigRuleIdstring

The rule ID.

cr-a260626622af0005****
ConfigRuleParametersobject []

The input parameters of the rule.

Requiredboolean

Indicates whether the input parameters are required. Valid values:

  • true
  • false
true
ParameterNamestring

The name of the input parameter.

bandwidth
ParameterValuestring

The value of the input parameter.

10
Descriptionstring

The rule description.

RiskLevelinteger

The risk level of the resources that do not comply with the rule. Valid values:

  • 1: high
  • 2: medium
  • 3: low
1
ResourceTypesScopestring

The type of the resource evaluated based on the rule. Separate multiple resource types with commas (,).

ACS::EIP::EipAddress
TemplateContentstring

The information about the current compliance package template. The rules in the template do not contain custom function rules. You can quickly create the same compliance package for other accounts or account groups based on the template information.

CompliancePackNamestring

The name of the compliance package.

AccountIdlong

The ID of the Alibaba Cloud account to which the compliance package belongs.

100931896542****
CompliancePackTemplateIdstring

The ID of the compliance package template.

ct-5f26ff4e06a300c4****
CreateTimestamplong

The timestamp when the compliance package was created. Unit: milliseconds.

1624245766000
Scopeobject

The resource group for which the compliance package took effect.

TagKeyScopestring

The tag key of the resource that you want to evaluate by using the compliance package.

ECS
TagValueScopestring

The tag value of the resource that you want to evaluate by using the compliance package.

test
RegionIdsScopestring

The ID of the region whose resources you want to evaluate by using the compliance package.

cn-hangzhou
ExcludeResourceIdsScopestring

The ID of the resource that you do not want to evaluate by using the compliance package.

eip-8vbf3x310fn56ijfd****
ResourceGroupIdsScopestring

The ID of the resource group whose resources you want to evaluate by using the compliance package.

rg-aekzc7r7rhx****

Examples

Sample success responses

JSONformat

{
  "RequestId": "6EC7AED1-172F-42AE-9C12-295BC2ADB751",
  "CompliancePack": {
    "Status": "ACTIVE",
    "CompliancePackId": "cp-a8a8626622af0082****",
    "RiskLevel": 1,
    "Description": "",
    "ConfigRules": [
      {
        "ManagedRuleIdentifier": "eip-bandwidth-limit",
        "ConfigRuleName": "",
        "ConfigRuleId": "cr-a260626622af0005****",
        "ConfigRuleParameters": [
          {
            "Required": true,
            "ParameterName": "bandwidth",
            "ParameterValue": "10"
          }
        ],
        "Description": "",
        "RiskLevel": 1,
        "ResourceTypesScope": "ACS::EIP::EipAddress"
      }
    ],
    "TemplateContent": "",
    "CompliancePackName": "",
    "AccountId": 0,
    "CompliancePackTemplateId": "ct-5f26ff4e06a300c4****",
    "CreateTimestamp": 1624245766000,
    "Scope": {
      "ExcludeRegionIdsScope": "",
      "ResourceIdsScope": "",
      "ExcludeResourceGroupIdsScope": "",
      "TagKeyScope": "ECS",
      "TagsScope": [
        {
          "TagKey": "",
          "TagValue": ""
        }
      ],
      "ExcludeTagsScope": [
        {
          "TagKey": "",
          "TagValue": ""
        }
      ],
      "TagValueScope": "test",
      "RegionIdsScope": "cn-hangzhou",
      "ExcludeResourceIdsScope": "eip-8vbf3x310fn56ijfd****",
      "ResourceGroupIdsScope": "rg-aekzc7r7rhx****"
    }
  }
}

Error codes

HTTP status codeError codeError messageDescription
400Invalid.CompliancePackId.ValueThe specified CompliancePackId does not exist.The specified compliance pack ID does not exist.
404AccountNotExistedYour account does not exist.The specified account does not exist.
503ServiceUnavailableThe request has failed due to a temporary failure of the server.The request has failed due to a temporary failure of the server.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-12-13The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 404
    delete Error Codes: 503
Output ParametersThe response structure of the API has changed.
2023-06-12API Description Update. The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 404
    delete Error Codes: 503
Output ParametersThe response structure of the API has changed.