Updated on 2025-12-09 GMT+08:00

Introduction

If you need to perform fine-grained permission management on your Web Application Firewall (WAF), Identity and Access Management (IAM) is recommended. If your account already meets permission management requirements, skip over this section. There is no impact on using other WAF functions.

With IAM, you can control access to specific Huawei Cloudcloud resources from principals (IAM users, user groups, agencies, or trust agencies). IAM supports role/policy-based authorization and identity policy-based authorization.

The following table describes the main differences.

Table 1 Differences between the two types of authorization

Item

Authorization Using

Permission

Authorization Method

Scenario

Role/Policy-based authorization

User-permission-authorization scope

  • System-defined roles
  • System policy
  • Custom policies

Assigning roles or policies to principals

To authorize a user, you need to add it to a user group first and then specify the scope of authorization. It provides a limited number of condition keys and cannot meet the requirements of fine-grained permissions control. This method is suitable for small and medium-sized enterprises.

Identity policy-based authorization

User-Policy

  • System-defined identity policies
  • Custom identity policies
  • Assigning identity policies to principals
  • Attaching identity policies to principals

You can authorize a user by directly attaching an identity policy to it. You can customize policies and attach them to specified users. Identity policies allow you to perform refined access control more efficiently and flexibly. However, this model is more complex and requires higher personnel expertise. It is more suitable for medium- and large-sized enterprises.

Assume that you want to grant IAM users the permission to create ECSs in CN North-Beijing4 and OBS buckets in CN South-Guangzhou. With role/policy-based authorization, the administrator needs to create two custom policies and attach both to the IAM users. With identity policy-based authorization, the administrator only needs to create one custom identity policy and configure the condition key g:RequestedRegion for the policy, and then attach the policy to the users or grant the users the access permissions to the specified regions. Identity policy-based authorization is more flexible than role/policy-based authorization.

Policies and actions in the two authorization models are not interoperable. You are advised to use the identity policy-based authorization model.

If you use IAM users to call an API, the IAM users must be granted the required permissions. The required permissions are determined by the actions supported by the API. Only users with the policies allowing for those actions can call the API successfully.

Assume that an IAM user wants to call an API to query the list of domain names protected by WAF. With policy-based authorization, the IAM user must be granted the permissions allowing for action waf:instance:list. With identity-based authorization, the IAM user must be granted the permissions allowing for action waf:host:list.