通过设置监控范围,您可以指定配置审计可以监控的资源类型。当配置审计发现资源类型有资源的新增、删除和配置更改时,可及时向您发送通知。

新增资源

新增资源的主要参数说明如下表所示。
参数 说明
"eventName": "ResourceAdd" 资源新增事件的名称。
"changeType": "DISCOVERED" 资源的新增在配置审计中相当于新资源被发现。
"eventType": "ResourceChange" 资源的新增、删除、修改事件类型为资源变更事件。
"configurationItem" 新增资源的详细配置,具体字段含义可根据对应云产品资源的查询接口参数来对照查看。

示例:

{
    "eventName": "ResourceAdd",
    "configurationItemDiff": {
        "changedProperties": {

        },
        "changeType": "DISCOVERED"
    },
    "eventType": "ResourceChange",
    "notificationCreationTime": 1582081736257,
    "configurationItem": {
        "accountId": 120886317861****,
        "resourceCreateTime": 1582081735563,
        "resourceId": "eni-wz94bjlwo3t4r3r9****",
        "regionId": "cn-shenzhen",
        "configuration": {
            "ResourceGroupId": "",
            "Memory": 2048,
            "InstanceChargeType": "PostPaid",
            "Cpu": 1,
            "OSName": "CentOS  7.6 64位",
            "InstanceNetworkType": "vpc",
            "InnerIpAddress": {
                "IpAddress": [

                ]
            },
            "ExpiredTime": "2099-12-31T15:59Z",
            "ImageId": "m-uf66zpmsydbupufj****",
            "EipAddress": {
                "AllocationId": "",
                "IpAddress": "",
                "InternetChargeType": ""
            },
            "VlanId": "",
            "HostName": "iZuf6dmgl1ay3ktkws5****",
            "Tags": {
                "Tag": [
                    {
                        "TagKey": "type",
                        "TagValue": "pool-instance"
                    },
                    {
                        "TagKey": "uid",
                        "TagValue": "136015022107****"
                    }
                ]
            },
            "Status": "Running",
            "InstanceId": "i-uf6dmgl1ay3ktkws****",
            "StoppedMode": "Not-applicable",
            "CpuOptions": {
                "ThreadsPerCore": 1,
                "Numa": "",
                "CoreCount": 1
            },
            "StartTime": "2020-02-12T15:18Z",
            "DeletionProtection": false,
            "SecurityGroupIds": {
                "SecurityGroupId": [
                    "sg-uf6gi47biq3zb5rl****"
                ]
            },
            "VpcAttributes": {
                "PrivateIpAddress": {
                    "IpAddress": [
                        "10.*.*.*"
                    ]
                },
                "VpcId": "vpc-uf66oesmrqge1t2gs****",
                "VSwitchId": "vsw-uf684d21r7vlt38ao****",
                "NatIpAddress": ""
            },
            "InternetChargeType": "PayByTraffic",
            "InstanceName": "pool-instance",
            "DeploymentSetId": "",
            "InternetMaxBandwidthOut": 0,
            "SerialNumber": "be299046-a5f5-4c31-a2f7-7725207b****",
            "OSType": "linux",
            "CreationTime": "2020-02-12T15:18Z",
            "AutoReleaseTime": "",
            "Description": "",
            "InstanceTypeFamily": "ecs.t5",
            "DedicatedInstanceAttribute": {
                "Tenancy": "",
                "Affinity": ""
            },
            "PublicIpAddress": {
                "IpAddress": [

                ]
            },
            "GPUSpec": "",
            "NetworkInterfaces": {
                "NetworkInterface": [
                    {
                        "PrimaryIpAddress": "10.*.*.*",
                        "MacAddress": "00:**:**:**:**:**",
                        "NetworkInterfaceId": "eni-uf69nj83nf48ayso****"
                    }
                ]
            },
            "SpotPriceLimit": 0.0,
            "DeviceAvailable": true,
            "SaleCycle": "",
            "InstanceType": "ecs.t5-lc1m2.small",
            "SpotStrategy": "NoSpot",
            "OSNameEn": "CentOS  7.6 64 bit",
            "KeyPairName": "cloudshell-proxy",
            "IoOptimized": true,
            "ZoneId": "cn-shanghai-f",
            "ClusterId": "",
            "EcsCapacityReservationAttr": {
                "CapacityReservationPreference": "",
                "CapacityReservationId": ""
            },
            "DedicatedHostAttribute": {
                "DedicatedHostId": "",
                "DedicatedHostName": ""
            },
            "GPUAmount": 0,
            "OperationLocks": {
                "LockReason": [

                ]
            },
            "InternetMaxBandwidthIn": -1,
            "Recyclable": false,
            "RegionId": "cn-shanghai",
            "CreditSpecification": "Standard"
        },
        "captureTime": 1582081735563,
        "arn": "acs:ecs:cn-shenzhen:136029256909****:eni/eni-wz94bjlwo3t4r3r9****",
        "availabilityZone": "cn-shenzhen-e",
        "resourceType": "ACS::ECS::NetworkInterface",
        "tags": {
            "ethId": [
                "3"
            ],
            "cmdb-b1name": [
                "**容器平台"
            ],
            "cmdb-b1id": [
                "00000003****"
            ],
            "cmdb-b2id": [
                "00000003752900****"
            ],
            "cmdb-b3id": [
                "00000003752900004000****"
            ],
            "cmdb-b3name": [
                "k8sworker[****]"
            ],
            "cmdb-b2name": [
                "****集群"
            ]
        }
    }
}

