通过本文您可以了解配置审计的资源配置变更历史投递到日志服务SLS的内容示例和主要参数说明。
内容示例
创建资源、修改资源和删除资源的配置变更历史投递到日志服务SLS的内容示例如下:
创建资源
在单账号模式下,阿里云账号
110803419679****
在云服务器ECS的呼和浩特地域创建云盘test_disk
,在configurationDiff
中显示云盘的变更前信息null
和变更后详细信息,在relationship
和relationshipDiff
中显示云盘新增相关资源i-8psdh7l6lphbn10l****
。accountId:110803419679**** availabilityZone:cn-huhehaote-a captureTime:1642411308000 configuration:{"DetachedTime":"","Category":"cloud_efficiency","KMSKeyId":"","Description":"","ResourceGroupId":"rg-aekzmdckngg****","Size":40,"Encrypted":false,"DeleteAutoSnapshot":false,"DiskChargeType":"PrePaid","Attachments":{"Attachment":[{"AttachedTime":"2022-01-17T09:20:14Z","InstanceId":"i-8psdh7l6lphbn10l****","Device":"/dev/xvda"}]},"MultiAttach":"Disabled","ExpiredTime":"2022-02-17T16:00Z","ImageId":"win2012r2_9600_x64_dtc_en-us_40G_alibase_20211217.vhd","StorageSetId":"","Tags":{"Tag":[]},"Status":"In_use","AttachedTime":"2022-01-17T09:20:14Z","StorageClusterId":"","ZoneId":"cn-huhehaote-a","InstanceId":"i-8psdh7l6lphbn10l****","ProductCode":"","SourceSnapshotId":"","Device":"/dev/xvda","PerformanceLevel":"","DeleteWithInstance":true,"EnableAutomatedSnapshotPolicy":false,"EnableAutoSnapshot":true,"AutoSnapshotPolicyId":"","DiskName":"","test_disk":"","OperationLocks":{"OperationLock":[]},"Portable":true,"Type":"system","SerialNumber":"8psdh7l6lphbn10i****","CreationTime":"2022-01-17T09:20:10Z","RegionId":"cn-huhehaote","DiskId":"d-8psdh7l6lphbn10i****"} configurationDiff:{"Category":[null,"cloud_efficiency"],"ResourceGroupId":[null,"rg-aekzmdckngg****"],"Size":[null,40],"Encrypted":[null,false],"DeleteAutoSnapshot":[null,false],"DiskChargeType":[null,"PrePaid"],"Attachments":[null,{"Attachment":[{"AttachedTime":"2022-01-17T09:20:14Z","InstanceId":"i-8psdh7l6lphbn10l****","Device":"/dev/xvda"}]}],"MultiAttach":[null,"Disabled"],"ExpiredTime":[null,"2022-02-17T16:00Z"],"ImageId":[null,"win2012r2_9600_x64_dtc_en-us_40G_alibase_20211217.vhd"],"Tags":[null,{"Tag":[]}],"Status":[null,"In_use"],"AttachedTime":[null,"2022-01-17T09:20:14Z"],"ZoneId":[null,"cn-huhehaote-a"],"InstanceId":[null,"i-8psdh7l6lphbn10l****"],"Device":[null,"/dev/xvda"],"DeleteWithInstance":[null,true],"EnableAutomatedSnapshotPolicy":[null,false],"EnableAutoSnapshot":[null,true],"OperationLocks":[null,{"OperationLock":[]}],"Portable":[null,true],"Type":[null,"system"],"SerialNumber":[null,"8psdh7l6lphbn10i****"],"CreationTime":[null,"2022-01-17T09:20:10Z"],"RegionId":[null,"cn-huhehaote"],"DiskId":[null,"d-8psdh7l6lphbn10i****"]} dataType:ConfigurationItemChangeNotification regionId:cn-huhehaote relationship:[{"regionId":"cn-huhehaote","relationType":"IsAttachedTo","resourceId":"i-8psdh7l6lphbn10l****","resourceType":"ACS::ECS::Instance"}] relationshipDiff:{"relationship_diff":{"relationship_add":[{"regionId":"cn-huhehaote","relationType":"IsAttachedTo","resourceId":"i-8psdh7l6lphbn10l****","resourceType":"ACS::ECS::Instance"}],"relationship_delete":[]}} requestId:be30368b-71dd-4367-9871-d00e565f8679 resourceCreateTime:1642411210000 resourceEventType:DISCOVERED resourceGroupId:rg-aekzmdckngg**** resourceId:d-8psdh7l6lphbn10i**** resourceName:test_disk resourceStatus:In_use resourceType:ACS::ECS::Disk tags:{}
修改资源
在单账号模式下,阿里云账号
118239008140****
在云服务器ECS的杭州地域为云盘test_disk
关联标签key1
,在configurationDiff
中显示云盘的标签变更前信息null
和变更后信息key1
,在relationship
和relationshipDiff
中显示云盘删除相关资源i-bp1g9rukkdar0dro****
。accountId:118239008140**** availabilityZone:cn-hangzhou-i captureTime:1630422042000 configuration:{"DetachedTime":"2022-01-17T09:27:40Z","Category":"cloud_efficiency","KMSKeyId":"","Description":"","ResourceGroupId":"","Size":20,"Encrypted":false,"DeleteAutoSnapshot":true,"DiskChargeType":"PostPaid","MultiAttach":"Disabled","ExpiredTime":"2999-09-08T16:00Z","ImageId":"","StorageSetId":"","Tags":{"Tag":[{"TagKey":"key1","TagValue":""}]},"Status":"Available","AttachedTime":"2022-01-17T09:02:01Z","StorageClusterId":"","ZoneId":"cn-hangzhou-i","InstanceId":"","ProductCode":"","SourceSnapshotId":"","Device":"","PerformanceLevel":"","DeleteWithInstance":false,"EnableAutomatedSnapshotPolicy":false,"EnableAutoSnapshot":true,"AutoSnapshotPolicyId":"","DiskName":"test_disk","BdfId":"","OperationLocks":{"OperationLock":[]},"Portable":true,"Type":"data","SerialNumber":"bp1fybs4hwesp8kv****","CreationTime":"2021-08-19T09:11:48Z","RegionId":"cn-hangzhou","DiskId":"d-bp1fybs4hwesp8kv****"} configurationDiff:{"Tags":[{"Tag":[]},{"Tag":[{"TagKey":"key1","TagValue":""}]}]} dataType:ConfigurationItemChangeNotification regionId:cn-hangzhou relationship: relationshipDiff:{"relationship_diff":{"relationship_add":[],"relationship_delete":[{"regionId":"cn-hangzhou","relationType":"IsAttachedTo","resourceId":"i-bp1g9rukkdar0dro****","resourceType":"ACS::ECS::Instance"}]}} requestId:4f9a90a9-63bf-43bd-981d-bc15658c423e resourceCreateTime:1630422000000 resourceEventType:MODIFY resourceGroupId:rg-acfmwvtff2y*** resourceId:d-bp1fybs4hwesp8kv**** resourceName:test_disk resourceStatus:Available resourceType:ACS::ECS::Disk tags:{"key1":[""]}
删除资源
在单账号模式下,阿里云账号
120886317861****
在云服务器ECS的呼和浩特地域删除云盘test_disk
,在configurationDiff
中显示云盘变更前信息和变更后信息null
,在relationship
和relationshipDiff
中显示云盘无相关资源。accountId:120886317861**** availabilityZone:cn-huhehaote-a captureTime:1629875147000 configuration:{"DetachedTime":"","Category":"cloud_essd","KMSKeyId":"","Description":"","ResourceGroupId":"","Size":40,"Encrypted":false,"DeleteAutoSnapshot":false,"DiskChargeType":"PostPaid","MultiAttach":"Disabled","ExpiredTime":"2999-09-08T16:00Z","ImageId":"","StorageSetId":"","Tags":{"Tag":[]},"Status":"Available","AttachedTime":"","StorageClusterId":"","ZoneId":"cn-huhehaote-a","InstanceId":"","ProductCode":"","SourceSnapshotId":"","Device":"","PerformanceLevel":"PL1","DeleteWithInstance":false,"EnableAutomatedSnapshotPolicy":false,"EnableAutoSnapshot":true,"AutoSnapshotPolicyId":"","DiskName":"test_disk","BdfId":"","OperationLocks":{"OperationLock":[]},"Portable":true,"Type":"data","SerialNumber":"hp33mwzuof9qoa22****","CreationTime":"2021-08-25T06:52:35Z","RegionId":"cn-huhehaote","DiskId":"d-hp33mwzuof9qoa22****"} configurationDiff:{"Status":["Available",null],"Category":["cloud_essd",null],"ZoneId":["cn-huhehaote-a",null],"Size":[40,null],"Encrypted":[false,null],"PerformanceLevel":["PL1",null],"DeleteAutoSnapshot":[false,null],"DeleteWithInstance":[false,null],"EnableAutomatedSnapshotPolicy":[false,null],"DiskChargeType":["PostPaid",null],"EnableAutoSnapshot":[true,null],"DiskName":["test_disk",null],"MultiAttach":["Disabled",null],"OperationLocks":[{"OperationLock":[]},null],"Portable":[true,null],"Type":["data",null],"SerialNumber":["hp33mwzuof9qoa22ic6q",null],"ExpiredTime":["2999-09-08T16:00Z",null],"CreationTime":["2021-08-25T06:52:35Z",null],"RegionId":["cn-huhehaote",null],"Tags":[{"Tag":[]},null],"DiskId":["d-hp33mwzuof9qoa22****",null]} dataType:ConfigurationItemChangeNotification regionId:cn-huhehaote relationship: relationshipDiff:{"relationship_diff":{"relationship_add":[],"relationship_delete":[]}} requestId:d9bca2bc-75ba-4e4c-92dd-7cc38e779806 resourceCreateTime:1629874355000 resourceEventType:REMOVE resourceGroupId:rg-acfmw3ty5y7**** resourceId:d-hp33mwzuof9qoa22**** resourceName:test_disk resourceStatus:Available resourceType:ACS::ECS::Disk tags:{}
参数说明
资源配置变更历史投递到日志服务SLS的主要参数说明如下表所示。
参数 | 说明 |
accountId | 资源归属的账号ID。配置审计支持如下账号类型:
|
availabilityZone | 资源可用区。 |
captureTime | 配置审计发现资源配置变更并生成日志的时间戳。 |
configuration | 资源的详细配置。 |
configurationDiff | 资源配置变更的具体变更项及变更前后信息。 |
dataType | 日志服务SLS的接收内容。取值:
|
regionId | 资源所在地域ID。 |
relationship | 相关资源的详细信息,包括相关资源所在地域ID、资源关系、资源ID和资源类型。根据资源是否有相关资源,该参数显示如下:
|
relationshipDiff | 相关资源的变更项。 |
resourceCreateTime | 创建资源的时间戳。 |
resourceEventType | 资源变更事件的类型。取值:
|
resourceGroupId | 资源归属的资源组ID。根据资源类型是否支持资源组,该参数显示如下:
|
resourceId | 资源ID。 |
resourceName | 资源名称。 |
resourceStatus | 资源状态。资源的状态取决于各云服务对资源的定义,该参数可能为空。例如:
|
resourceType | 资源类型。关于支持配置审计的资源类型,请参见配置审计支持的资源类型和资源关系。 |
tags | 资源标签。 |