You can call this operation to enable or disable the protection of a specified WAF feature, such as web intrusion prevention, data security, advanced protection, Bot management, and access control or throttling.

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


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 Boolean No ModifyProtectionModuleStatus

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

DefenseType String No waf

The protection module. Valid values:

  • waf: the RegEx protection engine
  • dld: the big data deep learning engine
  • tamperproof: tamper protection
  • antihijack: web page anti-hijacking
  • dlp: data leakage prevention
  • normalized: positive security model
  • bot_crawler: valid crawlers
  • bot_intelligence: Bot Threat Intelligence
  • antifraud: data risk control
  • bot_algorithm: intelligent algorithm
  • bot_wxbb: App Protection
  • bot_wxbb_pkg: version protection in App protection
    Note After you enable the version protection function, callCreateProtectionModuleRule to create version protection rules that specify the permitted valid versions.
  • cc: HTTP flood protection
  • ac_blacklist: the IP blacklist.
  • ac_highfreq: block high-frequency Web attacks in the scanning protection module
  • ac_dirscan: directory traversal protection
  • ac_scantools: scan tools in the scan protection module are blocked.
  • ac_collaborative: collaborative defense
  • ac_custom: custom protection policies
Domain String No

The domain name that has been added to WAF.

InstanceId String No waf_elasticity-cn-0xldbqtm005

The ID of the WAF instance.

Note You can call the DescribeInstanceInfo operation to query the ID of the WAF instance.
ModuleStatus Integer Yes 1

The status of the specified protection module. Valid values:

  • 0: disables the feature
  • 1: enables protection

Response parameters

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

The ID of the request.


Sample request

http(s)://[Endpoint]/? Action=ModifyProtectionModuleStatus
&<Common request parameters>

Sample success responses

XML format


JSON format


Error codes.

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