This topic describes the types of Container Registry events that ActionTrail records and can be published to EventBridge.
Event types
The following table describes the types of Container Registry events that can be published to EventBridge.
Event type | Value of the type parameter |
cr:Artifact:BuildCompleted | |
cr:Artifact:DeliveryChainCompleted | |
cr:Artifact:ScanCompleted | |
cr:Artifact:SigningCompleted | |
cr:Artifact:SynchronizationCompleted | |
cr:Artifact:PushCompleted | |
An operation is performed on a resource | cr:ActionTrail:AliyunServiceEvent |
An API operation is called | cr:ActionTrail:ApiCall |
An operation is performed in the console | cr: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 contained in the data field.
Parameter | Type | Example | Description |
InstanceName | String | sirong-tongbu-hangzhou | The instance name. |
RepoNamespaceName | String | scan | The namespace to which the image repository belongs. |
RepoBuildType | String | AUTO_BUILD | The type of the image building. |
InstanceId | String | cri-4jga79lyszik**** | The instance ID. |
RepoName | String | mix-vuls | The name of the image repository. |
BuildStatus | String | SUCCESS | The status of the image building. |
ImageUpdate | String | 2021-11-15 20:49:40 | The time when the image was updated. |
RegionId | String | cn-hangzhou | The ID of the region in which the image repository resides. |
Tag | String | mix-vuls | The image tag. |
RepoId | String | crr-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 contained in the data field.
Parameter | Type | Example | Description |
InstanceName | String | sirong-tongbu-hangzhou | The instance name. |
RepoNamespaceName | String | a1 | The namespace to which the image repository belongs. |
ChainInstanceId | String | EF7394D6-C2B3-1A4B-9FA0-B11B41F7**** | The ID of the instance in which the delivery chain is executed. |
EndTime | String | 2021-11-18 19:13:52 | The time when the delivery chain execution was finished. |
InstanceId | String | cri-4jga79lyszik**** | The instance ID. |
RepoName | String | centos-7 | The name of the image repository. |
RegionId | String | cn-hangzhou | The ID of the region in which the image repository resides. |
RepoId | String | crr-wwgobtf1moat**** | The ID of the image repository. |
Result | String | SUCCESS | The 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 contained in the data field.
Parameter | Type | Example | Description |
Status | String | COMPLETE | The status of the image scan. |
RepoNamespaceName | String | scan | The namespace to which the image repository belongs. |
EndTime | String | 2021-11-15 19:30:25 | The time at which the image scan was finished. |
InstanceId | String | cri-4jga79lyszik**** | The instance ID. |
RepoName | String | ruby-2.4.0 | The name of the image repository. |
HighSeverity | Int | 950 | The number of high-severity vulnerabilities. |
UnknownSeverity | Int | 52 | The number of unrated vulnerabilities. |
TotalSeverity | Int | 2355 | The total number of vulnerabilities. |
InstanceName | String | sirong-tongbu-hangzhou | The instance name. |
LowSeverity | Int | 35 | The number of low-severity vulnerabilities. |
MediumSeverity | Int | 1318 | The number of medium-severity vulnerabilities. |
RegionId | String | cn-hangzhou | The ID of the region in which the image repository resides. |
Tag | String | ruby-2.4.0 | The image tag. |
RepoId | String | crr-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 contained in the data field.
Parameter | Type | Example | Description |
InstanceName | String | test-8-30 | The instance name. |
RepoNamespaceName | String | scan | The namespace to which the image repository belongs. |
InstanceId | String | cri-jhklm6d6o7cp**** | The instance ID. |
RepoName | String | for-scan-local | The name of the image repository. |
FailureMessage | String | The failure information. | |
RegionId | String | cn-hangzhou | The ID of the region in which the image repository resides. |
Tag | String | 1.0 | The image tag. |
RepoId | String | crr-2dk58uw7gfjw**** | The ID of the image repository. |
Result | String | SUCCESS | The result of the image signing. |
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 contained in the data field.
Parameter | Type | Example | Description |
SyncRuleId | String | crsr-goyv4w2rylmx**** | The ID of the synchronization rule. |
ImageFrom | Map | The information about the source image. | |
EndTime | String | 2021-11-15 20:49:40 | The time when the synchronization was finished. |
TaskTrigger | String | PASSIVE | The mode in which the synchronization is triggered. |
StartTime | String | 2021-11-15 20:49:40 | The time when the synchronization was started. |
ImageTo | Map | The information about the destination image. | |
RepoNamespaceName | String | scan | The namespace to which the image repository belongs. |
ImageTag | String | mix-vuls | The image tag. |
InstanceId | String | cri-roa3mwdsq4nz**** | The instance ID. |
RepoName | String | mix-vuls | The name of the image repository. |
RegionId | String | ap-southea**** | The ID of the image repository. |
SyncBatchTaskId | String | 9CC83523-0834-1B25-BEC2-4BE8AA18**** | The ID of the synchronization batch. |
TaskStatus | String | SUCCESS | The status of the synchronization. |
SyncTaskId | String | rst-uce0qfbyuaw7**** | The ID of the synchronization task. |
An image is pushed
The following example shows the event that EventBridge receives when an image is pushed:
{
"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:PushCompleted",
"aliyunaccountid": "123456789098****",
"aliyunpublishtime": "2020-11-19T21:04:42Z",
"aliyuneventbusname": "default",
"aliyunregionid": "cn-hangzhou",
"aliyunpublishaddr": "172.25.XX.XX",
"data": {
"RegionId": "cn-hangzhou",
"InstanceName": "test-8-30",
"InstanceId": "cri-jhklm6d6o7cp****",
"RepoBuildType": "AUTO_BUILD",
"RepoId": "crr-2dk58uw7gfjw****",
"RepoName": "for-scan-local",
"RepoNamespaceName": "scan",
"Tag": "1.0",
"ImageUpdate": "2021-11-15 20:49:40",
"ManifestMediaType": "application/vnd.docker.distribution.manifest.v2+json",
"Platform": "{\"architecture\":\"amd64\",\"os\":\"linux\"}",
"SchemaVersion": "2",
"UserId": "125287961064****",
"Digest": "09592217451cd40ff87b16e658a94860a34343267f0d7916e264a40b99b5****"
}
}
The following table describes the parameters contained in the data field.
Parameter | Type | Example | Description |
RegionId | String | cn-hangzhou | The ID of the region in which the image repository resides. |
InstanceName | String | test-8-30 | The instance name. |
InstanceId | String | cri-jhklm6d6o7cp**** | The instance ID. |
RepoBuildType | String | AUTO_BUILD | The type of the image building. |
RepoId | String | crr-2dk58uw7gfjw**** | The ID of the image repository. |
RepoName | String | for-scan-local | The name of the image repository. |
RepoNamespaceName | String | scan | The namespace to which the image repository belongs. |
Tag | String | 1.0 | The image tag. |
ImageUpdate | String | 2021-11-15 20:49:40 | The time when the image was pushed. |
ManifestMediaType | String | application/vnd.docker.distribution.manifest.v2+json | The media type. |
Platform | String | {\"architecture\":\"amd64\",\"os\":\"linux\"} | The platform from which the image was pushed. |
SchemaVersion | String | 2 | The schema version. |
UserId | String | 125287961064**** | The user ID. |
Digest | String | 09592217451cd40ff87b16e658a94860a34343267f0d7916e264a40b99b5**** | The image digest. |