Identity management
To secure your Alibaba Cloud account and resources, avoid using your Alibaba Cloud account directly to access Anycast EIP. Instead, use identities provided by Resource Access Management (RAM), such as RAM users and RAM roles.
RAM user
RAM users must be created by an Alibaba Cloud account, or by a RAM user or RAM role with administrative permissions. You must then grant permissions to the RAM user to log on to the console or make API calls to access resources under the account. The following are best practices for using RAM users:
Use your Alibaba Cloud account to create a RAM user, grant this user administrative permissions, and then use this administrator RAM user to create and manage other RAM users.
Separate human users from programmatic users.
Separate these two use cases to prevent operational errors from affecting your services. For users who access the console, enable multi-factor authentication (MFA).
Grant least-privilege permissions to RAM users.
Least privilege means granting only the permissions a user requires to perform a specific task. This approach improves data security and reduces risks from permission abuse.
Do not hardcode the AccessKey ID and AccessKey Secret of a RAM user in your project code. Leaking an AccessKey pair can compromise the security of all resources under your account.
When applicable, configure single sign-on (SSO) for RAM users. This allows users to access Alibaba Cloud resources by using their corporate identities.
RAM user operations
RAM user group
If you have multiple RAM users under your Alibaba Cloud account, you can create RAM user groups to manage users with similar job responsibilities and grant them permissions in batches. This makes user and permission management more efficient.
Follow the least-privilege principle when you grant permissions to a RAM user group.
When a RAM user's responsibilities change, remove the user from any groups they no longer belong to. This helps prevent permission abuse.
If a RAM user group no longer requires certain permissions, remove the corresponding policy from the group.
RAM user group operations
RAM role
A RAM role is a virtual identity to which you can attach policies. Unlike a RAM user, a RAM role does not have permanent credentials, such as a logon password or an AccessKey pair. Instead, a trusted entity must assume a RAM role. After assuming the role, the entity receives a temporary security credential: an STS Token. This token allows the entity to access authorized resources as the assumed role.
The following are security recommendations for using RAM roles:
After you create a RAM role, do not change its trusted entity without careful consideration. Modifying the trusted entity in the role's trust policy can cause the original entity to lose necessary permissions, potentially disrupting your services or causing workloads to fail. Adding a new trusted entity can also introduce the risk of excessive permissions. Before making a change, thoroughly test it in a non-production account to ensure full functionality before you apply it to your production account.
After receiving the necessary permissions, a RAM user acting as a trusted entity can call the AssumeRole - Obtain temporary credentials for a role operation to obtain an STS Token for the RAM role. An STS Token is valid for a specific period after it is issued. Set a reasonable validity period for the token to mitigate the security risks of long-lived credentials.
Note
The role's maximum session duration determines the maximum validity period of an STS Token. You should also set this duration to a reasonable value.
When applicable, configure SSO for RAM roles. This allows users from your organization to use their corporate identities to assume a role and access Alibaba Cloud resources.