删除资源

删除资源的主要参数说明如下表所示。
参数 说明
"eventName": "ResourceDelete" 资源删除事件的名称。
"changeType": "REMOVE" 资源的删除在配置审计中相当于资源被移除。
"eventType": "ResourceChange" 资源的新增、删除、修改事件类型为资源变更事件。
"configurationItem" 被删除资源的最后一个配置快照详情,具体字段含义可根据对应云产品资源的查询接口参数来对照查看。

示例:

{
    "eventName": "ResourceDelete",
    "configurationItemDiff": {
        "changedProperties": {

        },
        "changeType": "REMOVE"
    },
    "eventType": "ResourceChange",
    "notificationCreationTime": 1582081938705,
    "configurationItem": {
        "accountId": 120886317861****,
        "resourceCreateTime": 1582081938054,
        "resourceId": "eni-wz94bjlwo3t4r3r9****",
        "regionId": "cn-shenzhen",
        "configuration": {
            "ResourceGroupId": "rg-acfmzincesj****",
            "Address": "**.**.**.***",
            "ListenerPortsAndProtocal": {
                "ListenerPortAndProtocal": [
                    {
                        "ListenerPort": 443,
                        "ListenerProtocal": "tcp"
                    },
                    {
                        "ListenerPort": 80,
                        "ListenerProtocal": "tcp"
                    }
                ]
            },
            "EndTime": "2999-09-08T16:00:00Z",
            "SupportPrivateLink": false,
            "AddressIPVersion": "ipv4",
            "LoadBalancerId": "lb-2zejkpx1ks0jjf52g****",
            "ListenerPortsAndProtocol": {
                "ListenerPortAndProtocol": [
                    {
                        "ListenerPort": 443,
                        "Description": "k8s/443/phabricator/gitlab/clusterid",
                        "ListenerProtocol": "tcp"
                    },
                    {
                        "ListenerPort": 80,
                        "Description": "k8s/80/phabricator/gitlab/clusterid",
                        "ListenerProtocol": "tcp"
                    }
                ]
            },
            "BackendServers": {
                "BackendServer": [

                ]
            },
            "HasReservedInfo": "false",
            "LoadBalancerSpec": "slb.s1.small",
            "NetworkType": "classic",
            "Bandwidth": 5120,
            "Tags": {
                "Tag": [
                    {
                        "TagKey": "kubernetes.do.not.delete",
                        "TagValue": "ac000203c4d6711ea8cc12e38c2f****"
                    }
                ]
            },
            "MasterZoneId": "cn-beijing-f",
            "ListenerPorts": {
                "ListenerPort": [
                    443,
                    80
                ]
            },
            "VSwitchId": "",
            "CreateTime": "2020-02-12T07:17:41Z",
            "PayType": "PayOnDemand",
            "SlaveZoneId": "cn-beijing-g",
            "InternetChargeType": "paybytraffic",
            "RegionIdAlias": "cn-beijing",
            "LoadBalancerName": "ac000203c4d6711ea8cc12e38c2f****",
            "VpcId": "",
            "DeleteProtection": "off",
            "EndTimeStamp": 32493801600000,
            "RegionId": "cn-beijing",
            "AddressType": "internet",
            "LoadBalancerStatus": "active",
            "CreateTimeStamp": 1581491861000
        },
        "captureTime": 1582081938054,
        "arn": "acs:ecs:cn-shenzhen:136029256909****:eni/eni-wz94bjlwo3t4r3r9****",
        "availabilityZone": "cn-shenzhen-e",
        "resourceType": "ACS::ECS::NetworkInterface",
        "tags": {
            "ethId": [
                "3"
            ],
            "cmdb-b1name": [
                "**容器平台"
            ],
            "cmdb-b1id": [
                "00000003****"
            ],
            "cmdb-b2id": [
                "00000003752900****"
            ],
            "cmdb-b3id": [
                "00000003752900004000****"
            ],
            "cmdb-b3name": [
                "k8sworker[****]"
            ],
            "cmdb-b2name": [
                "****集群"
            ]
        }
    }
}

更新资源

