Use resource groups for horizontal permission management

更新时间:
复制 MD 格式

If administrators from different departments need to manage Elastic Compute Service (ECS) resources, use resource groups to group ECS instances with related resources like disks, images, security groups, keys, and vSwitches. This prevents administrators from viewing or managing each other's resources and enables horizontal permission management.

Security risks

In the default permission model, a RAM user granted ECS management permissions (for example, AliyunECSFullAccess) can fully manage all ECS instances and their associated resources within the Alibaba Cloud account. This flat authorization model poses critical security risks as your business scales and teams expand:

  • 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. Whether malicious or accidental, the consequences can be disastrous.

  • Lack of the principle of least privilege: A RAM user has permissions that far exceed their job requirements. This directly violates the principle of least privilege. This principle is a core component of a defense-in-depth strategy and ensures that any user, program, or process has only the minimum permissions needed 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

Use resource groups and identity-based RAM policies to create logical management boundaries within your Alibaba Cloud account. The following scenario, which involves two departments (DepartmentA and DepartmentB), demonstrates how to implement horizontal permission management.

Scenario: Create separate ECS administrators for Department A and Department B. Each administrator must manage only their own department's resources.

  1. Create resource groups

    1. Log on with an Alibaba Cloud account or a RAM identity (such as a RAM user or RAM role) with permissions to manage resource groups.

    2. 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".

    3. Repeat these steps to create a resource group with the identifier "DepartmentB".

  2. Create RAM users

    1. Go to the RAM console. In the left-side navigation pane, choose Identities > User.

    2. Click Create User and enter the information as prompted.

      1. Logon Name/Display Name: Enter "AdminA".

      2. Access Mode: Select Console Access and configure a password policy.

    3. Click OK and complete the security verification.

    4. Repeat these steps to create the user AdminB.

  3. Grant permissions to the resource groups

    1. Return to the Resource Group console.

    2. Find the DepartmentA resource group and click Manage Permission in the Actions column.

    3. Click Grant Permission.

      1. Resource Scope: This defaults to the current resource group, DepartmentA.

      2. Principal: Select RAM User and select the AdminA user that you just created from the list.

      3. Policy: In the search box, enter ecs. Select the AliyunECSFullAccess and AliyunBSSFullAccess system policies.

      4. Click Add Authorization.

    4. Repeat these steps to grant permissions to the AdminB user for the DepartmentB resource group.

  4. Verify the isolation

    • Log out of your current account. Then, separately log on to the Alibaba Cloud Management Console as AdminA and AdminB.

    • 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. You will see only the ECS instances created in the DepartmentA resource group.

    • After you log on as AdminB: You will find a similar, completely isolated result. All operations are restricted to the DepartmentB resource group.