Creates a rule for a specific Web Application Firewall (WAF) protection module, such as the web intrusion protection, data security, advanced mitigation, bot management, or access control and throttling module.

You can set the DefenseType parameter to specify the protection module. For more information about the values of this parameter, see the description of the DefenseType parameter.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateProtectionModuleRule

The operation that you want to perform. Set the value to CreateProtectionModuleRule

DefenseType String Yes ac_custom

The protection module for which you want to create a rule. Valid values:

  • waf-codec: Protection Rules Engine
  • tamperproof: website tamper-proofing
  • dlp: data leak prevention
  • ng_account: account security
  • antifraud: data risk control
  • antifraud_js: configuration of a webpage into which you want to insert a JavaScript plug-in for data risk control
  • bot_algorithm: intelligent algorithm for bot management
  • bot_wxbb_pkg: version protection for the app protection module
  • bot_wxbb: path protection for the app protection module
  • ac_custom: custom protection policy
  • whitelist: website whitelist
Domain String Yes www.example.com

The domain name that you add to WAF.

Note You can call the DescribeDomainNames operation to query the domain names that are added to WAF.
InstanceId String Yes waf_elasticity-cn-0xldbqt****

The ID of the WAF instance.

Note You can call the DescribeInstanceInfo operation to query the ID of the WAF instance.
Rule String Yes {"action":"monitor","name":"test","scene":"custom_acl","conditions":[{"opCode":1,"key":"URL","values":"/example"}]}

The configuration of the rule. This parameter is a string that consists of JSON structs.

Note The parameters vary based on the value of the DefenseType parameter. For more information, see the "Description of the Rule parameter" section of this topic.

All Alibaba Cloud API operations must include common request parameters. For more information about common request parameters, see Common parameters.

For more information about sample requests, see the "Examples" section of this topic.

