Elastic Desktop Service (EDS) Enterprise provides access permission management for cloud computers. This means Resource Access Management (RAM) users can be authorized to either view or operate cloud computers. Additionally, they can be granted access permissions for cloud computers with specific tags. This topic describes how to use tags to manage the permissions of RAM users. By using tags, you can control which cloud computers different RAM users can access and the operations they are allowed to perform on those cloud computers.
Background information
Tags are used to identify and categorize cloud resources, enabling you to search for and group resources with similar characteristics across various dimensions. RAM allows you to manage user identities and regulate access to cloud resources through policy-based control. When you integrate tags with RAM, you can use tags as conditions within RAM policies to enable fine-grained access control over resources. For more information about tags and RAM, see Tags and What is RAM?
The following figure shows how to manage RAM user permissions by using tags.
Usage limits
EDS Enterprise supports fine-grained access control through the use of tags, but this feature is limited to cloud computers. Tag-based access control is not available for user management or resource management.
Tag-based access control is only supported in the following regions:
China (Hangzhou)
China (Shanghai)
China (Shenzhen)
China (Beijing)
Singapore
Japan (Tokyo)
Philippines (Manila)
Scenarios
The sample configurations provided in this topic demonstrate how to implement tag-based access control by combining the following scenarios. For example, you have a cloud computer to which the owner:tony tag is added. owner is the tag key and tony is the tag value.
Scenario 1: RAM users cannot create cloud computers that do not have the
owner:tonytag.Scenario 2: RAM users can only operate cloud computers that have the
owner:tonytag.
Sample configurations
In the following section, an Alibaba Cloud account is used to create a custom policy named UseTagCreateECD. This policy specifies that RAM users can only create, view, and operate cloud computers with the owner:tony tag. The UseTagCreateECD custom policy is then attached to the Testuser RAM user.
Step 1: Create a custom policy
Log on to the RAM console by using an Alibaba Cloud account.
Create a custom policy on the JSON tab. For more information, see Create a custom policy on the JSON tab.
NoteA policy establishes authorization boundaries through permission sets. Each policy contains a schema version identifier and declarative rule statements. Each statement comprises mandatory attributes, including Effect, Action, Resource, and Condition (optional). For more information, see Policy elements and Policy structure and syntax.
Tag-based authorization enables granular access control through the
Conditionblock.The following examples describe multi-tag
conditionalconstraints for cloud computers.Tag-based conditional authorization
Description
acs:RequestTagMandates tag inclusion in API calls.
Authentication fails when the policy contains
acs:RequestTagbut the request lacks tag parameters.acs:ResourceTagMandates tag inclusion on resources.
Authorization fails if the policy contains
acs:ResourceTagbut the request omits the resource ID.The following table describes the scenario-specific custom policies.
Scenario 1: A cloud computer can only be created if you add the
owner:tonytag to it.{ "Action":"ecd:CreateDesktops", "Effect":"Allow", "Condition":{ "StringEquals":{ "acs:RequestTag/owner":[ "tony" ] } }, "Resource":"acs:ecd:*:*:ecddesktop/*" }Scenario 2: Only cloud computers with the
owner:tonytag can be operated.{ "Action":"ecd:*", "Effect":"Allow", "Condition":{ "StringEquals":{ "acs:ResourceTag/owner":[ "tony" ] } }, "Resource":"acs:ecd:*:*:ecddesktop/*" }
The following sample code shows a complete custom policy:
{ "Version": "1", "Statement": [ { "Action": "ecd:CreateDesktops", "Effect": "Allow", "Condition": { "StringEquals": { "acs:RequestTag/owner": [ "tony" ] } }, "Resource": "acs:ecd:*:*:ecddesktop/*" }, { "Action": "ecd:*", "Effect": "Allow", "Condition": { "StringEquals": { "acs:ResourceTag/owner": [ "tony" ] } }, "Resource": "acs:ecd:*:*:ecddesktop/*" }, { "Action": [ "*:List*", "*:Describe*", "bss:PayOrder" ], "Effect": "Allow", "Resource": "*" }, { "Action": "*", "Effect": "Allow", "Resource": [ "acs:ecd:*:*:officesite/*", "acs:ecd:*:*:ecdpolicy/*", "acs:ecd:*:*:ecdimage/*", "acs:ecd:*:*:ecdbundle/*" ] } ] }After you compile the policy, click OK on the Create Policy page.
In the Create Policy dialog box, enter a policy name and click OK.
Example:
UseTagCreateECD.
Step 2: Attach the custom policy to a RAM user
In the left-side navigation pane of the RAM console, choose .
Create a RAM user. For more information about specific operations, see Create a RAM user.
NoteIf you want to attach the policy to an existing RAM user, skip this step.
Attach the policy to the RAM user. For more information about specific operations, see Grant permissions to a RAM user.
Step 3: Check whether the policy takes effect
Log on to the EDS Enterprise console or the OpenAPI Explorer platform as the RAM user.
Perform relevant operations in the EDS Enterprise console or by calling API operations to test whether the policy takes effect.
Create a cloud computer to verify Scenario 1
You can create a cloud computer if you add the
owner:tonytag to the cloud computer.If you do not add the
owner:tonytag, or you add other tags when you create the cloud computer, the following message appears, which notifies you of insufficient permissions:
Release a cloud computer to verify Scenario 2
You can release a cloud computer that has the
owner:tonytag.If you release a cloud computer that does not have the
owner:tonytag or has other tags, the following message appears, which notifies you of insufficient permissions:
API operations that support tag-based authentication
After attaching a tag-based policy to a RAM user, the RAM user can use tag-based authentication to manage cloud computers through the EDS API. For more information, see List of operations by function.