This API is used to create a policy.
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
name |
Yes |
String |
Specifies the policy name. The maximum length is 256 characters. Only digits, letters, underscores (_), and hyphens (-) are allowed. |
Parameter |
Type |
Description |
|---|---|---|
id |
String |
Specifies the instance ID. |
name |
String |
Specifies the policy name. |
options |
Specifies whether a protection rule is enabled. |
|
action |
Specifies the mode of Basic Web Protection. The default value is log.
|
|
level |
Integer |
Specifies the protection level.
|
full_detection |
Boolean |
Specifies the detection mode in Precise Protection. |
hosts |
Array |
Specifies the domain IDs. |
timestamp |
Long |
Specifies the time when a policy is created. |
Parameter |
Type |
Description |
|---|---|---|
webattack |
Boolean |
Specifies whether Basic Web Protection is enabled. By default, this function is enabled.
|
common |
Boolean |
Specifies whether General Check in Basic Web Protection is enabled. By default, this function is enabled.
|
crawler |
Boolean |
Specifies whether the master crawler detection switch in Basic Web Protection is enabled. By default, this function is enabled.
|
crawler_engine |
Boolean |
Specifies whether the Search Engine switch in Basic Web Protection is enabled. By default, this function is disabled.
|
crawler_scanner |
Boolean |
Specifies whether the Scanner switch in Basic Web Protection is enabled. By default, this function is enabled.
|
crawler_script |
Boolean |
Specifies whether the Script Tool switch in Basic Web Protection is enabled. By default, this function is disabled.
|
crawler_other |
Boolean |
Specifies whether detection of other crawlers in Basic Web Protection is enabled. By default, this function is disabled.
|
webshell |
Boolean |
Specifies whether webshell detection in Basic Web Protection is enabled. By default, this function is disabled.
|
cc |
Boolean |
Specifies whether CC Attack Protection is enabled. By default, this function is enabled.
|
custom |
Boolean |
Specifies whether Precise Protection is enabled. By default, this function is enabled.
|
whiteblackip |
Boolean |
Specifies whether Blacklist and Whitelist is enabled. By default, this function is enabled.
|
privacy |
Boolean |
Specifies whether Data Masking is enabled. By default, this function is enabled.
|
Ignore |
Boolean |
Specifies whether False Alarm Masking is enabled. By default, this function is enabled.
|
antitamper |
Boolean |
Specifies whether Web Tamper Protection is enabled. By default, this function is enabled.
|
A policy named policy_1 is used as an example.
{
"name": "policy_1"
}
{
"id": "xxxxxxxxxxxxxxxxxxxxxxxxx",
"name": "policy_1",
"action": {
"category": "block"
},
"options": {
"webattack": true,
"common": true,
"crawler": true,
"crawler_engine": true,
"crawler_scanner": true,
"crawler_script": true,
"crawler_other": true,
"webshell": true,
"cc": true,
"custom": true,
"whiteblackip": true,
"ignore": true,
"privacy": true,
"antitamper": true
},
"level": 1,
"full_detection": false,
"hosts": [],
"timestamp": 1499817612
}
For details about error status codes, see Status Codes.