Alibaba Cloud provides Resource Access Management and Security Token Service (STS) to help you manage permissions with flexibility and security. This topic describes how to grant a system policy to a RAM user.
Prerequisites
Before you begin, ensure that you have:
-
A RAM user created under your Alibaba Cloud account. See Create a RAM user
Background information
By default, an Alibaba Cloud account has full permissions to its own resources. With Resource Access Management (RAM) and Security Token Service (STS), you can grant different RAM users varying levels of access to your image resources and provide temporary access credentials. Before you configure authorization policies, we recommend that you read the RAM product documentation.
After you grant a policy to a RAM user, the RAM user must log in to the Container Registry console, create a Personal Edition instance, and set a registry password to view their permitted image resources.
RAM
When using RAM to grant permissions, note the following to avoid granting excessive permissions.
If you grant the AdministratorAccess policy to a RAM user, the user receives full permissions on all Alibaba Cloud resources, including Container Registry. This permission set overrides any previously granted Container Registry-specific policies.
System policies
Container Registry provides two built-in system policies: AliyunContainerRegistryFullAccess and AliyunContainerRegistryReadOnlyAccess. You can grant them directly to users.
AliyunContainerRegistryFullAccess
A RAM user with this policy has the same permissions on image resources as an Alibaba Cloud account and can perform any operation.
{ "Statement": [ { "Action": "cr:*", "Effect": "Allow", "Resource": "*" } ], "Version": "1" }AliyunContainerRegistryReadOnlyAccess
A RAM user with this policy has read-only permissions on all image resources. For example, they can view repository lists and pull images.
{ "Statement": [ { "Action": [ "cr:Get*", "cr:List*", "cr:Pull*" ], "Effect": "Allow", "Resource": "*" } ], "Version": "1" }
Procedure
This section describes how to grant the AliyunContainerRegistryReadOnlyAccess policy to a RAM user.
Log on to the RAM console.
In the left-side navigation pane, choose .
On the Users page, find the RAM user and click Actions in the Attach Policy column.
Alternatively, you can select multiple RAM users and click Attach Policy at the bottom of the list to grant permissions to them all at once.
Authorize
Select an authorization scope.
Account: The permissions apply within the current Alibaba Cloud account.
resource: The permissions apply within the specified resource group.
NoteTo grant permissions at the resource group level, the cloud service must support resource groups. For more information, see Services that support resource groups.
Specify the principal.
The principal is the user who will receive the permissions. The RAM user you selected is automatically specified as the principal.
In the Policies search box, search for AliyunContainerRegistryReadOnlyAccess, and then click AliyunContainerRegistryReadOnlyAccess in the results list.
Click OK.
Click Off.
Related documentation
To implement fine-grained access control, see Grant a custom policy to a RAM user.
For more information about authentication rules, see RAM authorization.