This topic describes how to use RAM to limit the methods of access to Alibaba Cloud resources. This ensures a higher level of data security.

Prerequisites

Background information

An enterprise has purchased multiple types of Alibaba Cloud resources, such as Elastic Compute Service (ECS) instances, ApsaraDB for RDS instances, Server Load Balancer (SLB) instances, and Object Storage Service (OSS) buckets. To ensure business and data security, this enterprise requires RAM users to access Alibaba Cloud resources only through HTTPS.

Solution

To allow a RAM user to access Alibaba Cloud resources only through HTTPS, create a custom policy and attach the policy to the RAM user.

  1. Create a RAM user. For more information, see Create a RAM user.
  2. Create a custom policy. For more information, see Create a custom policy.
  3. Attach the policy to the RAM user. For more information, see Grant permissions to a RAM user.

Create a custom policy

  1. In the left-side navigation pane, click Policies under Permissions.
  2. On the Policies page, click Create Policy.
  3. On the Create Custom Policy page, specify the Policy Name and Note parameters.
  4. In the Configuration Mode section, select Script. Copy and paste the following sample script to the Policy Document section, and then edit the script based on your business requirements.
    Limit the methods of access to Alibaba Cloud resources

    If the following policy is attached to a RAM user, the RAM user can access ECS instances only through HTTPS. This is because the acs:SecureTransport parameter in the Condition element is set to true.

    {
      "Statement": [
        {
          "Action": "ecs:*",
          "Effect": "Allow",
          "Resource": "*",
          "Condition": {        
            "Bool": {
              "acs:SecureTransport": "true"
            }
          }
        }
      ],
      "Version": "1"
    }
    Note The Condition element applies only to the actions that are specified in the policy. The valid values of the acs:SecureTransport parameter are true and false.
  5. Click OK.