Description of the Rule parameter
  • If the DefenseType parameter is set to waf-codec, the value of the Rule parameter consists of the following parameters:
    • codecList: required. The enabled decoding settings. Data type: array. You can view the valid values of this parameter in the WAF console.
    • Example
      
          {
              "codecList":["url","base64"]
          }
          
  • If the DefenseType parameter is set to tamperproof, the value of the Rule parameter consists of the following parameters:
    • uri: required. The URL that you want to protect.Data type: string.
    • name: required. The name of the rule. Data type: string.
    • Example
      
          {
              "name":"example",
              "uri":"http://www.aliyundoc.com/example"
          }
          
  • If the DefenseType parameter is set to dIp, the value of the Rule parameter consists of the following parameters:
    • name: required. The name of the rule. Data type: string.
    • conditions: required. the conditions based on which WAF searches for and protects sensitive data. You can specify a maximum of two conditions. The two conditions are specified as a JSON string and must be in an AND logical relation. Data type: array. The JSON string consists of the following parameters:
      • key: the match items. Valid values: Valid values:
        • 0: URL
        • 10: the specific sensitive data that you want to protect
        • 11: HTTP status code
          Note You cannot specify HTTP status codes (11) and sensitive data (10) as the match items in the conditions parameter at the same time.
      • operation: the match logic. Set the value to 1, which indicates the INCLUDES logical relation.
      • value: the match value, which is formulated in a JSON string. You can specify multiple values. The JSON string consists of the following parameters:
        • v: This parameter is valid only when the key parameter is set to 0 or 11.
          • URL: If the key parameter is set to 0, the value of the v parameter is a URL.
          • HTTP status code: If the key parameter is set to 11, the valid values of the v parameter are 400,401,402,403,404,405 to 499,500,501,502,503,504, and505 to 599.
        • k: This parameter is valid only when the key parameter is set to 10. Valid values:
          • 100: ID card numbers
          • 101: credit card numbers
          • 102: phone numbers
          • 103: default sensitive words
    • action: the action that is performed after the rule is matched. Valid values:
      • 3: generates alerts.
      • 10: filters sensitive data. This action is valid only when the key parameter is set to 10.
      • 11: returns the built-in block page of the system. This action is valid only when the key parameter is set to 11.
    • Example
      
        {
          "name":"example",
          "conditions":[{"key":11,"operation":1,"value":[{"v":401}]},{"key":"0","operation":1,"value":[{"v":"www.aliyundoc.com"}]}],
          "action":3
        }
        
  • If the DefenseType parameter is set to ng_account, the value of the Rule parameter consists of the following parameters:
    • url_path: required. The URL path in the requests that are detected. The path must start with a forward slash (/). Data type: string.
    • method: required. The method of the requests that are detected. Data type: string. Valid values: POST, GET, PUT, and DELETE. You can specify multiple request methods. Separate the request methods with commas (,).
    • account_left: required. The account. Data type: string.
    • password_left: optional. The password. Data type: string.
    • action: required. The action that is performed after the rule is matched. Data type: string. Valid values:
      • monitor: generates alerts.
      • block: blocks requests.
    • Example
      
          {
              "url_path":"/example",
              "method":"POST,GET,PUT,DELETE",
              "account_left":"aaa",
              "password_left:"123",
              "action":"monitor"
          }
          
  • If the DefenseType parameter is set to antifraud, the value of the Rule parameter consists of the following parameters:
    • uri: required. The requested URL. Data type: string.
    • Example
      
          {
              "uri": "http://1.example.com/example"
          }
          
  • If the DefenseType parameter is set to antifraud_js, the value of the Rule parameter consists of the following parameters:
    • uri: required. The URL path of the web page into which you want to insert a JavaScript plug-in for data risk control. The path must start with a forward slash (/). WAF inserts the JavaScript plug-in into all the web pages under the specified URL path. Data type: string.
    • Example
      
          {
              "uri": "/example/example"
          }
          
  • If the DefenseType parameter is set to bot_algorithm, the value of the Rule parameter consists of the following parameters:
    • name: required. The name of the rule. Data type: string.
    • algorithmName: required. The name of the algorithm. Data type: string. Valid values:
      • RR: the algorithm that is used to identify special resource crawlers
      • PR: the algorithm that is used to identify specific path crawlers
      • DPR: the algorithm that is used to identify parameter round-robin crawlers
      • SR: the algorithm that is used to identify dynamic IP address crawlers
      • IND: the algorithm that is used to identify proxy device crawlers
      • Periodicity: the algorithm that is used to identify periodic crawlers
    • timeInterval: required. The interval of detection. Data type: integer. Valid values: 30, 60, 120, 300, and 600. Unit: seconds.
    • action: required. The action that is performed after the rule is matched. Data type: string. Valid values:
      • monitor: monitors requests.
      • captcha: performs slider CAPTCHA verification.
      • js: performs JavaScript verification.
      • block: blocks requests. If you set the action parameter to block, you must also specify the blocktime parameter.
    • blocktime: optional. The period during which requests are blocked. Data type: integer. Unit: minutes. Valid values: 1 to 600.
    • config: required. The configuration of the algorithm, which is formulated in a JSON string. Data type: string. The parameters that are contained in the JSON string vary based on the value of the algorithmName parameter.
      • If you set the algorithmName parameter to RR, the value of the config parameter consists of the following parameters:
        • resourceType: optional. The type of resource that is requested. Data type: integer. Valid values:
          • 1: dynamic resources
          • 2: static resources
          • -1: custom resources. In this case, you must also use the extensions parameter to specify resource suffixes in a string. Separate suffixes with commas (,). Example: css,jpg,xls
        • minRequestCountPerIp: required. The minimum number of requests from an IP address. WAF detects an IP address only when the number of requests from this IP address is greater than or equal to the value of this parameter. Data type: integer. This parameter specifies the minimum number of access requests. Valid values: 5 to 10000.
        • minRatio: required. The threshold for the proportion of requests that access specified types of resources or specified paths in requests that are initiated from an IP address. This threshold is used to determine whether risks exist. If the actual proportion is greater than the threshold, risks exist. The requests that access specified types of resources are identified by using the algorithm that is used to identify special resource crawlers. The requests that access specified paths are identified by using the algorithm that is used to identify specific path crawlers. Data type: float. Valid values: 0.01 to 1.
      • If you set the algorithmName parameter to PR, the value of the config parameter consists of the following parameters:
        • keyPathConfiguration: optional. The requested URL paths. You can specify a maximum of 10 URL paths. This parameter is required only when the algorithmName parameter is set to PR. Data type: array. This parameter is a JSON string that consists of the following parameters:
          • method: required. The request method. Data type: string. Valid values: POST, GET, PUT, DELETE, HEAD, and OPTIONS.
          • url: required. The keyword of the URL path. The path must start with a forward slash (/). Data type: string.
          • matchType: required. The match method. This parameter specifies a requested URL path in combination with the url parameter. Data type: string. Valid values: all (exact match), prefix (prefix match), and regex (regular expression match).
        • minRequestCountPerIp: required. The minimum number of requests from an IP address. WAF detects an IP address only when the number of requests from this IP address is greater than or equal to the value of this parameter. Data type: integer. This parameter specifies the minimum number of access requests. Valid values: 5 to 10000.
        • minRatio: required. The threshold for the proportion of requests that access specified types of resources or specified paths in requests that are initiated from an IP address. This threshold is used to determine whether risks exist. If the actual proportion is greater than the threshold, risks exist. The requests that access specified types of resources are identified by using the algorithm that is used to identify special resource crawlers. The requests that access specified paths are identified by using the algorithm that is used to identify specific path crawlers. Data type: float. Valid values: 0.01 to 1.
      • If you set the algorithmName parameter to DPR, the value of the config parameter consists of the following parameters:
        • method: required. The request method. Data type: string. Valid values: POST, GET, PUT, DELETE, HEAD, and OPTIONS.
        • urlPattern: required. The path of key parameters. The path must start with a forward slash (/). Data type: string. You can specify multiple crucial parameters and enclose each parameter with a pair of braces {}. Example: /company/{}/{}/{}/user.php?uid={}.
        • minRequestCountPerIp: required. The minimum number of requests from an IP address. WAF detects an IP address only when the number of requests from this IP address is greater than or equal to the value of this parameter. Data type: integer. This parameter specifies the minimum number of access requests. Valid values: 5 to 10000.
        • minRatio: required. The threshold for the proportion of requests that use specified key parameters in requests that are initiated from an IP address. This threshold is used to determine whether risks exist. If an actual proportion is greater than the threshold, risks exist. Data type: float. Valid values: 0.01 to 1.
      • If you set the algorithmName parameter to SR, the value of the config parameter consists of the following parameters:
        • maxRequestCountPerSrSession: required. The minimum number of requests in each session. If the number of requests in a single session is smaller than the value of this parameter, the session is considered abnormal. Data type: integer. Valid values: 1 to 8.
        • minSrSessionCountPerIp: required. The threshold for the number of abnormal sessions in the requests that are initiated from an IP address. This threshold is used to determine whether risks exist. If the actual number is greater than the threshold, risks exist. Data type: integer. Valid values: 5 to 300.
      • If you set the algorithmName parameter to IND, the value of the config parameter consists of the following parameters:
        • minIpCount: required. The threshold for the number of IP addresses that the Wi-Fi connected device accesses. This parameter specifies the condition that is used to identify malicious devices. If an actual number is greater than the threshold, risks exist. Data type: integer. Valid values: 5 to 500.
        • keyPathConfiguration: optional. The requested URL path. You can specify a maximum of 10 URL paths. Data type: array. This parameter is a JSON string that consists of the following parameters:
          • method: required. The request method. Data type: string. Valid values: POST, GET, PUT, DELETE, HEAD, and OPTIONS.
          • url: required. The keyword of the URL path. The path must start with a forward slash (/). Data type: string.
          • matchType: required. The match method. This parameter specifies a requested URL path in combination with the url parameter. Data type: string. Valid values: all (exact match), prefix (prefix match), and regex (regular expression match).
      • If you set the algorithmName parameter to Periodicity, the value of the config parameter consists of the following parameters:
        • minRequestCountPerIp: required. The minimum number of requests from an IP address. WAF detects an IP address only when the number of requests from this IP address is greater than or equal to the value of this parameter. Data type: integer. This parameter specifies the minimum number of access requests. Valid values: 5 to 10000.
        • level: required. The risk level, which is the extent of obviousness of periodic access from IP addresses. Data type: integer. Valid values:
          • 0: obvious
          • 1: moderate
          • 2: weak
    • Example
      
          {
              "name": "Crawler identification for proxy devices",
              "algorithmName":"IND",
              "timeInterval":"60",
              "action":"monitor",
              "config":{
                  "minIpCount":5,
                  "keyPathConfiguration":[{"url":"/index","method":"GET","matchType":"prefix"}]
              }
          }
          
  • If the DefenseType parameter is set to bot_wxbb_pkg, the value of the Rule parameter consists of the following parameters:
    • name: required. The name of the rule. Data type: string.
    • action: required. The action that is performed after the rule is matched. Data type: string. Valid values:
      • test: monitors requests.
      • close: blocks requests.
    • nameList: required. The version information of valid packages. You can specify the version information for a maximum of five valid packages. Data type: array. This parameter is a JSON string that consists of the following parameters:
      • name: required. The valid package name. Data type: string.
      • signList: required. The signatures for the package. You can specify a maximum of 15 signatures. Separate them with commas (,). Data type: array.
    • Example
      
          {
              "name":"test",
              "action":"close",
              "nameList":[{
                  "name":"apk-xxxx",
                  "signList":["xxxxxx","xxxxx","xxxx","xx"]
              }]
          }
          
  • If the DefenseType parameter is set to bot_wxbb, the value of the Rule parameter consists of the following parameters:
    • name: required. The name of the rule. Data type: string.
    • uri: required. The keyword of the URL path that you want to protect. The path must start with a forward slash (/). This parameter is a JSON string that consists of the following parameters. Data type: string.
    • matchType: required. The match method. Data type: string. Valid values: all (exact match), prefix (prefix match), regex (regular match).
    • arg: required. The included parameters. This parameter specifies a URL path in combination with the matchType parameter. Data type: string.
    • action: required. The action that is performed after the rule is matched. Data type: string. Valid values:
      • test: monitors requests.
      • close: blocks requests.
    • hasTag: required. This parameter specifies whether to add a custom signature field. Data type: Boolean.
      • true: In this case, you must set the wxbbVmpFieldType and wxbbVmpFieldValue parameters to specify the type and value of the field.
      • false
    • wxbbVmpFieldType: optional. The type of the signature field. Data type: integer. If you set the hasTag parameter to true, you must also specify this parameter. Valid values:
      • 0: header
      • 1: parameter
      • 2: cookie
    • wxbbVmpFieldValue: optional. The value of the signature field. Data type: string. If you set the hasTag parameter to true, you must also specify this parameter.
    • blockInvalidSign: required. This parameter specifies whether to take actions on an invalid signature. Data type: integer. Set the value to 1. The value 1 specifies that the default protection policy for path protection rules is enabled.
    • blockProxy: optional. This parameter specifies whether to take actions on a proxy. Data type: integer. Set the value to 1. If you do not need to perform actions on the proxy, you can leave this parameter unspecified.
    • blockSimulator: optional. This parameter specifies whether to take actions on a simulator. Data type: integer. Set the value to 1. If you do not need to perform actions on the simulator, you can leave this parameter unspecified.
    • Example
      
          {
              "name":"test",
              "uri":"/index",
              "matchType":"all",
              "arg":"test",
              "action":"close",
              "hasTag":true,
              "wxbbVmpFieldType":2,
              "wxbbVmpFieldValue":"test",
              "blockInvalidSign":1,
              "blockProxy":1
          }
          
  • If the DefenseType parameter is set to ac_custom, the value of the Rule parameter varies based on the scene parameter.
    • To create an ACL rule, set the scene parameter to custom_acl. The value of the Rule parameter consists of the following parameters:
      • name: required. The name of the rule. Data type: string.
      • scene: required. The type of the protection policy. Data type: string. If you want to create an ACL rule, set the value to custom_acl.
      • action: required. The action that is performed after the rule is matched. Data type: string. Valid values:
        • monitor: monitors requests.
        • captcha: performs slider CAPTCHA verification.
        • captcha_strict: performs strict slider CAPTCHA verification.
        • js: performs JavaScript verification.
        • block: blocks requests.
      • conditions: required. The match condition. You can specify a maximum of five match conditions. Data type: array. This parameter is a JSON string that consists of the following parameters:
        • key: the match item. Value values URL, IP, Referer, User-Agent, Params, Cookie, Content-Type, Content-Length, X-Forwarded-For, Post-Body, Http-Method, Header, and URLPath.
        • opCode: the logical operator. Valid values:
          Note When you create a custom rule, the available logical operators (opCode) vary based on the match item (key). For more information about the logical operators that are available for each match item, log on to the WAF console. The information that is displayed in the WAF console shall prevail.
          • 11: equals to
          • 10: does not equal to
          • 41: equals to one of multiple values
          • 50: does not equal to any value
          • 1: includes
          • 0: does not include
          • 51: includes one of multiple values
          • 52: does not include any value
          • 82: exists
          • 2: does not exist
          • 21: length equal to
          • 22: length greater than
          • 20: length less than
          • 60: does not match a regular expression
          • 61: matches a regular expression
          • 72: matches a prefix
          • 81: matches a suffix
          • 80: empty content
        • values: the match value. You can specify this parameter based on your business requirements. Data type: string.
          Note The valid values of the opCode and values parameters in the match conditions vary based on the key parameter. For more information about match conditions, see Fields in match conditions.
      • Example
        
                {
                    "action":"monitor",
                    "name":"test",
                    "scene":"custom_acl",
                    "conditions":[{"opCode":1,"key":"URL","values":"/example"}]
                }
                
    • To create an HTTP flood protection rule, set the scene parameter to custom_acl. The value of the Rule parameter consists of the following parameters:
      • name: required. The name of the rule. Data type: string.
      • scene: required. The type of the protection policy. Data type: string. If you want to create an HTTP flood protection rule, set the value to custom_cc.
      • conditions: required. The match condition. You can specify a maximum of five match conditions. Data type: array. This parameter is a JSON string that consists of the following parameters:
        • key: the match item. Value values URL, IP, Referer, User-Agent, Params, Cookie, Content-Type, Content-Length, X-Forwarded-For, Post-Body, Http-Method, Header, and URLPath.
        • opCode: the logical operator. Valid values:
          Note When you create a custom rule, the available logical operators (opCode) vary based on the match item (key). For more information about the logical operators that are available for each match item, log on to the WAF console. The information that is displayed in the WAF console shall prevail.
          • 11: equals to
          • 10: does not equal to
          • 41: equals to one of multiple values
          • 50: does not equal to any value
          • 1: includes
          • 0: does not include
          • 51: includes one of multiple values
          • 52: does not include any value
          • 82: exists
          • 2: does not exist
          • 21: length equal to
          • 22: length greater than
          • 20: length less than
          • 60: does not match a regular expression
          • 61: matches a regular expression
          • 72: matches a prefix
          • 81: matches a suffix
          • 80: empty content
        • values: the match value. You can specify this parameter based on your business requirements. Data type: string.
          Note The valid values of the opCode and values parameters in the match conditions vary based on the key parameter.
      • action: required. The action that is performed after the rule is matched. Data type: string. Valid values:
        • monitor: monitors requests.
        • captcha: performs slider CAPTCHA verification.
        • captcha_strict: performs strict slider CAPTCHA verification.
        • js: performs JavaScript verification.
        • block: blocks requests.
      • ratelimit: required. The maximum rate of requests from an object. Data type: JSON string. This parameter is a JSON string that consists of the following parameters:
        • target: required. The type of the object whose request rate is calculated. Data type: string. Valid values:
          • remote_addr: IP addresses.
          • cookie.acw_tc: sessions.
          • queryarg: custom parameters. If you use custom parameters, you must specify the name of the custom parameter in the subkey parameter.
          • cookie: custom cookies. If you use custom cookies, you must specify the cookie content in the subkey parameter.
          • header: custom headers. If you use custom headers, you must specify the header content in the subkey parameter.
        • subkey: This parameter is required only when you set the target parameter to cookie, header, or queryarg. The subkey parameter is optional. Data type: string.
        • interval: required. The period during which the number of requests from the specified object is calculated. This parameter must be used together with the threshold parameter. Data type: integer. Unit: seconds.
        • threshold: required. During the specified period, the maximum number of requests that are allowed from an individual object. Data type: integer.
        • status: optional. The frequency of an HTTP status code. Data type: JSON string. This parameter is a JSON string that consists of the following parameters:
          • code: required. The specified HTTP status code. Data type: integer.
          • count: optional. The threshold for the number of times that the specified HTTP status code is returned. The threshold is used to determine whether a rule is matched. If an actual number is greater than the threshold, the rule specified by the name parameter is matched. Data type: integer. Valid values: 1 to 999999999. You can set the count or ratio parameter. You cannot set both parameters at the same time.
          • ratio: optional. The threshold for the percentage of times that the specified HTTP status code is returned. The threshold is used to determine whether a rule is matched. If an actual percentage is greater than the threshold, the rule specified by the name parameter is matched. Data type: integer. Valid values: 1 to 100. You can set the count or ratio parameter. You cannot set both parameters at the same time.
        • scope: required. This parameter specifies the scope in which the settings take effect. Data type: string. Valid values:
          • rule: objects that match the specified conditions
          • domain: the domain names to which the rule is applied
        • ttl: required. The period during which the specified action is performed. Data type: integer. Valid values: 60 to 86400.
      • Example
        
                {
                    "name":"HTTP flood protection rule",
                    "conditions":[{"opCode":1,"key":"URL","values":"/example"}],
                    "action":"block", 
                    "scene":"custom_cc",  
                    "ratelimit":{
                        "target": "remote_addr", 
                        "interval": 300,
                        "threshold": 2000,
                        "status": {
                            "code": 404,
                            "count": 200
                        },
                        "scope": "rule",
                        "ttl": 1800
                    }
                }
                
  • If the DefenseType parameter is set to whitelist, the value of the Rule parameter consists of the following parameters:
    • name: required. The name of the rule. Data type: string.
    • tags: required. The protection module that skips detection. You can specify multiple modules. Data type: array. Valid values:
      • waf: website whitelist
      • cc: HTTP flood protection
      • customrule: custom protection policy
      • blacklist: IP address blacklist
      • antiscan: scan protection
      • regular: Protection Rules Engine
      • deeplearning: deep learning
      • antifraud: data risk control
      • dlp: data leak prevention
      • tamperproof: website tamper-proofing
      • bot_intelligence: bot threat intelligence
      • bot_algorithm: intelligent algorithm
      • bot_wxbb: app protection
      • regular_rule: the specified rule in Protection Rules Engine
      • regular_type: the specified rule type in Protection Rules Engine
    • regularRules: optional. The IDs of the rules that skip detection. Data type: array. If the value of the tags parameter contains regular_rule, the regularRules parameter is required. You can view the IDs of the rules when you create a rule group. To create a rule group, go to the WAF console and click Protection Rule Group. On the page that appears, click Create Rule Group. For more information, see Customize protection rule groups.
    • regularTypes: optional. The types of rules that skip detection. Data type: array. If the value of the tags parameter includes regular_type, the regularTypes parameter is required. Valid values:
      • sqli: SQL injection
      • xss: cross-site scripting
      • code_exec: code execution
      • crlf: carriage return line feed (CRLF) injection
      • lfilei: local file inclusion
      • rfilei: remote file inclusion
      • webshell: webshell
      • csrf: cross site request forgery (CSRF)
      • vvip: custom protection rules
      • other: other types
    • conditions: required. The match condition. You can specify a maximum of five match conditions. Data type: array. This parameter is a JSON string that consists of the following parameters:
      • key: the match item. Value values URL, IP, Referer, User-Agent, Params, Cookie, Content-Type, Content-Length, X-Forwarded-For, Post-Body, Http-Method, Header, and URLPath.
      • opCode: the logical operator. Valid values:
        Note When you create a custom rule, the available logical operators (opCode) vary based on the match item (key). For more information about the logical operators that are available for each match item, log on to the WAF console. The information that is displayed in the WAF console shall prevail.
        • 11: equals to
        • 10: does not equal to
        • 41: equals to one of multiple values
        • 50: does not equal to any value
        • 1: includes
        • 0: does not include
        • 51: includes one of multiple values
        • 52: does not include any value
        • 82: exists
        • 2: does not exist
        • 21: length equal to
        • 22: length greater than
        • 20: length less than
        • 60: does not match a regular expression
        • 61: matches a regular expression
        • 72: matches a prefix
        • 81: matches a suffix
        • 80: empty content
      • values: the match value. You can specify this parameter based on your business requirements. Data type: string.
        Note The valid values of the opCode and values parameters in the match conditions vary based on the key parameter.
    • Example
      
          {
              "name": "test",
              "tags": ["cc","customrule"],
              "conditions":[{"opCode":1,"key":"URL","values":"/example"}],
         }
         

Response parameters

Parameter Type Example Description
RequestId String D7861F61-5B61-46CE-A47C-6B19160D5EB0

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateProtectionModuleRule
&Domain=www.example.com
&InstanceId=waf_elasticity-cn-0xldbqt****
&DefenseType=ac_custom
&Rule= {"action":"monitor","name":"test","scene":"custom_acl","conditions":[{"opCode":1,"key":"URL","values":"/example"}]}
&<Common request parameters>

Sample success responses

XML format

<CreateProtectionModuleRuleResponse>
      <RequestId>D7861F61-5B61-46CE-A47C-6B19160D5EB0</RequestId>
</CreateProtectionModuleRuleResponse>

JSON format

{
    "RequestId": "D7861F61-5B61-46CE-A47C-6B19160D5EB0"
}

Error codes

For a list of error codes, visit the API Error Center.