為指定帳號組建立合規包。
介面說明
合規包是一組規則的集合。建立合規包時,您可以選擇合規包模板中的預設規則,也可以選擇規則模板和已有規則列表中的規則。
建立合規包後,這些規則預設會執行一次評估,後續將根據規則的觸發機制自動觸發評估,也可以手動執行評估。
合規包模板是配置審計根據合規情境定製的一組規則的集合。
本文將提供一個樣本,為帳號組ca-f632626622af0079****通過合規包模板ClassifiedProtectionPreCheck(等保三級預檢合規包)建立一個合規包。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
config:CreateAggregateCompliancePack |
create |
*AggregateCompliancePack
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| CompliancePackTemplateId |
string |
否 |
合規包模板 ID。 關於如何擷取合規包模板 ID,請參見 ListCompliancePackTemplates 。 |
ct-5f26ff4e06a300c4**** |
| CompliancePackName |
string |
是 |
合規包名稱。 |
等保三級預檢合規包 |
| Description |
string |
否 |
合規包描述。 |
基於等保三級的部分要求,對阿里雲上資源的合規性做檢測。 |
| RiskLevel |
integer |
否 |
合規包風險等級。取值:
|
2 |
| AggregatorId |
string |
是 |
帳號組 ID。 關於如何擷取帳號組 ID,請參見 ListAggregators 。 |
ca-f632626622af0079**** |
| ConfigRules |
array<object> |
否 |
合規包中的規則列表。 說明
本參數和 |
|
|
array<object> |
否 |
無 |
||
| ManagedRuleIdentifier |
string |
否 |
規則模板標識。配置審計根據規則模板標識自動建立規則,並將該規則加入到當前合規包中。
|
eip-bandwidth-limit |
| ConfigRuleName |
string |
否 |
規則名稱。 |
彈性IP執行個體頻寬滿足最低要求 |
| ConfigRuleParameters |
array<object> |
否 |
規則參數資訊。 |
|
|
object |
否 |
無 |
||
| ParameterName |
string |
否 |
規則參數名稱。 參數 |
bandwidth |
| ParameterValue |
string |
否 |
規則參數值。 參數 |
10 |
| ConfigRuleId |
string |
否 |
規則 ID。配置審計將已有規則加入到當前合規包中。
|
cr-e918626622af000f**** |
| Description |
string |
否 |
規則描述。 |
彈性公網已綁定到ECS或者NAT執行個體,非閑置狀態,視為“合規”。 |
| RiskLevel |
integer |
否 |
規則風險等級。取值:
|
1 |
| TemplateContent |
string |
否 |
用於產生合規包的模板資訊。模板內容可以從已有合規包詳情 API 中查看,或者參考編寫配置化合規包模板進行編寫。 說明
本參數和 |
{ "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 |
否 |
保證請求等冪性。從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。 |
1594295238-f9361358-5843-4294-8d30-b5183fac**** |
| DefaultEnable |
boolean |
否 |
規則是否支援快速啟用。取值:
|
false |
| RegionIdsScope |
string |
否 |
合規包僅對指定地區 ID 中的資源生效。多個地區 ID 之間用半形逗號(,)分隔。 |
cn-hangzhou |
| ExcludeRegionIdsScope |
string |
否 |
合規包對指定地區內資源無效,即不對該地區內資源執行評估。多個地區 ID 之間用半形逗號(,)分隔。 |
cn-shanghai |
| ExcludeResourceIdsScope |
string |
否 |
合規包對指定資源 ID 無效,即不對該資源執行評估。多個資源 ID 之間用半形逗號(,)分隔。 |
eip-8vbf3x310fn56ijfd**** |
| ResourceIdsScope |
string |
否 |
規則對指定資源 ID 生效。多個資源 ID 之間用半形逗號(,)分隔。 |
lb-5cmbowstbkss9ta03**** |
| ResourceGroupIdsScope |
string |
否 |
合規包僅對指定資源群組 ID 中的資源生效。多個資源群組 ID 之間用半形逗號(,)分隔。 |
rg-aekzc7r7rhx**** |
| ExcludeResourceGroupIdsScope |
string |
否 |
規則對指定資源群組 ID 中的資源無效,即不對該資源群組內的資源評估。多個資源群組 ID 之間用半形逗號(,)分隔。 |
rg-bnczc6r7rml**** |
| TagKeyScope |
string |
否 |
合規包僅對綁定指定標籤鍵的資源生效。 |
ECS |
| TagValueScope |
string |
否 |
合規包僅對綁定指定標籤索引值對的資源生效。 說明
TagValueScope 需結合 TagKeyScope 一起使用。 |
test |
| TagsScope |
array<object> |
否 |
生效標籤。 |
|
|
object |
否 |
|||
| TagKey |
string |
否 |
資源的標籤鍵。 |
tagKey1 |
| TagValue |
string |
否 |
資源的標籤值。 |
tagValue1 |
| ExcludeTagsScope |
array<object> |
否 |
排除標籤。 |
|
|
object |
否 |
排除的標籤範圍 |
||
| TagKey |
string |
否 |
資源的標籤鍵。 |
4 |
| TagValue |
string |
否 |
資源的標籤值。 |
user |
| Tag |
array<object> |
否 |
資源的標籤。 最多支援綁定 20 個標籤。 |
|
|
object |
否 |
資源的標籤。 最多支援綁定 20 個標籤。 |
||
| Key |
string |
否 |
資源的標籤鍵。 最多支援綁定 20 個標籤鍵。 |
key-1 |
| Value |
string |
否 |
資源的標籤值。 最多支援綁定 20 個標籤值。 |
value-1 |
關於公用請求參數的詳情,請參見公用參數。
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
無 |
||
| CompliancePackId |
string |
合規包 ID。 |
cp-fc56626622af00f9**** |
| RequestId |
string |
請求 ID。 |
CC0CE5EB-E51E-48EB-B4AB-9A9E131ECC0F |
樣本
正常返回樣本
JSON格式
{
"CompliancePackId": "cp-fc56626622af00f9****",
"RequestId": "CC0CE5EB-E51E-48EB-B4AB-9A9E131ECC0F"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | CompliancePackExists | The compliance pack already exists. | 合規包名稱重複。 |
| 400 | Invalid.AggregatorId.Value | The specified AggregatorId is invalid. | 帳號組ID不存在或無許可權使用該帳號組。 |
| 400 | CompliancePackExceedMaxCount | The maximum number of compliance pack is exceeded. | |
| 400 | Invalid.CompliancePackName.Value | The specified CompliancePackName is invalid. | 合規包名稱格式不符合要求。 |
| 400 | Invalid.CompliancePackTemplateId.Value | The specified CompliancePackTemplateId does not exist. | 合規包模板ID不存在。 |
| 400 | Invalid.ConfigRules.Empty | You must specify ConfigRules. | |
| 400 | Invalid.ConfigRules.Value | 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. | 帳號組內的成員帳號無許可權執行此操作。 |
| 404 | AccountNotExisted | Your account does not exist. | |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | 服務不可用。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。