Using IAM Identity Policies to Grant Access to CodeArts PerfTest
System-defined permissions in identity policy-based authorization provided by IAM let you control access to CodeArts PerfTest. With IAM, you can:
- Create IAM users or user groups for personnel based on your enterprise's organizational structure. Each IAM user has their own identity credentials for accessing CodeArts PerfTest resources.
- Grant users only the permissions required to perform a given task based on their job responsibilities.
- Entrust a Huawei Cloud account or a cloud service to perform efficient O&M on your CodeArts PerfTest resources.
If your Huawei Cloud 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 system-defined permissions in Identity Policy-based Authorization for CodeArts PerfTest. To grant permissions for other services, learn about all system-defined permissions supported by IAM.
Process Flow
- On the IAM console, create an IAM user or create a user group.
On the IAM console, create a user or user group.
- Attach a system-defined policy to the user or user group.
Assign the permissions defined in the system-defined identity policy CodeArtsPerfTestReadOnlyPolicy to the user or 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:
In the service list, choose CodeArts PerfTest. The Dashboard page of the CodeArts PerfTest console is displayed by default. Choose PerfTest Projects in the navigation pane and click Create Test Project on the right. If a message appears indicating that you have insufficient permissions to create a test project, the CodeArtsPerfTestReadOnlyPolicy policy is in effect.
Example Custom Identity Policies
You can create custom identity policies to supplement the system-defined identity policies of CodeArts PerfTest.
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.
The following lists examples of common CodeArts PerfTest custom identity policies.
- Example 1: Grant permission to add a PerfTest project on the console.
{ "Version": "5.0", "Statement": [ { "Effect": "Allow", "Action": [ "codeartsperftest:cpts:listPerfTestProject", "codeartsperftest:cpts:createPerfTestProject" ] } ] } - Example 2: Grant permission to deny a user from modifying PerfTest projects, cases, and directories.
An identity policy with only "Deny" permissions must be used together with other identity policies. If the permissions granted to an IAM user contain both "Allow" and "Deny", the "Deny" permissions take precedence over the "Allow" permissions.
Assume that you want to grant the permissions of the CodeArtsPerfTestFullAccessPolicy identity policy to a user but want to prevent them from modifying PerfTest projects, cases, and directories. You can create a custom identity policy for denying the modification of PerfTest projects, cases, and directories, and attach this policy together with the CodeArtsPerfTestFullAccessPolicy policy to the user. As an explicit deny in any policy overrides any allows, the user can perform all operations on CodeArts PerfTest excepting modifying PerfTest projects, cases, and directories. Example identity policy denying the modification of PerfTest projects, cases, and directories:
{ "Version": "5.0", "Statement": [ { "Effect": "Deny", "Action": [ "codeartsperftest:cpts:updatePerfTestProject" ] } ] } - Example 3: Create a custom policy containing multiple actions.
A custom identity policy can contain the actions of one or multiple services that are of the same type (global or project-level). Example policy containing multiple actions:
{ "Version": "5.0", "Statement": [ { "Action": [ "codeartsperftest:cpts:listPerfTestProject", "cce:cluster:list" ], "Effect": "Allow" } ] } - Example 4: Grant permission to create a private resource group on the console.
{ "Version": "5.0", "Statement": [ { "Action": [ "codeartsperftest:*:*", "aom:cmdbResources:list", "aom:metric:list", "aom:inventory:list", "apm:application:list", "apm:application:getMetric", "apm:application:getEnv", "apm:application:getInstance", "apm:application:getService", "apm:application:get", "cce:cluster:list", "cce:cluster:getCluster", "cce:release:create", "cce:release:delete", "cce:release:get", "cce:release:list", "cce:node:list", "cce:node:getNode", "ecs:cloudServers:showFlavor", "ecs:cloudServerFlavors:get", "ecs:flavors:get", "vpcep:endpoints:create", "vpcep:endpoints:delete", "vpcep:endpoints:list", "vpcep:endpoints:get" ], "Effect": "Allow" } ] }
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