Authorize access to encrypted ECS disks

Updated at:

Before Security Center can scan ECS encrypted disks, you must grant RAM role permissions to allow Security Center to access the encrypted snapshots and images under your account. This topic describes how to complete the authorization.

Background

After you enable AI Full Investigation, you must create the encrypted snapshot sharing role and the encrypted image sharing role in RAM to authorize Security Center to access the encrypted snapshots and images under your account. AI Full Investigation can scan encrypted disks only after the authorization is complete.

Authorize encrypted disk detection

Authorization resources

AI Full Investigation requires the following resources under your account to access encrypted snapshots and images.

Resource name

Description

AliyunECSShareEncryptSnapshotDefaultRole

Encrypted snapshot sharing role. Allows ECS to share encrypted snapshots with Security Center and grants access to KMS keys to decrypt snapshot data.

AliyunECSShareEncryptImageDefaultRole

Encrypted image sharing role. Allows ECS to share encrypted images with Security Center and grants access to KMS keys to decrypt image data.

Note
  • The account must have RAM management permissions (AliyunRAMFullAccess or equivalent).

  • For more information about ECS encrypted resource sharing permissions, see Encryption permissions.

Procedure

Step 1: Create the encrypted snapshot sharing role
  1. Log on to the RAM console.

  2. In the left-side navigation pane, choose Identities > Roles, and then click Create Role.

  3. In the Create Role dialog box, set Trusted Entity Type to Alibaba Cloud Service, and then click OK.

  4. Set Trusted Service to Elastic Compute Service, and then click OK.

  5. Enter AliyunECSShareEncryptSnapshotDefaultRole as the role name, and then click OK.

  6. Click Close to return to the role list, then click AliyunECSShareEncryptSnapshotDefaultRole to open its details page.

  7. On the Trust Policy tab, click Edit Trust Policy, replace the policy with the following JSON, and click OK.

    Note

    The Security Center service provider UID is 1643603175590963 for Finance Cloud and 1699778034952274 for non-Finance Cloud .To authorize additional UIDs, add them to the Service array.

    {
      "Version": "1",
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": {
            "Service": [
              "Service provider UID@ecs.aliyuncs.com"
            ]
          },
          "Action": "sts:AssumeRole"
        }
      ]
    }
  8. On the Permissions tab, click Grant Permission. In the Grant Permission panel, set Policy Type to System Policy, search for AliyunKMSFullAccess, select it, and click OK.

Step 2: Create the encrypted image sharing role

This process mirrors Step 1. The following steps highlight key differences only.

  1. Log on to the RAM console.

  2. In the left-side navigation pane, choose Identities > Roles, and then click Create Role.

  3. In the Create Role dialog box, set Trusted Entity Type to Alibaba Cloud Service, and then click OK.

  4. Set Trusted Service to Elastic Compute Service, and then click OK.

  5. Enter AliyunECSShareEncryptImageDefaultRole as the role name (different from the role name in Step 1), and then click OK.

  6. Click Close to return to the role list, then click AliyunECSShareEncryptImageDefaultRole to open its details page.

  7. On the Trust Policy tab, click Edit Trust Policy, replace the policy with the following JSON, and click OK.

    Note

    The trust policy is identical to Step 1. The service provider UID is 1643603175590963 for Finance Cloud and 1699778034952274 for non-Finance Cloud .

    {
      "Version": "1",
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": {
            "Service": [
              "Service provider UID@ecs.aliyuncs.com"
            ]
          },
          "Action": "sts:AssumeRole"
        }
      ]
    }
  8. On the Permissions tab, click Grant Permission. In the Grant Permission panel, set Policy Type to System Policy, search for AliyunKMSFullAccess, select it, and click OK.

Step 3: Verify role creation

Go to Identities > Roles and verify that both roles exist:

  • AliyunECSShareEncryptSnapshotDefaultRole

  • AliyunECSShareEncryptImageDefaultRole

What's next

After you complete the ECS authorization, Detect and fix risks to create a detection task. When configuring Scan Scope, select the authorized ECS instances.

FAQ

  • What conditions must be met for encrypted disk detection?

    Besides this authorization, the KMS keys used by encrypted disks must grant Security Center access. Verify that both AliyunECSShareEncryptSnapshotDefaultRole and AliyunECSShareEncryptImageDefaultRole have the AliyunKMSFullAccess policy attached.

  • How long does it take for authorization to take effect?

    Authorization takes effect immediately. Refresh the Security Center console to see the updated status.