Custom permission configuration for live transcoding
If system permission policies cannot meet your requirements, you can create custom policies to implement the principle of least privilege. Custom policies can help achieve fine-grained permission management and effectively improve resource access security. This topic describes scenarios and examples of custom policies for the live transcoding feature of Intelligent Media Management (IMM).
Grant custom permissions to a service role
When you create an IMM project, you must specify a service role for the project so that IMM can assume the role to access authorized resources in other Alibaba Cloud services, such as Object Storage Service (OSS).
Create a service role
Sample policies
Grant the read and write permissions on a specific OSS bucket
The following RAM policy is used to grant a service role the read and write permissions on a bucket named my-bucket.
Parameter description
The Resource field in OSS is in the acs:oss:*:*:<BucketName>/* format. Replace the parameter with your actual rseource name.
Parameter | Description |
| The name of the OSS bucket. You can view the name on the Buckets page in the OSS console. |
{
"Version": "1",
"Statement": [
{
"Action": [
"oss:GetObject",
"oss:PutObject"
],
"Resource": "acs:oss:*:*:my-bucket/*",
"Effect": "Allow"
},
{
"Action": "ram:PassRole",
"Resource": "*",
"Effect": "Allow",
"Condition": {
"StringEquals": {
"acs:Service": "imm.aliyuncs.com"
}
}
}
]
}Grant custom permissions to a RAM user
RAM provides a persistent permission control mechanism by creating RAM users with different permissions. If the AccessKey pair of a RAM user is leaked, only limited information will be potentially exposed.
Create a RAM user and grant permissions to it
Sample policy
Grant the permissions to call API operations related to live transcoding in a specific project and use IMM to process objects in a specific bucket
The following RAM policy is used to grant a RAM user permissions to call the GenerateVideoPlaylist and LiveTranscoding operations in the video-process-project project in the China (Shanghai) region and use IMM to process objects in a bucket named my-bucket.
Live transcoding is implemented using an IMM project bound to an OSS bucket. Therefore, you must grant the RAM user the permissions to call API operations related to the bound project.
Parameter description
The Resource field in OSS is in the acs:oss:*:*:<BucketName>/* format. Replace the parameter with your actual rseource name.
Parameter | Description |
| The name of the OSS bucket. You can view the name on the Buckets page in the OSS console. |
The Resource field in IMM is in the acs:imm:<RegionId>:<UID>:project/<ProjectName> format. Replace the parameters with your actual rseource names.
Parameter | Description |
| The region ID. Examples: |
| The account ID. You can view the ID on the Overview page of the Account Center. |
| The project name specified when you created the project. You can view the name in the IMM console. |
The Resource field in Simple Message Queue (SMQ, formerly MNS) is in the acs:mns:<RegionId>:<UID>:/queues/<QueueName>/messages format. Replace the parameters with your actual rseource names.
Parameter | Description |
| The region ID. Example: |
| The account ID. You can view the ID on the Overview page of the Account Center. |
| The name of the SMQ queue. You can view the name on the Queues page in the SMQ console. |
{
"Version": "1",
"Statement": [
{
"Action": [
"oss:GetObject",
"oss:PostProcessTask",
"oss:ProcessImm"
],
"Resource": "acs:oss:*:*:my-bucket/*",
"Effect": "Allow"
},
{
"Action": [
"imm:GenerateVideoPlaylist",
"imm:LiveTranscoding"
],
"Resource": "acs:imm:cn-shanghai:150910xxxxxxxxxx:project/video-process-project",
"Effect": "Allow"
}
]
}