All Products
Search
Document Center

Data Management:DMS custom policies

Last Updated:May 31, 2024

If system policies do not meet your requirements, you can configure custom policies to implement the principle of least privilege. You can use custom policies to implement fine-grained permission control and improve the security of your resources. This topic describes the scenarios and examples of Data Management (DMS) custom policies.

What is a custom policy?

Resource Access Management (RAM) policies are classified into system policies and custom policies. You can manage custom policies based on your business requirements.

  • After you create a custom policy, you must attach the policy to a RAM user, RAM user group, or RAM role. This way, the permissions that are specified in the policy can be granted to the principal.

  • You can delete a RAM policy that is not attached to a principal. If the RAM policy is attached to a principal, you must detach the RAM policy from the principal before you can delete the RAM policy.

  • Custom policies support version control. You can manage custom policy versions based on the version management mechanism provided by RAM.

References

Scenarios and examples of custom policies

The following examples demonstrate how to grant a RAM user the permissions to log on to one or more ApsaraDB RDS instances from DMS.

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["dms:LoginDatabase"],
      "Resource": ["acs:rds:*:*:dbinstance/[$RDS_ID]"]
    }
  ]
}
Note

Replace [$RDS_ID] with the ID of the ApsaraDB RDS instance.

  • Grant a RAM user the permissions to log on to all ApsaraDB RDS instances within your Alibaba Cloud account.

    Grant the AliyunRDSFullAccess permission to the RAM user in the RAM console or create a custom policy that contains the following content and attach the policy to the RAM user. For more information, see Grant permissions to a RAM user.

    {
      "Version": "1",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": ["dms:LoginDatabase"],
          "Resource": ["acs:rds:*:*:*"]
        }
      ]
    }

RAM authorization

To use custom policies, you must understand the permission control requirements of your business and the authorization information of DMS. For more information, see RAM authorization.