- 授权认证
- 站点安全事件统计
- 客户资产配置
- 资产安全策略配置
- 站点安全策略配置(old)
- 站点策略配置管理
- 封禁动作配置
- Session封禁配置
- IP封禁
- UA封禁管理
- Session封禁管理
- 指定策略设置封禁POST
- 自定义规则配置
- syslog配置
- http访问控制
- 站点一键接受
- 规则升级
- 自定义策略规则配置
新增HTTP访问控制
已测完
POST
https://localhost:50123/rest/v3/policy/httpacl
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Header 参数
Nonce
string
可选
示例值:
12345
Timestamp
string
可选
示例值:
1663751393
Body 参数text/plain
示例
示例值:[ {
"policy": {
"id": "886433",
"name": "ggg",
"desc": "qqsdfsdfsdfq",
"alarm": "true",
"http_action": {
"type": 2,
"redirect_url": "",
"response_code": "",
"response_filename": ""
},
"ip_ban": "unblock",
"ua_ban": "unblock",
"session_ban" : "unblock"
},
"host": {
"enabled": "true",
"op": "contains",
"desc": "www.baidu.com",
"encode": "utf-8",
"pattern": "www.baidu.com",
"case_sensitive": "false"
},
"path": {
"enabled": "true",
"op": "dmatches",
"original": "/aaaa",
"encode": "utf-8",
"pattern": "/aaaa",
"case_sensitive": "false"
},
"methods": {
"enabled": "true",
"op": "belongs",
"method": ["GET"]
},
"client_ip": {
"enabled": "true",
"op": "belongs",
"ips": [{
"start": "10.67.10.173",
"end": "10.67.10.173"
}]
}
}]
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://localhost:50123/rest/v3/policy/httpacl' \
--header 'Content-Type: text/plain' \
--data-raw '[ {
"policy": {
"id": "886433",
"name": "ggg",
"desc": "qqsdfsdfsdfq",
"alarm": "true",
"http_action": {
"type": 2,
"redirect_url": "",
"response_code": "",
"response_filename": ""
},
"ip_ban": "unblock",
"ua_ban": "unblock",
"session_ban" : "unblock"
},
"host": {
"enabled": "true",
"op": "contains",
"desc": "www.baidu.com",
"encode": "utf-8",
"pattern": "www.baidu.com",
"case_sensitive": "false"
},
"path": {
"enabled": "true",
"op": "dmatches",
"original": "/aaaa",
"encode": "utf-8",
"pattern": "/aaaa",
"case_sensitive": "false"
},
"methods": {
"enabled": "true",
"op": "belongs",
"method": ["GET"]
},
"client_ip": {
"enabled": "true",
"op": "belongs",
"ips": [{
"start": "10.67.10.173",
"end": "10.67.10.173"
}]
}
}]'
返回响应
🟢200成功
application/json
Body
object {0}
示例
[{"client_ip":{"ips":[{"start":"10.67.10.173","end":"10.67.10.173"}],"enabled":"true","op":"belongs"},"methods":{"enabled":"true","method":["GET"],"op":"belongs"},"host":{"pattern":"www.baidu.com","enabled":"true","case_sensitive":"false","encode":"utf-8","op":"contains","desc":"www.baidu.com"},"result":"success","policy":{"name":"ggg","http_action":{"response_code":"","type":"2","response_filename":"","redirect_url":""},"alarm":"true","session_ban":"unblock","ip_ban":"unblock","ua_ban":"unblock","id":"886433","desc":"qqsdfsdfsdfq"},"path":{"pattern":"\/aaaa","enabled":"true","case_sensitive":"false","encode":"utf-8","original":"\/aaaa","op":"dmatches"}}]
修改于 2022-09-27 09:32:12