This topic describes the Container Registry events that can be recorded by ActionTrail and published to EventBridge.

Events

The following table describes the Container Registry events that can be published to EventBridge.

EventValue of the type parameter
An image is builtcr:Artifact:BuildCompleted
A delivery chain is executedcr:Artifact:DeliveryChainCompleted
An image is scannedcr:Artifact:ScanCompleted
An image is signedcr:Artifact:SigningCompleted
An image is synchronizedcr:Artifact:SynchronizationCompleted
An operation is performed on a resourcecr:ActionTrail:AliyunServiceEvent
An API operation is calledcr:ActionTrail:ApiCall
An operation is performed in the consolecr:ActionTrail:ConsoleOperation

For more information about the parameters defined in the CloudEvents specification, see Overview.

An image is built

The following example shows the event that EventBridge receives when an image is built:

{
    "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
    "source": "acs.cr",
    "specversion": "1.0",
    "subject": "acs.cr:cn-hangzhou:123456789098****:215672",
    "time": "2020-11-19T21:04:41+08:00",
    "type": "cr:Artifact:BuildCompleted",
    "aliyunaccountid": "123456789098****",
    "aliyunpublishtime": "2020-11-19T21:04:42Z",
    "aliyuneventbusname": "default",
    "aliyunregionid": "cn-hangzhou",
    "aliyunpublishaddr": "172.25.XX.XX",
    "data": {
        "InstanceName": "sirong-tongbu-hangzhou",
        "RepoNamespaceName": "scan",
        "RepoBuildType": "AUTO_BUILD",
        "InstanceId": "cri-4jga79lyszik****",
        "RepoName": "mix-vuls",
        "BuildStatus": "SUCCESS",
        "ImageUpdate": "2021-11-15 20:49:40",
        "RegionId": "cn-hangzhou",
        "Tag": "mix-vuls",
        "RepoId": "crr-8441203b7uzi****"
    }

The following table describes the parameters in the data field.

ParameterTypeExampleDescription
InstanceNameStringsirong-tongbu-hangzhouThe name of the instance.
RepoNamespaceNameStringscanThe namespace to which the image repository belongs.
RepoBuildTypeStringAUTO_BUILDThe type of the image building operation.
InstanceIdStringcri-4jga79lyszik****The ID of the instance.
RepoNameStringmix-vulsThe name of the image repository.
BuildStatusStringSUCCESSThe status of the image building operation.
ImageUpdateString2021-11-15 20:49:40The time when the image was updated.
RegionIdStringcn-hangzhouThe ID of the region in which the image repository resides.
TagStringmix-vulsThe tag of the image.
RepoIdStringcrr-8441203b7uzi****The ID of the image repository.

A delivery chain is executed

The following example shows the event that EventBridge receives when a delivery chain is executed:

{
    "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
    "source": "acs.cr",
    "specversion": "1.0",
    "subject": "acs.cr:cn-hangzhou:123456789098****:215672",
    "time": "2020-11-19T21:04:41+08:00",
    "type": "cr:Artifact:DeliveryChainCompleted",
    "aliyunaccountid": "123456789098****",
    "aliyunpublishtime": "2020-11-19T21:04:42Z",
    "aliyuneventbusname": "default",
    "aliyunregionid": "cn-hangzhou",
    "aliyunpublishaddr": "172.25.XX.XX",
    "data": {
        "InstanceName": "sirong-tongbu-hangzhou",
        "RepoNamespaceName": "a1",
        "ChainInstanceId": "EF7394D6-C2B3-1A4B-9FA0-B11B41F7****",
        "EndTime": "2021-11-18 19:13:52",
        "InstanceId": "cri-4jga79lyszik****",
        "RepoName": "centos-7",
        "RegionId": "cn-hangzhou",
        "RepoId": "crr-wwgobtf1moat****",
        "Result": "SUCCESS"
    }
}

The following table describes the parameters in the data field.

ParameterTypeExampleDescription
InstanceNameStringsirong-tongbu-hangzhouThe name of the instance.
RepoNamespaceNameStringa1The namespace to which the image repository belongs.
ChainInstanceIdStringEF7394D6-C2B3-1A4B-9FA0-B11B41F7****The ID of the delivery chain execution instance.
EndTimeString2021-11-18 19:13:52The time when the delivery chain execution was finished.
InstanceIdStringcri-4jga79lyszik****The ID of the instance.
RepoNameStringcentos-7The name of the image repository.
RegionIdStringcn-hangzhouThe ID of the region in which the image repository resides.
RepoIdStringcrr-wwgobtf1moat****The ID of the image repository.
ResultStringSUCCESSThe result of the delivery chain execution.

An image is scanned

The following example shows the event that EventBridge receives when an image is scanned:

{
    "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
    "source": "acs.cr",
    "specversion": "1.0",
    "subject": "acs.cr:cn-hangzhou:123456789098****:215672",
    "time": "2020-11-19T21:04:41+08:00",
    "type": "cr:Artifact:ScanCompleted",
    "aliyunaccountid": "123456789098****",
    "aliyunpublishtime": "2020-11-19T21:04:42Z",
    "aliyuneventbusname": "default",
    "aliyunregionid": "cn-hangzhou",
    "aliyunpublishaddr": "172.25.XX.XX",
    "data": {
        "Status": "COMPLETE",
        "RepoNamespaceName": "scan",
        "EndTime": "2021-11-15 19:30:25",
        "InstanceId": "cri-4jga79lyszik****",
        "RepoName": "ruby-2.4.0",
        "HighSeverity": 950,
        "UnknownSeverity": 52,
        "TotalSeverity": 2355,
        "InstanceName": "sirong-tongbu-hangzhou",
        "LowSeverity": 35,
        "MediumSeverity": 1318,
        "RegionId": "cn-hangzhou",
        "Tag": "ruby-2.4.0",
        "RepoId": "crr-7a41mq93xymk****"
    }
}

The following table describes the parameters in the data field.

ParameterTypeExampleDescription
StatusStringCOMPLETEThe status of the image scan operation.
RepoNamespaceNameStringscanThe namespace to which the image repository belongs.
EndTimeString2021-11-15 19:30:25The time at which the image scan was finished.
InstanceIdStringcri-4jga79lyszik****The ID of the instance.
RepoNameStringruby-2.4.0The name of the image repository.
HighSeverityInt950The number of high-severity vulnerabilities.
UnknownSeverityInt52The number of unrated vulnerabilities.
TotalSeverityInt2355The total number of vulnerabilities.
InstanceNameStringsirong-tongbu-hangzhouThe name of the instance.
LowSeverityInt35The number of low-severity vulnerabilities.
MediumSeverityInt1318The number of medium-severity vulnerabilities.
RegionIdStringcn-hangzhouThe ID of the region in which the image repository resides.
TagStringruby-2.4.0The tag of the image.
RepoIdStringcrr-7a41mq93xymk****The ID of the image repository.

An image is signed

The following example shows the event that EventBridge receives when an image is signed:

{
    "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
    "source": "acs.cr",
    "specversion": "1.0",
    "subject": "acs.cr:cn-hangzhou:123456789098****:215672",
    "time": "2020-11-19T21:04:41+08:00",
    "type": "cr:Artifact:SigningCompleted",
    "aliyunaccountid": "123456789098****",
    "aliyunpublishtime": "2020-11-19T21:04:42Z",
    "aliyuneventbusname": "default",
    "aliyunregionid": "cn-hangzhou",
    "aliyunpublishaddr": "172.25.XX.XX",
    "data": {
        "InstanceName": "test-8-30",
        "RepoNamespaceName": "scan",
        "InstanceId": "cri-jhklm6d6o7cp****",
        "RepoName": "for-scan-local",
        "FailureMessage": "",
        "RegionId": "cn-hangzhou",
        "Tag": "1.0",
        "RepoId": "crr-2dk58uw7gfjw****",
        "Result": "SUCCESS"
    }
}
            

The following table describes the parameters in the data field.

ParameterTypeExampleDescription
InstanceNameStringtest-8-30The name of the instance.
RepoNamespaceNameStringscanThe namespace to which the image repository belongs.
InstanceIdStringcri-jhklm6d6o7cp****The ID of the instance.
RepoNameStringfor-scan-localThe name of the image repository.
FailureMessageStringThe failure information.
RegionIdStringcn-hangzhouThe ID of the region in which the image repository resides.
TagString1.0The tag of the image.
RepoIdStringcrr-2dk58uw7gfjw****The ID of the image repository.
ResultStringSUCCESSThe result of the image signing operation.

An image is synchronized

The following example shows the event that EventBridge receives when an image is synchronized:

{
    "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
    "source": "acs.cr",
    "specversion": "1.0",
    "subject": "acs.cr:cn-hangzhou:123456789098****:215672",
    "time": "2020-11-19T21:04:41+08:00",
    "type": "cr:Artifact:SynchronizationCompleted",
    "aliyunaccountid": "123456789098****",
    "aliyunpublishtime": "2020-11-19T21:04:42Z",
    "aliyuneventbusname": "default",
    "aliyunregionid": "cn-hangzhou",
    "aliyunpublishaddr": "172.25.XX.XX",
    "data": {
        "SyncRuleId": "crsr-goyv4w2rylmx****",
        "ImageFrom": {
            "RepoNamespaceName": "scan",
            "ImageTag": "mix-vuls",
            "InstanceId": "cri-4jga79lyszik****",
            "RepoName": "mix-vuls",
            "RegionId": "cn-hangzhou"
        },
        "EndTime": "2021-11-15 20:49:40",
        "TaskTrigger": "PASSIVE",
        "StartTime": "2021-11-15 20:49:40",
        "ImageTo": {
            "RepoNamespaceName": "scan",
            "ImageTag": "mix-vuls",
            "InstanceId": "cri-roa3mwdsq4nz****",
            "RepoName": "mix-vuls",
            "RegionId": "ap-southea****"
        },
        "SyncBatchTaskId": "9CC83523-0834-1B25-BEC2-4BE8AA18****",
        "TaskStatus": "SUCCESS",
        "SyncTaskId": "rst-uce0qfbyuaw7****"
    }
}
            

The following table describes the parameters in the data field.

ParameterTypeExampleDescription
SyncRuleIdStringcrsr-goyv4w2rylmx****The ID of the synchronization rule.
ImageFromMapThe information about the source image.
EndTimeString2021-11-15 20:49:40The time when the synchronization was finished.
TaskTriggerStringPASSIVEThe mode in which the synchronization is triggered.
StartTimeString2021-11-15 20:49:40The time when the synchronization was started.
ImageToMapThe information about the destination image.
RepoNamespaceNameStringscanThe namespace to which the image repository belongs.
ImageTagStringmix-vulsThe tag of the image.
InstanceIdStringcri-roa3mwdsq4nz****The ID of the instance.
RepoNameStringmix-vulsThe name of the image repository.
RegionIdStringap-southea****The ID of the region in which the image repository resides.
SyncBatchTaskIdString9CC83523-0834-1B25-BEC2-4BE8AA18****The ID of the synchronization batch.
TaskStatusStringSUCCESSThe result of the synchronization task.
SyncTaskIdStringrst-uce0qfbyuaw7****The ID of the synchronization task.