You need to enable JavaScript to run this app.
Container Registry

Container Registry

Copy page
Download PDF
Authorization management
Adding custom policies
Copy page
Download PDF
Adding custom policies
If CR-related preset policies of the system cannot meet your requirements for managing permissions, you can configure custom policies.​
Procedure​
  1. Log in to the IAM console.​
  1. In the left navigation bar, click Policy Management.​
  1. On the Policy Management page, click Create Policy.​
  1. In the Create Policy dialog box, create a policy as shown below.​
  • ​
    {​
    "Statement": [​
    {​
    "Effect": "Allow",​
    "Action": [​
    "cr:GetUser",​
    "cr:SetUser",​
    "cr:ListRegistries"​
    ],​
    "Resource": [​
    "*"​
    ]​
    }​
    ]​
    }​
    ​
tip​
When editing policy content, you need to adhere to the IAM policy syntax. For more details, please refer to Policy Syntax.​
  1. Click Submit to complete the creation.​
  1. On the creation success page, click Add authorization.​
  1. Select the target account. In this example, cr-demo is used.​
8. Click Confirm to complete the configuration.​
Authorization examples​
The following are examples of how to use authentication rules in different CR scenarios.​
Scenario 1: Push images​
Grant an IAM user the permission to push images to a specific namespace associated with a Standard Edition instance (for example: Standard Edition instance "instance-a" and namespace "library"). After logging in to the CR console as the IAM user, you can push all image instances under the specified namespace. You can also obtain information about the namespace and all image instances under it via OpenAPI.​
​
{​
"Statement": [​
{​
"Effect": "Allow",​
"Action": [​
"cr:List*",​
"cr:Get*",​
"cr:Pull*",​
"cr:Push*"​
],​
"Resource": [​
"trn:cr:*:*:instance/instance-a", ​
"trn:cr:*:*:repository/instance-a/library", ​
"trn:cr:*:*:repository/instance-a/library/*"​
]​
}​
]​
}​
​
​
Scenario 2: Pull images​
Grant an IAM user the read permission for a namespace associated with a Standard Edition instance (for example: Standard Edition instance "instance-a" and namespace "library"). After logging in to the CR console as the IAM user, you can pull all image instances under the specified namespace. You can also obtain information about the namespace and all image instances under it via OpenAPI.​
​
{​
"Statement": [​
{​
"Effect": "Allow",​
"Action": [​
"cr:List*",​
"cr:Get*",​
"cr:Pull*"​
],​
"Resource": [​
"trn:cr:*:*:instance/instance-a", ​
"trn:cr:*:*:repository/instance-a/library", ​
"trn:cr:*:*:repository/instance-a/library/*"​
]​
}​
]​
}​
​
​
​
Last updated: 2026.09.23 14:37:20