All Products
Search
Document Center

Cloud Backup:Create a RAM user and authorize the RAM user to access Cloud Backup

Last Updated:Jul 15, 2024

To reduce the security risks for your Alibaba Cloud account, you can manage Cloud Backup resources as a Resource Access Management (RAM) user. This topic describes how to create a RAM user and authorize the RAM user to access Cloud Backup and perform operations.

Background information

In actual scenarios, you may need to perform O&M operations on Cloud Backup or access Cloud Backup resources as a RAM user. In the preceding scenarios, you can create a RAM user and grant the RAM user the permissions to access or manage Cloud Backup resources. To ensure data security, we recommend that you follow the principle of least privilege (PoLP) when you grant permissions on Cloud Backup to the RAM user. For more information about RAM users, see Introduction.

Step 1: Create a RAM user

To manage user permissions by using RAM, you must create RAM users and then grant different permissions to each RAM user.

To create a RAM user, perform the following steps:

Procedure

  1. Log on to the RAM console by using an Alibaba Cloud account or a RAM user who has administrative rights.

  2. In the left-side navigation pane, choose Identities > Users.

  3. On the Users page, click Create User.

  4. In the User Account Information section of the Create User page, configure the following parameters:

    • Logon Name: The logon name can be up to 64 characters in length, and can contain letters, digits, periods (.), hyphens (-), and underscores (_).

    • Display Name: The display name can be up to 128 characters in length.

    • Tag: Click the edit icon and enter a tag key and a tag value. You can add one or more tags to the RAM user. This way, you can manage the RAM user based on the tags.

    Note

    You can click Add User to create multiple RAM users at a time.

  5. In the Access Mode section, select an access mode and configure the required parameters.

    To ensure the security of your Alibaba Cloud account, we recommend that you select only one access mode for the RAM user. This way, the RAM user for an individual is separated from the RAM user for a program.

    • Console Access

      If the RAM user represents an individual, we recommend that you select Console Access for the RAM user. This way, the RAM user can use a username and password to access Alibaba Cloud. If you select Console Access, you must configure the following parameters:

      • Set Console Password: You can select Automatically Regenerate Default Password or Reset Custom Password. If you select Reset Custom Password, you must specify a password. The password must meet the complexity requirements. For more information, see Configure a password policy for RAM users.

      • Password Reset: specifies whether the RAM user is required to reset the password upon the next logon.

      • Enable MAF: specifies whether to enable multi-factor authentication (MFA) for the RAM user. After you enable MFA, you must bind an MFA device to the RAM user or allow the RAM user to bind an MFA device. For more information, see Bind an MFA device to a RAM user.

    • OpenAPI Access

      If the RAM user represents a program, we recommend that you select OpenAPI Access for the RAM user. This way, the RAM user can use an AccessKey pair to access Alibaba Cloud. If you select OpenAPI Access, the system automatically generates an AccessKey ID and AccessKey secret for the RAM user. For more information, see Obtain an AccessKey pair.

      Important

      An AccessKey secret for a RAM user is displayed only after you click Create AccessKey. You cannot query the AccessKey secret in subsequent operations. Therefore, you must back up your AccessKey secret.

  6. Click OK.

  7. Complete security verification as prompted.

Step 2: Grant permissions to the RAM user

By default, a new RAM user has no permissions. Before you can use the RAM user to perform operations in the Cloud Backup console or call API operations, you must grant the required permissions to the RAM user.

Cloud Backup provides two system policies:

  • AliyunHBRFullAccess: grants a RAM user the full access permissions on Cloud Backup. This policy may cause high risks. Proceed with caution.

  • AliyunHbrReadOnlyAccess: grants a RAM user the read-only permissions on Cloud Backup.

You can also attach custom policies to the RAM user in the RAM console to achieve fine-grained access control. For more information, see Create custom policies.

In this example, the AliyunHBRReadOnlyAccess policy is attached to a RAM user.

  1. Log on to the RAM console as a RAM administrator.

  2. On the Users page, find the required RAM user, and click Add Permissions in the Actions column.

    image

    You can also select multiple RAM users and click Add Permissions in the lower part of the page to grant permissions to the RAM users at a time.

  3. In the Grant Permission panel, search for and select AliyunHBRReadOnlyAccess in Policy. The policy is selected to the Selected Policy section on the right.

    Note

    In the Selected Policy section on the right, you can click the cross sign (×) next to a policy to remove the policy.

  4. Confirm the authorization result. Then, click Grant permissions.

Step 3: Use the RAM user to perform backup operations

Log on to the Cloud Backup console as the RAM user and perform backup and restore operations.

  1. Log on to the Cloud Backup console.

  2. In the left-side navigation pane, select different backup features and perform backup and restore operations.

    When you back up a resource for the first time, Cloud Backup automatically creates a service-linked role to obtain the permissions to access the resource. Follow the steps in the wizard to create the service-linked role. For more information, see Service-linked roles for Cloud Backup.

More policy references

You can grant the permissions on a backup vault to a RAM user. For example, you can authorize the RAM user only to back up or restore data by using the backup vault.

You can grant permissions by using the following sample policies. To create a custom policy, copy one of the scripts and paste the script in the RAM console. Then, attach the custom policy to the RAM user. For more information, see Isolate backup permissions and recovery permissions.

  • To disallow a RAM user to restore data from a backup vault, use the following sample policy:

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Deny",
                "Action": [
                    "hbr:CreateRestore",
                    "hbr:CreateRestoreJob",
                    "hbr:CreateHanaRestore",
                    "hbr:CreateUniRestorePlan",
                    "hbr:CreateSqlServerRestore"
                ],
                "Resource": [
                    "acs:hbr:*:1178******531:vault/v-000******blx06",
                    "acs:hbr:*:1178******531:vault/v-000******blx06/client/*"
                ]
            }
        ]
    }
  • To disallow a RAM user to back up data to a backup vault, use the following sample policy:

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Deny",
                "Action": [
                    "hbr:CreateUniBackupPlan",
                    "hbr:UpdateUniBackupPlan",
                    "hbr:DeleteUniBackupPlan",
                    "hbr:CreateHanaInstance",
                    "hbr:UpdateHanaInstance",
                    "hbr:DeleteHanaInstance",
                    "hbr:CreateHanaBackupPlan",
                    "hbr:UpdateHanaBackupPlan",
                    "hbr:DeleteHanaBackupPlan",
                    "hbr:CreateClient",
                    "hbr:CreateClients",
                    "hbr:UpdateClient",
                    "hbr:UpdateClientSettings",
                    "hbr:UpdateClientAlertConfig",
                    "hbr:DeleteClient",
                    "hbr:DeleteClients",
                    "hbr:CreateJob",
                    "hbr:UpdateJob",
                    "hbr:CreateBackupPlan",
                    "hbr:UpdateBackupPlan",
                    "hbr:ExecuteBackupPlan",
                    "hbr:DeleteBackupPlan",
                    "hbr:CreateBackupJob",
                    "hbr:CreatePlan",
                    "hbr:UpdatePlan",
                    "hbr:CreateTrialBackupPlan",
                    "hbr:ConvertToPostPaidInstance",
                    "hbr:KeepAfterTrialExpiration"
                ],
                "Resource": [
                    "acs:hbr:*:1178******9531:vault/v-000******blx06",
                    "acs:hbr:*:1178******9531:vault/v-000******blx06/client/*"
                ]
            }
        ]
    }

What to do next

Log on to the Alibaba Cloud Management Console as a RAM user