If administrators from different departments need to manage Elastic Compute Service (ECS) resources, you can use resource groups to group ECS instances with their related resources, such as disks, images, security groups, keys, and vSwitches. This prevents administrators from viewing or operating on each other's resources and implements horizontal permission management.
Security risks
In the default permission model, a Resource Access Management (RAM) user who is granted ECS management permissions, such as AliyunECSFullAccess, has full operational permissions on all ECS instances and their related resources within the account. This flat authorization pattern poses critical security risks as your business scales and teams grow:
Risk of permission abuse and operational errors: An administrator from Department A can easily view, modify, or even delete core production servers that belong to Department B. The consequences can be disastrous, whether the action is malicious or accidental.
Lack of the principle of least privilege: The RAM user has permissions that far exceed what is necessary for their job. This directly violates the principle of least privilege. This principle is a core component of a defense in depth strategy. It ensures that any user, program, or process has only the minimum permissions required to perform its task.
Audit and compliance challenges: When all operations are mixed together, it is difficult to clearly track and audit which department or project made changes to resources. This creates significant challenges for meeting compliance requirements.
Best practices
You can use resource groups and identity-based RAM policies to build logical management borders within your Alibaba Cloud account. The following scenario involves two departments, DepartmentA and DepartmentB, and shows how to build a secure horizontal permission management system.
Scenario: Create separate ECS administrators for Department A and Department B who can only manage the resources of their own department.
Create resource groups
Log on using an Alibaba Cloud account or a RAM identity (a RAM user or RAM role) that has resource group management permissions.
Go to the Resource Group console. Click Create Resource Group, fill in the required information, and then click OK.
Resource Group Identifier: Enter
DepartmentA.Resource Group Name: Enter
Department A Resource Group.
Repeat the steps to create a resource group with the ID
DepartmentB.
Create RAM users
Go to the RAM console. In the navigation pane on the left, choose .
Click Create User and fill in the information as prompted.
Logon Name/Display Name: Enter
AdminA.Access Mode: Select Console Access and configure the password policy.
Click OK and complete the security authentication.
Repeat the steps to create the user
AdminB.
Grant permissions to the resource groups
Return to the Resource Group console page.
Find the
DepartmentAresource group and click Manage Permission in the Actions column.Click Grant Permission.
Resource Scope: The default is the current resource group,
DepartmentA.Principal: Select RAM User and select the
AdminAuser that you just created from the list.Policy: In the search box, enter
ecs. Select theAliyunECSFullAccessandAliyunBSSFullAccesssystem policies.Click OK.
Repeat the steps to grant permissions to the
AdminBuser for theDepartmentBresource group.
Verify the isolation
Log out of your current account. Then, log on to the Alibaba Cloud Management Console using the credentials for
AdminAandAdminBseparately.After you log on as
AdminA: Create a custom instance. For the resource group, select Department A Resource Group.Go to the ECS console - Instances page. You can see only the ECS instances that were created in the
DepartmentAresource group.After you log on as
AdminB: You will observe similar but completely isolated behavior. All operations are restricted to theDepartmentBresource group.