Identity Policy-based Authorization (New IAM Version)
Identity policy-based authorization is a capability provided by the new IAM console for more refined, flexible permissions control. For details about the differences between the old and new IAM versions, see Differences Between the Old and New IAM Consoles. If you continue to use the old IAM console, see Role/Policy-based Authorization (Old IAM Version).
System-defined permissions in identity policy–based authorization provided by Identity and Access Management (IAM) let you control access to UCS. With IAM, you can:
- Create IAM users for personnel based on your enterprise's organizational structure. Each IAM user has their own identity credentials for accessing UCS resources.
- Grant users only the permissions required to perform a given task based on their job responsibilities.
- Entrust an account or a cloud service to perform efficient O&M on your UCS resources.
If your account meets your permissions requirements, you can skip this section.
Figure 1 shows the process flow of identity policy-based authorization.
Prerequisites
- Before granting permissions, learn about UCS system-defined permissions. To grant permissions for other services, learn about all system-defined permissions supported by IAM.
- A user with the Security Administrator role (for example, your account) has all IAM permissions except role switching. Only these users can view user groups and their permissions on the Permissions page on the UCS console.
- If a service control policy in an organization is used for permissions control, the request for creating yearly/monthly resources cannot be intercepted. For example, if an SCP policy for intercepting ECS creation is configured, yearly/monthly ECSs can still be created on UCS.
Configuration Description
On the UCS console, when you choose Permissions > Add Permission to create a user or user group, you will be directed to the IAM console to complete the process. After the user or user group is created and the permissions are configured, you can view the information on the Permissions page of the cluster or fleet. This section describes the operations in IAM.
Process Flow
- .
On the IAM console, create a user or user group.
UCS is a global service deployed for all regions. When granting permissions, set the authorization scope to All resources.
- Attach a system-defined identity policy to the user or user group.
Grant the permissions defined in the system-defined identity policy UCSReadOnlyPolicy to the user or user group, or attach the system-defined identity policy to it.
- Log in as the IAM user and verify permissions.
In the authorized region, perform the following operations:
- Choose Service List > Ubiquitous Cloud Native Service. In the navigation pane, choose Infrastructure > Fleets. Create a fleet or register a cluster. If a message appears indicating that you have insufficient permissions to perform the operation, the UCSReadOnlyPolicy policy is in effect.
- Choose another service from Service List. If a message appears indicating that you have insufficient permissions to access the service, the UCSReadOnlyPolicy policy is in effect.
Identity Policies
The system-defined identity policies preset for UCS in IAM are UCSFullAccessPolicy, UCSCommonOperationsPolicy, and UCSReadOnlyPolicy.
- UCSFullAccessPolicy: administrator permissions for UCS. Users with these permissions can perform all operations on UCS, including creating permission policies and security policies.
- UCSCommonOperationsPolicy: common operation permissions for UCS. Users with these permissions can create workloads, distribute traffic, and perform other operations.
- UCSReadOnlyPolicy: read-only permissions for UCS.
Least-Privilege Permissions for UCS Functions
Services on Huawei Cloud are interdependent, so UCS depends on other cloud services to implement some functions (such as image repositories and domain name resolution). The three system-defined identity policies in Identity Policies are often used together with the roles or policies of other cloud services for refined authorization. When granting permissions to IAM users, the administrator must comply with the principle of least privilege. Table 1 lists the least-privilege permissions required by the Administrator, Operator, and Viewer roles to use UCS functions.
- If your Huawei Cloud account logs in to the UCS console for the first time, you need to grant permissions to the account. UCS will create an agency named ucs_admin_trust for you in IAM. Do not delete or modify the agency.
- If no permissions are granted to the user group that an IAM user belongs to, access to the UCS console will be denied. Grant permissions by referring to Table 1.
- UCSFullAccessPolicy does not have the RBAC permissions of CCE clusters. You need to go to the Permissions page to grant permissions for CCE clusters as described in the following table.
| Function | Permission Type | Permissions | Least-Privilege Permissions |
|---|---|---|---|
| Fleets | Administrator |
| UCSFullAccessPolicy |
| Viewer | Querying the list of clusters or fleets, or details about a cluster or fleet | UCSReadOnlyPolicy | |
| Huawei Cloud clusters | Administrator | Read-write permissions on Huawei Cloud clusters and all Kubernetes resource objects (such as nodes, workloads, jobs, and Services) in the clusters | UCSFullAccessPolicy + CCEFullPolicy |
| Developer | Read-write permissions on Huawei Cloud clusters and most Kubernetes resource objects in the clusters and read-only permissions on Kubernetes resource objects such as namespaces and resource quotas | UCSCommonOperationsPolicy + CCEFullPolicy | |
| Viewer | Read-only permissions on Huawei Cloud clusters and all Kubernetes resource objects (such as nodes, workloads, jobs, and Services) in the clusters | UCSReadOnlyPolicy + CCEFullPolicy | |
| On-premises/Attached clusters | Administrator | Read-write permissions on on-premises/attached clusters and all Kubernetes resource objects (such as nodes, workloads, jobs, and Services) in the clusters | UCSFullAccessPolicy |
| Developer | Read-write permissions on on-premises/attached clusters and most Kubernetes resource objects in the clusters and read-only permissions on Kubernetes resource objects such as namespaces and resource quotas | UCSCommonOperationsPolicy + UCS RBAC (permissions to list namespaces required) | |
| Viewer | Read-only permissions on on-premises/attached clusters and all Kubernetes resource objects (such as nodes, workloads, jobs, and Services) in the clusters | UCSReadOnlyPolicy + UCS RBAC (permission to list namespaces required) | |
| Image repositories | Administrator | All permissions on SWR, such as creating organizations, pushing images, viewing the image list or details about an image, and pulling images | SWRFullAccessPolicy |
| Permissions | Administrator |
NOTE: When granting permissions, you need to grant the IAMReadOnlyPolicy permissions (read-only permissions on IAM) to IAM users to obtain the IAM user list. | UCSFullAccessPolicy + IAMReadOnlyPolicy |
| Viewer | Viewing the permission list or permission details | UCSReadOnlyPolicy + IAMReadOnlyPolicy | |
| Policy center | Administrator |
| UCSFullAccessPolicy |
| Viewer | For fleets and clusters with the policy center enabled, users with such permissions can view the policy list and policy implementation details. | UCSCommonOperationsPolicy or UCSReadOnlyPolicy | |
| Traffic distribution | Administrator | Operations such as creating a traffic policy as well as suspending and deleting a scheduling policy | (Recommended) UCSCommonOperationsPolicy + DNSFullAccessPolicy Alternative: UCSFullAccessPolicy + DNSFullAccessPolicy |
| Viewer | Viewing the traffic policy list or details about a traffic policy | UCSReadOnlyPolicy + DNSFullAccessPolicy | |
| Container Intelligent Analysis | Administrator |
| UCS CIAOperations NOTE: The new IAM version does not support the Container Intelligent Analysis permissions. Go to the old IAM console to configure the permissions. |
| Operator Service Center | Administrator | All permissions on Operator Service Center, such as subscribing to a service, viewing the service list or details about a service, creating a service instance, viewing the service instance list or details about a service instance, deleting a service instance, and unsubscribing from a service | UCS FullAccess NOTE: The new IAM version does not support the Operator Service Center permissions. Go to the old IAM console to configure the permissions. |
| Viewer | Read-only permissions on Operator Service Center, such as viewing the service list or details about a service and viewing the service instance list or details about a service instance. | UCS ReadOnlyAccess NOTE: The new IAM version does not support the Operator Service Center permissions. Go to the old IAM console to configure the permissions. |
Example Custom Identity Policies
You can create custom identity policies to supplement the system-defined identity policies of UCS. For details about actions supported in custom identity policies, see Permissions and Supported Actions.
To create a custom identity policy, choose either visual editor or JSON.
- Visual editor: Select cloud services, actions, resources, and request conditions. This does not require knowledge of policy grammar.
- JSON: Create a JSON policy or edit an existing one.
For details, see Creating a Custom Identity Policy and Attaching It to a Principal.
When creating a custom identity policy, use the Resource element to specify the resources the identity policy applies to and use the Condition element (service-specific condition keys) to control when the identity policy is in effect. The following provides examples of custom UCS identity policies.
- Example 1: Grant permission to create a cluster.
{ "Version": "5.0", "Statement": [ { "Effect": "Allow", "Action": [ "ucs:clusters:createCluster" ] } ] } - Example 2: Create a custom identity policy containing multiple actions.
A custom identity policy can contain the actions of one or more services. Example identity policy containing multiple actions:
{ "Version": "5.0", "Statement": [ { "Effect": "Allow", "Action": [ "ucs:clustergroups:createFleet", "ucs:clustergroups:deleteFleet" ] }, { "Effect": "Deny", "Action": [ "ucs:addons:delete" ] } ] }
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
