创建攻击惩罚规则
功能介绍
创建攻击惩罚规则
URI
POST /v1/edgesec/configuration/http/policies/{policy_id}/punishment-rule
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| policy_id | 是 | String | 策略id |
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| X-Auth-Token | 是 | String | auth token |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| description | 否 | String | 规则描述,最长512字符 |
| category | 是 | String | 拦截类型,可选值为:long_ip_block(长时间IP拦截)、long_cookie_block(长时间Cookie拦截)、long_params_block(长时间Params拦截)、short_ip_block(短时间IP拦截)、short_cookie_block(短时间Cookie拦截)、short_params_block(短时间Params拦截) |
| block_time | 是 | Integer | 拦截时间,如果选择前缀为long的攻击惩罚类别,则block_time时长范围设置为301-1800;选择前缀为short的攻击惩罚类别,则block_time时长范围为0-300之间 |
响应参数
状态码:200
| 参数 | 参数类型 | 描述 |
|---|---|---|
| id | String | 规则id |
| policy_id | String | 规则所在策略id |
| timestamp | Long | 创建规则时间戳 |
| description | String | 规则描述 |
| category | String | 拦截类型,可选值为:long_ip_block(长时间IP拦截)、long_cookie_block(长时间Cookie拦截)、long_params_block(长时间Params拦截)、short_ip_block(短时间IP拦截)、short_cookie_block(短时间Cookie拦截)、short_params_block(短时间Params拦截) |
| block_time | Integer | 拦截时长 |
状态码:400
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 标准化错误码:服务名.八位数字编码 |
| error_msg | String | 清晰的错误信息 |
| encoded_authorization_message | String | 对接IAM5.0的服务,拒绝访问时需要返回IAM的相关响应 |
状态码:401
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 标准化错误码:服务名.八位数字编码 |
| error_msg | String | 清晰的错误信息 |
| encoded_authorization_message | String | 对接IAM5.0的服务,拒绝访问时需要返回IAM的相关响应 |
状态码:500
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 标准化错误码:服务名.八位数字编码 |
| error_msg | String | 清晰的错误信息 |
| encoded_authorization_message | String | 对接IAM5.0的服务,拒绝访问时需要返回IAM的相关响应 |
请求示例
无
响应示例
无
状态码
| 状态码 | 描述 |
|---|---|
| 200 | OK |
| 400 | 请求失败 |
| 401 | token权限不足 |
| 500 | 服务器内部错误 |
错误码
请参见错误码。