Role/Policy-based Authorization (Old IAM Version)
Role/Policy-based authorization provided by IAM lets you control access to CCE. 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 CCE 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 CCE resources.
If your account meets your permissions requirements, you can skip this section.
Figure 1 shows the process flow of role/policy-based authorization.
Cluster permissions are granted to users for operating cluster-related resources only (such as clusters and nodes). To operate Kubernetes resources like workloads and Services, you must be granted the namespace permissions as well.
Prerequisites
- Before granting permissions to user groups, get familiar with the system policies listed in Permissions for CCE. 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 CCE console.
Process Flow
- Create a user group and grant it permissions.
On the IAM console, create a user group and grant it CCE read-only permissions (CCE ReadOnlyAccess as an example).
CCE is deployed by region. On the IAM console, select Region-specific projects when assigning CCE permissions.
- Create an IAM user and add it to the created user group.
Create a user on the IAM console and add the user to the group created in 1.
IAM users need programmatic and management console access to use CCE.
- Log in as the IAM user and verify permissions.
Log in to the management console as the user you created, and verify that the user has the assigned permissions.
- Choose Service List > Cloud Container Engine. Then click Buy Cluster on the CCE console. If the operation failed, the CCE ReadOnlyAccess policy is in effect.
- Choose another service from Service List. If a message appears indicating that you have insufficient permissions to perform the operation, the CCE ReadOnlyAccess policy is in effect.
System Roles Supported by CCE
Roles are a type of coarse-grained authorization mechanism that defines service-level permissions based on user responsibilities. Only a limited number of service-level roles are available for authorization. Roles are not ideal for fine-grained authorization and least privilege access.
The preset system role for CCE in IAM is CCE Administrator. When assigning this role to a user group, you must also select other roles and policies on which this role depends, such as Tenant Guest, Server Administrator, ELB Administrator, OBS Administrator, SFS Administrator, SWR Admin, and APM FullAccess. For more information about dependencies, see System-defined Permissions.
System Policies Supported by CCE
The system policies preset for CCE in IAM are CCE FullAccess and CCE ReadOnlyAccess.
- CCE FullAccess: common operation permissions on CCE cluster resources, excluding the namespace permissions for the clusters (with Kubernetes RBAC enabled) and the privileged administrator operations, such as agency configuration and cluster certificate generation
- CCE ReadOnlyAccess: permissions to view CCE cluster resources, excluding the namespace permissions of the clusters (with Kubernetes RBAC enabled)
When purchasing a cluster or node that is billed on a yearly/monthly basis, add custom policies and configure payment permissions such as bss:*:* for the Billing Center.
|
Action |
Specific Action |
Description |
|---|---|---|
|
cce:*:* |
cce:cluster:create |
Create a cluster. |
|
cce:cluster:delete |
Delete a cluster. |
|
|
cce:cluster:update |
Update a cluster. For example, update cluster node scheduling parameters and provide RBAC support to clusters. |
|
|
cce:cluster:upgrade |
Upgrade a cluster. |
|
|
cce:cluster:start |
Wake up a cluster. |
|
|
cce:cluster:stop |
Hibernate a cluster. |
|
|
cce:cluster:list |
List all clusters. |
|
|
cce:cluster:get |
Obtain cluster details. |
|
|
cce:node:create |
Add a node. |
|
|
cce:node:delete |
Delete one or more nodes. |
|
|
cce:node:update |
Update a node. For example, update the node name. |
|
|
cce:node:get |
Obtain node details. |
|
|
cce:node:list |
List all nodes. |
|
|
cce:nodepool:create |
Create a node pool. |
|
|
cce:nodepool:delete |
Delete a node pool. |
|
|
cce:nodepool:update |
Update a node pool. |
|
|
cce:nodepool:get |
Obtain a node pool. |
|
|
cce:nodepool:list |
List all node pools in a cluster. |
|
|
cce:release:create |
Create a release. |
|
|
cce:release:delete |
Delete a release. |
|
|
cce:release:update |
Update a release. |
|
|
cce:job:list |
List all cluster jobs. |
|
|
cce:job:delete |
Delete one or more cluster jobs. |
|
|
cce:job:get |
Obtain a specific cluster job. |
|
|
cce:storage:create |
Create a storage volume. |
|
|
cce:storage:delete |
Delete a storage volume. |
|
|
cce:storage:list |
List all volumes. |
|
|
cce:addonInstance:create |
Create an add-on pod. |
|
|
cce:addonInstance:delete |
Delete an add-on pod. |
|
|
cce:addonInstance:update |
Update an add-on pod. |
|
|
cce:addonInstance:get |
Obtain an add-on pod. |
|
|
cce:addonTemplate:get |
Obtain an add-on template. |
|
|
cce:addonInstance:list |
List all add-on pods. |
|
|
cce:addonTemplate:list |
List all add-on templates. |
|
|
cce:chart:list |
List all charts. |
|
|
cce:chart:delete |
Delete a chart. |
|
|
cce:chart:update |
Update a chart. |
|
|
cce:chart:upload |
Upload a chart. |
|
|
cce:chart:get |
Obtain a chart. |
|
|
cce:release:get |
Obtain a release. |
|
|
cce:release:list |
List all releases. |
|
|
cce:userAuthorization:get |
Obtain CCE user authorization. |
|
|
cce:userAuthorization:create |
Create CCE user authorization. |
|
|
ecs:*:* |
None |
Perform all operations on ECSs. |
|
evs:*:* |
None |
Perform all operations on EVS disks. EVS disks can be attached to cloud servers and expanded to a higher capacity whenever needed. |
|
vpc:*:* |
None |
Perform all operations on VPC, including enhanced ELB load balancers. A cluster must run in a VPC. When creating a namespace, create or associate a VPC with the namespace so that all containers in the namespace will run in the VPC. |
|
bms:*:get* |
None |
View BMS resource details. |
|
bms:*:list* |
None |
List all BMS resources. |
|
ims:*:get* |
None |
View IMS resource details. |
|
ims:*:list* |
None |
List all IMS resources. |
|
elb:*:get |
None |
View ELB resource details. |
|
elb:*:list |
None |
List all ELB resources. |
|
nat:*:get |
None |
View NAT Gateway resource details. |
|
nat:*:list |
None |
List all NAT Gateway resources. |
|
sfs:*:get* |
None |
View SFS resource details. |
|
sfs:shares:ShareAction |
None |
Share SFS resources for scaling. |
|
sfsturbo:*:get* |
None |
View SFS Turbo resource details. |
|
sfsturbo:shares:ShareAction |
None |
Share SFS Turbo resources for scaling. |
|
tms:resourceTags:list |
None |
List TMS resources. |
|
kps:domainKeypairs:list |
None |
List DEW SSH keys. |
|
kps:domainKeypairs:get |
None |
View DEW SSH keys. |
|
kms:cmk:get |
None |
View DEW key information. |
|
kms:cmk:list |
None |
View DEW key list. |
|
aom:*:get |
None |
View Application Operations Management (AOM) resource details. |
|
aom:*:list |
None |
List AOM resources. |
|
aom:autoScalingRule:* |
None |
Perform all operations on AOM auto scaling rules. |
|
apm:icmgr:* |
None |
Perform operations on the ICAgent in APM. |
|
lts:*:* |
None |
Perform all operations on LTS. |
|
smn:*:* |
None |
Perform all operations on SMN. |
|
Action |
Specific Action |
Description |
|---|---|---|
|
cce:*:get |
cce:cluster:get |
Obtain cluster details. |
|
cce:node:get |
Obtain node details. |
|
|
cce:job:get |
Obtain a specific cluster job. |
|
|
cce:addonInstance:get |
Obtain an add-on pod. |
|
|
cce:addonTemplate:get |
Obtain an add-on template. |
|
|
cce:chart:get |
Obtain a chart. |
|
|
cce:nodepool:get |
Obtain a node pool. |
|
|
cce:release:get |
Obtain a release. |
|
|
cce:userAuthorization:get |
Obtain CCE user authorization. |
|
|
cce:*:list |
cce:cluster:list |
List all clusters. |
|
cce:node:list |
List all nodes. |
|
|
cce:job:list |
List all cluster jobs. |
|
|
cce:addonInstance:list |
List all add-on pods. |
|
|
cce:addonTemplate:list |
List all add-on templates. |
|
|
cce:chart:list |
List all charts. |
|
|
cce:nodepool:list |
List all node pools in a cluster. |
|
|
cce:release:list |
List all releases. |
|
|
cce:storage:list |
List all volumes. |
|
|
cce:kubernetes:* |
None |
Perform operations on all Kubernetes resources. For details, see Namespace Permissions. |
|
ecs:*:get |
None |
View details about all ECS resources. An ECS with multiple EVS disks is a cluster node in CCE. |
|
ecs:*:list |
None |
List all ECS resources. |
|
bms:*:get* |
None |
View BMS resource details. |
|
bms:*:list |
None |
List all BMS resources. |
|
ims:*:get* |
None |
View IMS resource details. |
|
ims:*:list* |
None |
List all IMS resources. |
|
evs:*:get |
None |
View EVS resource details. EVS disks can be attached to cloud servers and expanded to a higher capacity whenever needed. |
|
evs:*:list |
None |
List all EVS resources. |
|
evs:*:count |
None |
None |
|
vpc:*:get |
None |
View VPC resource details. A cluster must run in a VPC. When creating a namespace, create or associate a VPC with the namespace so that all containers in the namespace will run in the VPC. |
|
vpc:*:list |
None |
List all VPC resources. |
|
elb:*:get |
None |
View ELB resource details. |
|
elb:*:list |
None |
List all ELB resources. |
|
nat:*:get |
None |
View NAT Gateway resource details. |
|
nat:*:list |
None |
List all NAT Gateway resources. |
|
sfs:*:get* |
None |
View SFS resource details. |
|
sfs:shares:ShareAction |
None |
Share SFS resources for scaling. |
|
sfsturbo:*:get* |
None |
View SFS Turbo resource details. |
|
sfsturbo:shares:ShareAction |
None |
Share SFS Turbo resources for scaling. |
|
tms:resourceTags:list |
None |
List TMS resources. |
|
kps:domainKeypairs:list |
None |
List DEW SSH keys. |
|
kps:domainKeypairs:get |
None |
View DEW SSH keys. |
|
kms:cmk:get |
None |
View DEW key information. |
|
kms:cmk:list |
None |
View DEW key list. |
|
aom:*:get |
None |
View AOM resource details. |
|
aom:*:list |
None |
List all AOM resources. |
|
aom:autoScalingRule:* |
None |
Perform all operations on AOM auto scaling rules. |
|
lts:*:get |
None |
View details about all LTS resources. |
|
lts:*:list |
None |
List all LTS resources. |
|
smn:*:get |
None |
View SMN resource details. |
|
smn:*:list |
None |
List SMN resources. |
Example Custom Policies
Custom policies can be created as a supplement to the system-defined policies of CCE. For details about actions supported in custom policies, see Permissions and Supported Actions.
You can create custom policies in either of the following ways:
- 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 Policy. This section provides examples of common custom FunctionGraph policies.
Examples
- Example 1: Creating a cluster
{ "Version": "1.1", "Statement": [ { "Effect": "Allow", "Action": [ "cce:cluster:create" ] } ] } - Example 2: Denying node deletion
A policy with only "Deny" permissions must be used with other policies. If the permissions assigned to a user contain both "Allow" and "Deny", the "Deny" permissions take precedence over the "Allow" permissions.
If you want to grant the CCEFullAccess permission to a user but prevent them from deleting nodes (cce:node:delete), you can create a custom policy that denies node deletion. Then, attach this policy with the CCEFullAccess policy to the user. Since an explicit denial in any policy takes precedence over any allowances, the user will have permission to perform all operations on nodes except for deleting them. The following is an example of a deny policy:
{ "Version": "1.1", "Statement": [ { "Effect": "Deny", "Action": [ "cce:node:delete" ] } ] } - Example 3: Creating a custom policy containing multiple actions
A custom policy can contain the actions of multiple services that are of the global or project-level type. The following is an example policy containing multiple actions:
{ "Version": "1.1", "Statement": [ { "Action": [ "ecs:cloudServers:resize", "ecs:cloudServers:delete", "ecs:cloudServers:delete", "ims:images:list", "ims:serverImages:create" ], "Effect": "Allow" } ] }
CCE Cluster Permissions and Enterprise Projects
CCE supports resource management and permission allocation by cluster and enterprise project.
Note that:
- IAM projects are based on physical isolation of resources, whereas enterprise projects provide global logical groups of resources, which better meet the actual requirements of enterprises. In addition, IAM policies can be managed based on enterprise projects. Therefore, use enterprise projects for permissions management. For details, see Creating an Enterprise Project.
- When there are both IAM projects and enterprise projects, IAM preferentially matches the IAM project policies.
- When creating a cluster or node using purchased cloud resources, ensure that IAM users have been granted the required permissions in the enterprise project to use these resources. Otherwise, the cluster or node may fail to be created.
- If a resource does not support enterprise projects, the permissions granted to the resource will not take effect.
Resource Type
Resource
Description
Supporting enterprise projects
cluster
Cluster
node
Node
nodepool
Node pool
job
Job
tag
Cluster label
addonInstance
Add-on pod
release
Helm release
storage
Storage
Not supporting enterprise projects
quota
Cluster quota
chart
Chart
addonTemplate
Add-on template
Feedback
Was this page helpful?
Provide feedbackThank 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
