Creates a compliance pack for a specified account group.
Operation description
A compliance pack is a collection of rules. When you create a compliance pack, you can select default rules from a compliance pack template. You can also select rules from rule templates and the list of existing rules.
After a compliance pack is created, its rules are evaluated once by default. Subsequent evaluations are automatically triggered based on the trigger mechanism of the rules. You can also manually trigger an evaluation.
A compliance pack template is a collection of rules created by CloudConfig for a specific compliance scenario.
This topic provides an example of how to create a compliance pack for the account group ca-f632626622af0079**** using the compliance pack template ClassifiedProtectionPreCheck (Classified Protection Level 3 Pre-check).
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
config:CreateAggregateCompliancePack |
create |
*AggregateCompliancePack
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| CompliancePackTemplateId |
string |
No |
The ID of the compliance pack template. For more information about how to obtain the ID of a compliance pack template, see ListCompliancePackTemplates. |
ct-5f26ff4e06a300c4**** |
| CompliancePackName |
string |
Yes |
The name of the compliance pack. |
等保三级预检合规包 |
| Description |
string |
No |
The description of the compliance pack. |
基于等保三级的部分要求,对阿里云上资源的合规性做检测。 |
| RiskLevel |
integer |
No |
The risk level of the compliance pack. Valid values:
|
2 |
| AggregatorId |
string |
Yes |
The ID of the account group. For more information about how to obtain the ID of an account group, see ListAggregators. |
ca-f632626622af0079**** |
| ConfigRules |
array<object> |
No |
The rules in the compliance pack. Note
Specify either this parameter or |
|
|
array<object> |
No |
None |
||
| ManagedRuleIdentifier |
string |
No |
The identifier of the rule template. CloudConfig automatically creates a rule based on the rule template identifier and adds the rule to the compliance pack. Specify either |
eip-bandwidth-limit |
| ConfigRuleName |
string |
No |
The name of the rule. |
弹性IP实例带宽满足最低要求 |
| ConfigRuleParameters |
array<object> |
No |
The parameters of the rule. |
|
|
object |
No |
None |
||
| ParameterName |
string |
No |
The name of the rule parameter. Specify both |
bandwidth |
| ParameterValue |
string |
No |
The value of the rule parameter. Specify both |
10 |
| ConfigRuleId |
string |
No |
The rule ID. CloudConfig adds an existing rule to the compliance pack. Specify either |
cr-e918626622af000f**** |
| Description |
string |
No |
The description of the rule. |
弹性公网已绑定到ECS或者NAT实例,非闲置状态,视为“合规”。 |
| RiskLevel |
integer |
No |
The risk level of the rule. Valid values:
|
1 |
| TemplateContent |
string |
No |
The template information that is used to generate the compliance pack. You can view the template content in the details of an existing compliance pack or create a template. For more information, see Create a configurable compliance pack template. Note
Specify either this parameter or |
{ "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" } } ] } |
| ClientToken |
string |
No |
A client token. It is used to ensure the idempotence of the request. Generate a value from your client to make sure that the value is unique among different requests. |
1594295238-f9361358-5843-4294-8d30-b5183fac**** |
| DefaultEnable |
boolean |
No |
Indicates whether the rule is enabled for quick activation. Valid values:
|
false |
| RegionIdsScope |
string |
No |
The compliance pack takes effect only for resources in the specified regions. Separate multiple region IDs with commas (,). |
cn-hangzhou |
| ExcludeRegionIdsScope |
string |
No |
The compliance pack does not take effect for resources in the specified regions. The resources in these regions are not evaluated. Separate multiple region IDs with commas (,). |
cn-shanghai |
| ExcludeResourceIdsScope |
string |
No |
The compliance pack does not take effect for the specified resources. The resources are not evaluated. Separate multiple resource IDs with commas (,). |
eip-8vbf3x310fn56ijfd**** |
| ResourceIdsScope |
string |
No |
The compliance pack takes effect only for the specified resources. Separate multiple resource IDs with commas (,). |
lb-5cmbowstbkss9ta03**** |
| ResourceGroupIdsScope |
string |
No |
The compliance pack takes effect only for resources in the specified resource groups. Separate multiple resource group IDs with commas (,). |
rg-aekzc7r7rhx**** |
| ExcludeResourceGroupIdsScope |
string |
No |
The compliance pack does not take effect for resources in the specified resource groups. The resources in these resource groups are not evaluated. Separate multiple resource group IDs with commas (,). |
rg-bnczc6r7rml**** |
| TagKeyScope |
string |
No |
The compliance pack takes effect only for resources that have the specified tag key. |
ECS |
| TagValueScope |
string |
No |
The compliance pack takes effect only for resources that have the specified tag key-value pair. Note
TagValueScope must be used with TagKeyScope. |
test |
| TagsScope |
array<object> |
No |
The effective tags. |
|
|
object |
No |
|||
| TagKey |
string |
No |
The tag key of the resource. |
tagKey1 |
| TagValue |
string |
No |
The tag value of the resource. |
tagValue1 |
| ExcludeTagsScope |
array<object> |
No |
The excluded tags. |
|
|
object |
No |
The scope of excluded tags. |
||
| TagKey |
string |
No |
The tag key of the resource. |
4 |
| TagValue |
string |
No |
The tag value of the resource. |
user |
| Tag |
array<object> |
No |
The tags of the resource. You can add up to 20 tags. |
|
|
object |
No |
The tags of the resource. You can add up to 20 tags. |
||
| Key |
string |
No |
The tag key of the resource. You can add up to 20 tag keys. |
key-1 |
| Value |
string |
No |
The tag value of the resource. You can add up to 20 tag values. |
value-1 |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
None |
||
| CompliancePackId |
string |
The ID of the compliance pack. |
cp-fc56626622af00f9**** |
| RequestId |
string |
The request ID. |
CC0CE5EB-E51E-48EB-B4AB-9A9E131ECC0F |
Examples
Success response
JSON format
{
"CompliancePackId": "cp-fc56626622af00f9****",
"RequestId": "CC0CE5EB-E51E-48EB-B4AB-9A9E131ECC0F"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | CompliancePackExists | The compliance pack already exists. | The compliance pack name already exists. |
| 400 | Invalid.AggregatorId.Value | The specified AggregatorId is invalid. | The specified aggregator ID does not exist or you are not authorized to use the aggregator. |
| 400 | CompliancePackExceedMaxCount | The maximum number of compliance pack is exceeded. | |
| 400 | Invalid.CompliancePackName.Value | The specified CompliancePackName is invalid. | The specified compliance pack name is invalid. |
| 400 | Invalid.CompliancePackTemplateId.Value | The specified CompliancePackTemplateId does not exist. | The specified compliance pack template ID does not exist. |
| 400 | Invalid.ConfigRules.Empty | You must specify ConfigRules. | |
| 400 | Invalid.ConfigRules.Value | The specified ConfigRules is invalid. | The specified ConfigRules is invalid. |
| 400 | ConfigRuleExceedMaxRuleCount | The maximum number of config rules is exceeded. | |
| 403 | AggregatorMemberNoPermission | The aggregator member is not authorized to perform the operation. | The aggregator member is not authorized to perform the operation. |
| 404 | AccountNotExisted | Your account does not exist. | |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | The request has failed due to a temporary failure of the server. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.