RAM access control
Create multiple RAM users with role-based permissions so that different RAM users can manage specific resources, improving efficiency and reducing the risk of information leakage.
Prerequisites
-
Application Real-Time Monitoring Service (ARMS) is activated. For more information, see Activate ARMS.
-
Understand the basic structure and syntax of permission policies before you create a custom one. For more information, see Permission policy elements.
Step 1: Add a system permission policy to a RAM user
Grant a RAM user the permissions to access the Prometheus console.
-
Log on to the RAM console as a RAM administrator.
- In the left-side navigation pane, choose Identities > Users.
-
On the User page, find the target RAM user and click Add Permission in the Operation column.
-
On the Create Authorization page, configure the following parameters.
Parameter
Description
Resource Range
Select Account.
Principal
The RAM user to receive the permission.
Permission Policy
Select AliyunARMSPrometheusAccessAuth.
-
Click OK, and then click Close.
Step 2: Create a custom permission policy
-
Log on to the RAM console as a RAM administrator.
-
In the left-side navigation pane, choose .
-
On the Permission Policy page, click Create Policy.
-
On the Create Policy page, click the Edit Script tab. Enter your policy content in the policy editor. The following example policy grants all operation permissions on Prometheus instances in the China (Hangzhou) region.
{ "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "arms:List*", "arms:Get*", "arms:Update*", "arms:Exe*", "arms:Create*", "arms:Del*", "arms:Add*", "arms:Check*", "arms:Delete*", "arms:Restart*", "arms:HealthCheck*", "arms:BindPrometheus*", "arms:install*" ], "Resource": "acs:arms:cn-hangzhou:*:prometheus/*" } ] } -
Click OK. Enter a Name and Description for the permission policy.
-
Click OK.
Step 3: Add a custom permission policy for a RAM user
-
Log on to the RAM console as a RAM administrator.
- In the left-side navigation pane, choose Identities > Users.
-
On the User page, find the target RAM user and click Add Permission in the Operation column.
-
On the Add Permission page, grant permissions to the RAM user as described in the following table.
Parameter
Description
Resource Range
Select resource. The permission takes effect within the specified resource group.
Principal
The RAM user to receive the permission.
Permission Policy
Select the custom permission policy that you created in Step 2.
-
Click OK, and then click Close.
Step 4: Verify the permissions
-
After attaching the permission policies to the RAM user, log on to the ARMS console as the RAM user to verify the permissions. For more information, see Log on to the Alibaba Cloud Management Console as a RAM user.
-
In the ARMS console, choose Managed Service for Prometheus and click Instances.
-
On the Instances page, click
to view the resources in the authorized resource group.Use the All Resources drop-down list in the top navigation bar.
NoteIf you try to view an unauthorized resource group, a "permission denied" message appears. Click Close.
Related operations
-
Resource groups enable fine-grained access control for Prometheus resources.
-
To use tags for fine-grained permissions, modify the custom policy from Step 2 and add a Condition. The following example grants permissions on Prometheus instances with specific tags. Replace
tagkeyandtagvaluewith the actual values.{ "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "arms:List*", "arms:Get*", "arms:Update*", "arms:Exe*", "arms:Create*", "arms:Del*", "arms:Add*", "arms:Check*", "arms:Delete*", "arms:Restart*", "arms:HealthCheck*", "arms:BindPrometheus*", "arms:install*" ], "Resource": "acs:arms:*:*:prometheus/*", "Condition": { "StringEquals": { "acs:RequestTag/tagkey": [ "tagvalue" ] } } } ] }
-
When you navigate to the Prometheus instance list for the first time, a "permission denied" message is displayed.
NoteThis is because no tag is selected for authorization.
-
After you select a specific tag, you can view the Instances.
The tag you select here must match the tag defined in the custom permission policy.
On the Prometheus instance list page, click the Filter by Tag button. In the drop-down panel, select the tag key and tag value to filter the instances.