If the system-defined policies of WAF cannot meet your needs, you can create custom policies. For details about the actions supported by custom policies, see WAF Permissions and Supported Actions.
You can create custom policies in either of the following ways:
For details, see Creating a Custom Policy. The following section contains examples of common WAF custom policies.
{ "Version": "1.1", "Statement": [ { "Effect": "Allow", "Action": [ "waf:instance:list" ] } ] }
A deny policy must be used together with other policies. If the permissions assigned to a user contain both "Allow" and "Deny", the "Deny" permissions take precedence over the "Allow" permissions.
The following method can be used if you need to assign permissions of the WAF FullAccess policy to a user but also forbid the user from deleting web tamper protection rules (waf:antiTamperRule:delete). Create a custom policy with the action to delete web tamper protection rules, set its Effect to Deny, and assign both this policy and the WAF FullAccess policy to the group the user belongs to. Then the user can perform all operations on WAF except deleting web tamper protection rules. The following is a policy for denying web tamper protection rule deletion.
{ "Version": "1.1", "Statement": [ { "Effect": "Deny", "Action": [ "waf:antiTamperRule:delete" ] }, ] }
A custom policy can contain the actions of multiple services that are of the project-level type. The following is an example policy containing actions of multiple services:
{ "Version": "1.1", "Statement": [ { "Effect": "Allow", "Action": [ "waf:instance:get", "waf:certificate:get" ] }, { "Effect": "Allow", "Action": [ "hss:hosts:switchVersion", "hss:hosts:manualDetect", "hss:manualDetectStatus:get" ] } ] }