Identity management
Use Resource Access Management (RAM) to control who can access your Internet Shared Bandwidth resources. Avoid directly using your Alibaba Cloud account for day-to-day access — if the account credentials are compromised, all resources in the account are at risk.
RAM gives you three identity types:
RAM users — persistent identities for individuals or applications, with long-term credentials
RAM user groups — collections of RAM users that share the same permissions
RAM roles — virtual identities that use temporary credentials issued by Security Token Service (STS)
RAM users
A RAM user is an identity created by an Alibaba Cloud account, another RAM user, or a RAM role with administrator permissions. RAM users have no permissions by default — you grant permissions explicitly.
Best practices:
Create a dedicated admin RAM user. Use your Alibaba Cloud account once to create a RAM user, grant that user administrator permissions, then use the RAM user to manage all other RAM users. Avoid using the root account for routine tasks.
Separate human users from service accounts. Create distinct RAM users for individuals and for programs or automated processes — do not share credentials between them.
Apply least-privilege permissions. Grant each RAM user only the minimum permissions needed to perform their job. Least-privilege permissions reduce the impact of accidental misuse or compromise.
Enable MFA. When using the RAM console, enable multi-factor authentication (MFA) to add a second layer of protection beyond the logon password.
Never embed AccessKey credentials in code. Hardcoded AccessKey IDs and AccessKey secrets in source code are a common cause of credential leaks, which can expose all resources in the account. See Credential security solutions.
Enable SSO for RAM users. Allow RAM users to log on from your corporate identity management system using single sign-on (SSO), so access is governed by your organization's existing policies.
You can create RAM users using the RAM console (requires your Alibaba Cloud account username and logon password) or OpenAPI Explorer (requires an AccessKey pair). Use one method consistently for the same type of scenario to avoid human error.
Related topics
RAM user groups
RAM user groups let you manage permissions for multiple RAM users at once. Assign users to a group and grant permissions to the group — every member inherits those permissions automatically.
Best practices:
Apply least-privilege permissions to groups. Grant groups only the permissions their members need to do their work.
Remove users when their role changes. If a team member moves to a different project or leaves the company, remove them from the group immediately rather than waiting for a periodic review.
Remove users when they no longer need access. If a RAM user no longer requires the permissions granted by a group, remove them from the group rather than leaving unused access in place.
Related topics
RAM roles
A RAM role is a virtual identity with attached policies. Unlike RAM users, RAM roles have no permanent credentials — no logon password and no AccessKey pair. Access is granted temporarily: a trusted entity assumes the role by calling the AssumeRole API, which returns an STS token scoped to that role's permissions. The token expires after the configured session duration.
Because credentials are short-lived and scoped, RAM roles are the preferred identity type for both human users (via SSO) and programmatic access.
Best practices:
Avoid changing the trusted entity after creation. Changing which entity can assume a role risks permission loss (breaking your service) or privilege escalation (introducing security risks). Test any changes thoroughly in a non-production environment before applying them.
Set a short STS token validity period. Shorter validity periods limit exposure if a token is leaked. The maximum validity period equals the maximum session duration configured for the role — set that duration to the minimum your workload requires.
Note: The STS token validity period cannot exceed the maximum session duration set for the RAM role.
Enable SSO for RAM roles. Allow identities from your corporate identity management system to assume RAM roles directly, so federated users access Alibaba Cloud resources without long-term credentials.