查詢指定帳號組內指定資源的合規檢測歷史。合規檢測歷史是資源的一組合規評估記錄,包括合規檢測歷史上的點和合規檢測歷史的內容。
介面說明
在配置審計中,每個資源都有屬於自己的合規檢測歷史。當規則被觸發評估資源時,產生合規評估記錄,持續的合規評估形成了資源的合規檢測歷史。規則引發方式包括:配置變更、周期執行和手動執行。
本文將提供一個樣本,查詢帳號組ca-5885626622af0008****內的成員帳號100931896542****的地區cn-hangzhou中資源new-bucket(儲存空間)的合規檢測歷史。返回結果顯示,資源的合規檢測歷史為1625200295276(北京時間:2021-07-02 12:31:35)和1625200228510(北京時間:2021-07-02 12:30:28)。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
config:GetAggregateResourceComplianceTimeline |
get |
*全部資源
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| ResourceType |
string |
是 |
資源類型。 關於如何擷取資源類型,請參見 ListAggregateDiscoveredResources 。 |
ACS::OSS::Bucket |
| ResourceId |
string |
是 |
資源 ID。 關於如何擷取資源 ID,請參見 ListAggregateDiscoveredResources 。 |
new-bucket |
| StartTime |
integer |
否 |
開始時間戳。預設查詢發起調用前 30 天的時間。單位:毫秒。 |
1623211156000 |
| EndTime |
integer |
否 |
結束時間戳記。預設查詢發起調用時的時間。單位:毫秒。 |
1625821156000 |
| MaxResults |
integer |
否 |
單次請求返回結果的最大條數。取值範圍:1~100。 |
10 |
| AggregatorId |
string |
是 |
帳號組 ID。 關於如何擷取帳號組 ID,請參見 ListAggregators 。 |
ca-5885626622af0008**** |
| Region |
string |
是 |
資源歸屬的地區 ID。 關於如何擷取資源歸屬的地區 ID,請參見 ListAggregateDiscoveredResources 。 |
cn-hangzhou |
| NextToken |
string |
否 |
當請求的返回結果被截斷時,您可以使用 |
5OVS5J4I1/UKTkHV5oNs**** |
| ResourceAccountId |
integer |
否 |
帳號組內待查詢資源所屬的阿里雲帳號 ID。 說明
參數 ResourceAccountId 和 ResourceOwnerId 必須設定其中一個,推薦使用本參數。 |
100931896542**** |
關於公用請求參數的詳情,請參見公用參數。
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
無。 |
||
| RequestId |
string |
請求 ID。 |
8D53A78F-1EB8-4264-A554-72F07E34FAE6 |
| ResourceComplianceTimeline |
object |
資源合規檢測歷史。 |
|
| NextToken |
string |
查詢下一頁使用的 Token。 |
5OVS5J4I1/UKTkHV5oNs**** |
| MaxResults |
integer |
單次請求返回結果的最大條數。 |
10 |
| ComplianceList |
array<object> |
資源合規檢測歷史列表。 |
|
|
object |
無。 |
||
| Tags |
string |
資源標籤。 |
{\"\"hc\"\":[\"\"value2\"\"]} |
| AccountId |
string |
資源歸屬的阿里雲帳號 ID。 |
100931896542**** |
| AvailabilityZone |
string |
資源可用性區域。 |
cn-hangzhou-f |
| ResourceType |
string |
資源類型。 |
ACS::OSS::Bucket |
| ResourceCreateTime |
integer |
建立資源的時間戳記。單位:毫秒。 |
1624961112000 |
| Region |
string |
資源歸屬的地區 ID。 |
cn-hangzhou |
| Configuration |
string |
資源關聯的規則列表和規則合規詳情。 |
{\"Compliance\":{\"complianceType\":\"COMPLIANT\",\"count\":1},\"ConfigRuleList\":[{\"accountId\":100931896542****,\"configRuleId\":\"cr-9524626622af003d****\",\"configRuleArn\":\"acs:config::100931896542****:rule/cr-9524626622af003d****\",\"configRuleName\":\"OSS儲存空間ACL禁止公用讀寫\",\"complianceType\":\"COMPLIANT\",\"riskLevel\":1,\"annotation\":\"\",\"invokingEventMessageType\":\"ScheduledNotification\"}]} |
| CaptureTime |
integer |
記錄資源合規評估的時間戳記。單位:毫秒。 |
1625200295276 |
| ConfigurationDiff |
string |
觸發本次評估的資源變更細節。 |
{\"OSS儲存空間ACL禁止公用讀寫\":[{\"accountId\":100931896542****,\"configRuleId\":\"cr-965f626622af003d****\",\"configRuleArn\":\"acs:config::100931896542****:rule/cr-965f626622af003d****\",\"configRuleName\":\"OSS儲存空間ACL禁止公用讀寫\",\"complianceType\":\"COMPLIANT\",\"riskLevel\":1,\"annotation\":\"\",\"invokingEventMessageType\":\"ScheduledNotification\"},{}]} |
| ResourceId |
string |
資源 ID。 |
new-bucket |
| ResourceName |
string |
資源名稱。 |
new-bucket |
| ResourceStatus |
string |
資源狀態。資源狀態取決於各雲端服務對其的定義,該參數可能為空白。例如:
|
null |
樣本
正常返回樣本
JSON格式
{
"RequestId": "8D53A78F-1EB8-4264-A554-72F07E34FAE6",
"ResourceComplianceTimeline": {
"NextToken": "5OVS5J4I1/UKTkHV5oNs****",
"MaxResults": 10,
"ComplianceList": [
{
"Tags": "{\\\"\\\"hc\\\"\\\":[\\\"\\\"value2\\\"\\\"]}",
"AccountId": "100931896542****",
"AvailabilityZone": "cn-hangzhou-f",
"ResourceType": "ACS::OSS::Bucket",
"ResourceCreateTime": 1624961112000,
"Region": "cn-hangzhou",
"Configuration": "{\\\"Compliance\\\":{\\\"complianceType\\\":\\\"COMPLIANT\\\",\\\"count\\\":1},\\\"ConfigRuleList\\\":[{\\\"accountId\\\":100931896542****,\\\"configRuleId\\\":\\\"cr-9524626622af003d****\\\",\\\"configRuleArn\\\":\\\"acs:config::100931896542****:rule/cr-9524626622af003d****\\\",\\\"configRuleName\\\":\\\"OSS儲存空間ACL禁止公用讀寫\\\",\\\"complianceType\\\":\\\"COMPLIANT\\\",\\\"riskLevel\\\":1,\\\"annotation\\\":\\\"\\\",\\\"invokingEventMessageType\\\":\\\"ScheduledNotification\\\"}]}",
"CaptureTime": 1625200295276,
"ConfigurationDiff": "{\\\"OSS儲存空間ACL禁止公用讀寫\\\":[{\\\"accountId\\\":100931896542****,\\\"configRuleId\\\":\\\"cr-965f626622af003d****\\\",\\\"configRuleArn\\\":\\\"acs:config::100931896542****:rule/cr-965f626622af003d****\\\",\\\"configRuleName\\\":\\\"OSS儲存空間ACL禁止公用讀寫\\\",\\\"complianceType\\\":\\\"COMPLIANT\\\",\\\"riskLevel\\\":1,\\\"annotation\\\":\\\"\\\",\\\"invokingEventMessageType\\\":\\\"ScheduledNotification\\\"},{}]}",
"ResourceId": "new-bucket",
"ResourceName": "new-bucket",
"ResourceStatus": "null"
}
]
}
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | NoPermission | You are not authorized to perform this operation. | 您無權執行此操作。 |
| 400 | Invalid.AggregatorId.Value | The specified AggregatorId is invalid. | 帳號組ID不存在或無許可權使用該帳號組。 |
| 400 | Invalid.ResourceOwnerId.Value | The specified ResourceOwnerId is invalid. | 該帳號不存在或不在目標帳號組內。 |
| 404 | AccountNotExisted | Your account does not exist. | |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | 服務不可用。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。