更新资源的主要参数说明如下表所示。
参数 说明
"eventName": "ResourceUpdate" 资源配置更改事件的名称。
"changeType": "MODIFY" 资源配置更改在配置审计相当于资源配置变更。
"eventType": "ResourceChange" 资源新增、删除、修改的事件类型为资源变更事件。
"configurationItemDiff" 资源具体发生变更的参数,变更前后的配置详情。
"configurationItem" 发生配置更改资源的详细配置,具体字段含义可根据对应云产品资源的查询接口参数来对照查看。

示例:

{
    "eventName": "ResourceUpdate",
    "configurationItemDiff": {
        "changedProperties": {
            "PrivateIpSets": {
                "changeType": "MODIFY",
                "previousValue": {
                    "PrivateIpSet": [
                        {
                            "PrivateIpAddress": "**.***.***.***",
                            "AssociatedPublicIp": {

                            },
                            "Primary": true
                        },
                        {
                            "PrivateIpAddress": "**.***.***.**",
                            "AssociatedPublicIp": {

                            },
                            "Primary": false
                        }
                    ]
                },
                "updatedValue": {
                    "PrivateIpSet": [
                        {
                            "PrivateIpAddress": "**.***.***.***",
                            "AssociatedPublicIp": {

                            },
                            "Primary": true
                        },
                        {
                            "PrivateIpAddress": "**.***.***.***",
                            "AssociatedPublicIp": {

                            },
                            "Primary": false
                        },
                        {
                            "PrivateIpAddress": "**.***.***.***",
                            "AssociatedPublicIp": {

                            },
                            "Primary": false
                        }
                    ]
                }
            }
        },
        "changeType": "MODIFY"
    },
    "eventType": "ResourceChange",
    "notificationCreationTime": 1582082211443,
    "configurationItem": {
        "accountId": 120886317861****,
        "resourceCreateTime": 1582082210805,
        "resourceId": "eni-wz94bjlwo3t4r3r9****",
        "regionId": "cn-shenzhen",
        "configuration": {
            "Status": "InUse",
            "PrivateIpAddress": "**.***.***.***",
            "ResourceGroupId": "",
            "ZoneId": "cn-shenzhen-e",
            "InstanceId": "i-wz94bjlwo3t4r1sd****",
            "VSwitchId": "vsw-wz9y5beofg6803ia4****",
            "NetworkInterfaceId": "eni-wz94bjlwo3t4r3r9****",
            "MacAddress": "00:**:**:**:**:**",
            "SecurityGroupIds": {
                "SecurityGroupId": [
                    "sg-wz96y70qwfbchy8h****"
                ]
            },
            "Type": "Secondary",
            "Ipv6Sets": {
                "Ipv6Set": [

                ]
            },
            "VpcId": "vpc-wz9galbyy5v85xkkd****",
            "AssociatedPublicIp": {

            },
            "CreationTime": "2020-01-15T04:32:55Z",
            "Tags": {
                "Tag": [
                    {
                        "TagKey": "cmdb-b1id",
                        "TagValue": "00000003****"
                    },
                    {
                        "TagKey": "cmdb-b1name",
                        "TagValue": "**容器平台"
                    },
                    {
                        "TagKey": "cmdb-b2id",
                        "TagValue": "00000003752900****"
                    },
                    {
                        "TagKey": "cmdb-b2name",
                        "TagValue": "****集群"
                    },
                    {
                        "TagKey": "cmdb-b3id",
                        "TagValue": "00000003752900004000****"
                    },
                    {
                        "TagKey": "cmdb-b3name",
                        "TagValue": "k8sworker[****]"
                    },
                    {
                        "TagKey": "ethId",
                        "TagValue": "3"
                    }
                ]
            },
            "PrivateIpSets": {
                "PrivateIpSet": [
                    {
                        "PrivateIpAddress": "**.***.***.***",
                        "AssociatedPublicIp": {

                        },
                        "Primary": true
                    },
                    {
                        "PrivateIpAddress": "**.***.***.**",
                        "AssociatedPublicIp": {

                        },
                        "Primary": false
                    },
                    {
                        "PrivateIpAddress": "**.***.***.**",
                        "AssociatedPublicIp": {

                        },
                        "Primary": false
                    }
                ]
            }
        },
        "captureTime": 1582082210805,
        "arn": "acs:ecs:cn-shenzhen:136029256909****:eni/eni-wz94bjlwo3t4r3r9****",
        "availabilityZone": "cn-shenzhen-e",
        "resourceType": "ACS::ECS::NetworkInterface",
        "tags": {
            "ethId": [
                "3"
            ],
            "cmdb-b1name": [
                "**容器平台"
            ],
            "cmdb-b1id": [
                "00000003****"
            ],
            "cmdb-b2id": [
                "00000003752900****"
            ],
            "cmdb-b3id": [
                "00000003752900004000****"
            ],
            "cmdb-b3name": [
                "k8sworker[****]"
            ],
            "cmdb-b2name": [
                "****集群"
            ]
        }
    }
}