Using IAM Roles or Policies to Grant Access to SCM
Roles/Policiesprovided by Identity and Access Management (IAM) let you control access to SCM. With IAM, you can:
- Create IAM users for employees based on the organizational structure of your enterprise. Each IAM user has their own security credentials, providing access to SCM resources.
- Grant only the permissions required for users to perform a task.
- Entrust a Huawei Cloud account or cloud service to perform professional and efficient O&M on your HSS resources.
If your Huawei Cloud account does not require individual IAM users, skip this section.
This section describes how to assign permissions based on roles and policies. Figure 1 shows the authorization process.
Prerequisites
Before assigning permissions to a user group, you need to understand the SCM permissions. For details, see Role and Policy Permission Management. For details about the permissions that can be granted to other services, see System-defined Permissions.
Process Flow
- Create a user group and assign permissions.
Create a user group on the IAM console and assign the SCM ReadOnlyAccess permission to the user group.
- Create a user and add it to a user group.
On the IAM console, create an IAM user and add it to the user group created in 1.
- Log in and verify permissions.
Log in to the CCM console by using the created user, and verify that the user only has read permissions for CCM.
- Choose Service List > CCM. On the SCM page, click Buy Certificate in the upper right corner to purchase an SSL certificate. If the certificate cannot be purchased (assume that the current permission contains only SCM ReadOnlyAccess), the SCM ReadOnlyAccess policy has already taken effect.
- Choose another service from Service List. If a message appears indicating that you have insufficient permissions to access the service, the SCM ReadOnlyAccess policy is in effect.
Example Custom Policies
Custom policies can be created to supplement the system-defined policies of SCM. Add actions in custom policies as needed. For details about supported actions, see Actions Supported by Policy-based Authorization.
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 syntax.
- JSON: Edit JSON policies from scratch or based on an existing policy.
For details, see Creating a Custom Policy. The following lists examples of common SCM custom policies.
- Example 1: Allowing users to query the certificate list
{ "Version": "1.1", "Statement": [ { "Action": [ "scm:cert:list" ], "Effect": "Allow" } ] } - Example 2: denying certificate deletion
A policy with only "Deny" permissions must be used in conjunction with other policies to take effect. If the permissions assigned to a user contain both "Allow" and "Deny", the "Deny" permissions take precedence over the "Allow" permissions.
If you need to assign permissions of the SCM Administrator policy to a user but you want to prevent the user from deleting certificates, you can create a custom policy for denying certificate deletion, and attach both policies to the group that the user belongs to. Then, the user can perform all operations on certificates except deleting certificates. The following is an example of a deny policy:
{ "Version": "1.1", "Statement": [ { "Action": [ "scm:cert:delete" ], "Effect": "Deny" } ] } - Example 3: Defining permissions for multiple services in a policy
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 actions of multiple services:
{ "Version": "1.1", "Statement": [ { "Action": [ "scm:cert:upload", "scm:cert:push", "cdn:configuration:queryHttpsConf" ], "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
