Back to controls

Ensure RAM policies are attached only to groups or roles

### Description

Category

Controls

Medium

Applies to

Alibaba Cloud

Coverage

null controls, 1 queries

Asset types

1 covered

Overview

Description

By default, RAM users, groups, and roles have no access to Alibaba Cloud resources. RAM policies are the means by which privileges are granted to users, groups, or roles. It is recommended that RAM policies be applied directly to groups and roles but not users.

Rationale

Assigning privileges at the group or role level reduces the complexity of access management as the number of users grows. Reducing access management complexity may in turn reduce opportunity for a principal to inadvertently receive or retain excessive privileges.

Impact

There may be cases that a user needs to have permissions that cannot be covered by the groups it joins or roles it can assume. It may still be needed to attach specific policies to RAM users for certain operation that cannot be grouped with other permission under role or group.

References

  1. https://www.alibabacloud.com/help/doc-detail/116809.htm
  2. https://www.alibabacloud.com/help/doc-detail/116815.htm
  3. https://www.alibabacloud.com/help/doc-detail/116147.htm
  4. https://www.alibabacloud.com/help/doc-detail/116820.htm

Remediation guidance

Perform the following to create a RAM user group and assign a policy to it:

Via the management console

  1. Login to the RAM Console
  2. Under Identities, select Users
  3. Click Create Group, and enter the group name, display name, and description
  4. Click OK
  5. In the Group Name/Display Name column, find the target RAM user group and click Add Permissions.
  6. In the Select Policy section, select the target policy or policies and click OK

Via CLI

  1. Run the following command to create a RAM user group:
aliyun ram CreateGroup –GroupName 
  1. Run the following command to attach a policy to the group:
aliyun ram AttachPolicyToGroup --GroupName  --PolicyName <policyName> --PolicyType 

Perform the following to add a user to a given group:

Via the management console

  1. Login to the RAM Console
  2. Under Identities, select Users
  3. In the Group Name/Display Name column, find the target RAM user group and click Add Group Members.
  4. In the User section, select the target RAM user and click OK.

Via CLI

Run the following command to add a RAM user to a user group:

aliyun ram AddUserToGroup --GroupName  --UserName 

Perform the following to remove a direct association between a user and policy:

Via the management console

  1. Login to the RAM Console
  2. Under Permissions, select Grants
  3. In the Principal column, find the target RAM user and click Revoke Permission.
  4. Click OK.

Via CLI

Run the following command to remove a policy from a RAM user:

aliyun ram DetachPolicyFromUser --PolicyName <policyName> --PolicyType  --UserName 

Multiple Remediation Paths

SERVICE-WIDE (RECOMMENDED when many resources are affected): Apply organization/tenant-level guardrails and baseline policies for the entire platform.

ASSET-LEVEL: Fix only the affected resources identified by this control.

PREVENTIVE: Add preventive policy checks to CI/CD and periodic posture scans.

References for Service-Wide Patterns

  • Platform policy/governance and preventive control patterns should be applied tenant-wide where supported.

Query logic

These are the stored checks tied to this control.

RAM policies are attached only to groups or roles

Connectors

Alibaba Cloud

Covered asset types

IAMUser

Expected check: eq []

iamUsers(where: { iamPolicies_SOME: { idFromProvider_NOT: null } }) {...AssetFragment}
Cyscale Logo
Cyscale is an agentless cloud-native application protection platform (CNAPP) that automates the contextual analysis of cloud misconfigurations, vulnerabilities, access, and data, to provide an accurate and actionable assessment of risk.

Stay connected

Receive new blog posts and product updates from Cyscale

By clicking Subscribe, I agree to Cyscale’s Privacy Policy


© 2026 Cyscale Limited

LinkedIn icon
Twitter icon
Facebook icon
crunch base icon
angel icon