Using a Resource Access Management (RAM) user to perform operations in Cloud Backup helps reduce the security risk to your Alibaba Cloud account. This topic describes how to create a RAM user, grant permissions to the RAM user, and use the RAM user to access Cloud Backup.
Background information
You may need a RAM user to perform operations and maintenance (O&M) on Cloud Backup or access its resources. To do this, you must grant the RAM user the necessary permissions to access or manage Cloud Backup. To ensure data security, we recommend that you follow the principle of least privilege (PoLP) when granting permissions for Cloud Backup to a RAM user. For more information about RAM users, see Introduction to RAM.
Step 1: Create a RAM user
To manage permissions using RAM, you must create a RAM user and assign authorization policies to the user.
Console
Sign in to the RAM console using your Alibaba Cloud account or as a RAM user with administrative permissions (a user to which the
AliyunRAMFullAccesspolicy is attached).In the left-side navigation pane, choose .
On the Users page, click Create User.
On the Create User page, in the User Account Information section, configure the user's basic information.
Logon Name (required): Up to 64 characters. Allows letters, digits, periods (.), hyphens (-), and underscores (_).
Display Name (optional): The name can be up to 128 characters long.
Tag (optional): Click
, then enter a tag key and tag value to categorize and manage users.
NoteClick Add User to create multiple RAM users in bulk.
In the Access Mode section, select an access mode based on the user type.
ImportantAs a security best practice, select only one access mode per user to separate human console access from programmatic application access. If a RAM user needs both console sign-in and API call capabilities, you can select both access modes. After you select Permanent AccessKey, you must select the I confirm that I must create an AccessKey checkbox to continue.
A leaked AccessKey pair compromises your account. Use Security Token Service (STS) tokens (temporary credentials) instead to reduce risk. Best practices for using access credentials to call Alibaba Cloud APIs.
Console access
Select Console Access.
Set Logon Password: Auto-generate or set a custom password. Custom passwords must meet the configured complexity requirements. Set a password policy for RAM users.
Password Reset: Specify whether the user must reset the password at next sign-in.
Enable MFA: MFA is required for all users by default. To change this setting, see Manage RAM user security settings. Users must bind an MFA device at first sign-in. Bind an MFA device.
Programmatic access
Select Permanent AccessKey.
The system automatically creates an AccessKey ID and AccessKey secret for the RAM user.
ImportantThe AccessKey secret is displayed only at creation and cannot be retrieved later. You must immediately download or copy and save the AccessKey secret. A leaked AccessKey pair compromises all resources under your account. Create an AccessKey pair.
OpenAPI
Create a RAM user for console access
Call GetDefaultDomain to obtain the default logon suffix of an account. The format is
<AccountAlias>.onaliyun.com.Call the CreateUser operation to create a RAM user. The following parameters are required:
UserPrincipalName: The logon name for a RAM user. The format is<username>@<AccountAlias>.onaliyun.com, where<username>is the RAM username and<AccountAlias>.onaliyun.comis the default logon suffix.DisplayName: The display name for the RAM user. It can be different from the<username>above.
Call the CreateLoginProfile operation to create a login profile and configure access mode and MFA. Recommended settings:
UserPrincipalName: The user created in the previous step.Password: Set per the account's password strength requirements. Call GetPasswordPolicy to query the current password policy.MFABindRequired: Set totrueto require MFA for RAM users.Status: Enables or disables console password logon. Default value:Active.
Create a RAM user for programmatic access
Call GetDefaultDomain to obtain the default logon suffix for an account. The suffix is in the format
<AccountAlias>.onaliyun.com.Call the CreateUser operation to create a RAM user. The following parameters are required:
UserPrincipalName: The logon name of a RAM user in the format<username>@<AccountAlias>.onaliyun.com, where<username>is the RAM username and<AccountAlias>.onaliyun.comis the default logon suffix.DisplayName: The display name for the RAM user, which can be different from the<username>above.
To create an AccessKey pair (AccessKey), call the CreateAccessKey operation and pass only the
UserPrincipalNamefor the user that you created in the previous step.ImportantThe
CreateAccessKeyresponse contains the AccessKeyId and AccessKeySecret. The AccessKeySecret is displayed only once and cannot be retrieved later — save it immediately. A leaked AccessKey compromises all resources in your account. For more information, see Create an AccessKey.
Step 2: Grant permissions to the RAM user
By default, a new RAM user has no permissions. You must grant permissions to the RAM user before the user can operate resources from the console or by calling an API.
Cloud Backup provides two system policies:
AliyunHBRFullAccess: Grants the RAM user full permissions on Cloud Backup. This policy provides permissions that are equivalent to an administrator. Use this policy with caution because it poses high security risks.
AliyunHBRReadOnlyAccess: Grants the RAM user read-only access to the Cloud Backup console.
You can also create custom policies in the RAM console to implement fine-grained permission control. For more information, see Create a custom policy.
Step 3: Use the RAM user to perform backup operations
Log on to the Cloud Backup console as the RAM user to perform backup and restore operations.
Log on to the Cloud Backup console.
In the navigation pane on the left, choose a backup feature to 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 permissions to access the resource. Follow the on-screen instructions to create the role. For more information, see Service-linked roles for Cloud Backup.
More policy references
You can grant a RAM user permissions to perform only backup operations or only restore operations for a backup vault.
To do this, copy the required policy template, create a custom policy in the RAM console, and then attach the policy to the RAM user. For more information, see Separate backup and restore permissions.
Policy that denies permissions for restore operations:
{ "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/*" ] } ] }Policy that denies permissions for backup operations:
{ "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