防火墙配置
IP黑白名单
POST /firewall/IPBlock/
{
"type": 0, // 0:白名单,1:黑名单
"ip_list": ["127.0.0.1"],
"domain_uuid": "a63b3a21-7789-47e2-a2dd-a17c10f4fa9c"
}
GET /firewall/IPBlock/?domain_uuid=a63b3a21-7789-47e2-a2dd-a17c10f4fa9c&type=0
如已在增加接口添加数据,将返回
{
"code": 200,
"message": "成功",
"data": {
"domain_uuid": "a63b3a21-7789-47e2-a2dd-a17c10f4fa9c",
"type": true,
"ip_list": ["127.0.0.1"],
"active": true
}
}
{
"type": 1, // 0:白名单,1:黑名单
"active": true,
"domain_uuid": "a63b3a21-7789-47e2-a2dd-a17c10f4fa9c"
}
/firewall/IPBlock?domain_uuid=a63b3a21-7789-47e2-a2dd-a17c10f4fa9c&type=1&ip_list=127.0.0.1
type
改成1
即可URL黑白名单
POST /firewall/URLBlock
{
"type": 1, // 1:白名单,0:黑名单
"url_list": ["/sss"],
"domain_uuid": "727d45a1-1d42-4b9e-8e32-ab057b0de689"
}
GET /firewall/URLBlock?domain_uuid=727d45a1-1d42-4b9e-8e32-ab057b0de689&type=1
{
"code": 200,
"message": "成功",
"data": {
"domain_uuid": "727d45a1-1d42-4b9e-8e32-ab057b0de689",
"type": 1,
"url_list": ["/sss"],
"active": false
}
}
PUT /firewall/URLBlock
{
"type": 1, // 0:白名单,1:黑名单
"active": true,
"domain_uuid": "727d45a1-1d42-4b9e-8e32-ab057b0de689"
}
DEL /firewall/URLBlock?domain_uuid=abdb9c19-8d02-48b4-909e-2c628c500f97&type=1&url_list=/sss
防CC
PUT /firewall/cc/
{
"domain_uuid": "abdb9c19-8d02-48b4-909e-2c628c500f97",
"config": {
"site": {
"active": false,
"global_concurrent": 10,
"policy": "block",
"blockminutes": 10,
"waitseconds": 10,
"waitpolicyminutes": 10,
"redirectlocation": "/xxxxx",
"redirectwaitseconds": 10,
"url_rates": [
{
"url": "http://jnhyuaz.bd/hbkjz",
"rate": 20
}
]
},
"resuest_rate": {
"active": true,
"rate": 3,
"concurrency": 100,
"challengePolicy": "js",
"protectMinutes": 10,
"whiteMinutes": 10,
"challengeMethod": [
"GET",
"POST"
],
"challengeLimit": 25,
"blockMinutes": 42,
"excludeExt": "/sss",
"cookieName": "cookieName",
"url_rates": [
{
"url": "http://tfyyso.in/fbkefa",
"rate": 9
}
]
}
},
"active": true
}
GET /firewall/cc?domain_uuid=abdb9c19-8d02-48b4-909e-2c628c500f97
{
"code": 200,
"message": "成功",
"data": {
"domain_uuid": "abdb9c19-8d02-48b4-909e-2c628c500f97",
"config": {
"site": {
"active": false,
"global_concurrent": 10,
"policy": "block",
"blockminutes": 10,
"waitseconds": 10,
"waitpolicyminutes": 10,
"redirectlocation": "/xxxxx",
"redirectwaitseconds": 10,
"url_rates": [
{
"url": "http://jnhyuaz.bd/hbkjz",
"rate": 20
}
]
},
"resuest_rate": {
"active": true,
"rate": 3,
"concurrency": 100,
"challengePolicy": "js",
"protectMinutes": 10,
"whiteMinutes": 10,
"challengeMethods": [
"GET"
],
"challengeLimit": 25,
"blockMinutes": 42,
"excludeExt": "/sss",
"cookieName": "cookieName",
"url_rates": [
{
"url": "http://tfyyso.in/fbkefa",
"rate": 9
}
]
}
},
"active": true
}
}
防盗链
PUT /firewall/referer/
{
"domain_uuid": "abdb9c19-8d02-48b4-909e-2c628c500f97",
"domains": ["www.ddd.com"],
"allow_empty": true,
"type":1,
"active": true
}
GET /firewall/referer?domain_uuid=abdb9c19-8d02-48b4-909e-2c628c500f97
{
"code": 200,
"message": "成功",
"data": {
"domain_uuid": "abdb9c19-8d02-48b4-909e-2c628c500f97",
"config": {
"type": true,
"domains": [
"www.ddd.com"
],
"allow_empty": true,
"active": false
}
}
}
精准访问控制
POST /firewall/AccessControl/
{
"domain_uuid": "727d45a1-1d42-4b9e-8e32-ab057b0de689",
"rule": "url=1",
"reject": false,
"active": false
}
GET /firewall/AccessControl/?domain_uuid=727d45a1-1d42-4b9e-8e32-ab057b0de689
{
"code": 200,
"message": "成功",
"data": {
"domain_uuid": "abdb9c19-8d02-48b4-909e-2c628c500f97",
"config": {
"415c473b-bd3e-4228-a058-0467e2ca6b97": {
"reject": false,
"rule": "url=1",
"access_uuid": "415c473b-bd3e-4228-a058-0467e2ca6b97"
}
},
"active": false
}
}
DELETE /firewall/AccessControl/?domain_uuid=727d45a1-1d42-4b9e-8e32-ab057b0de689&access_uuid=c25f8f17-0bc5-4bec-b250-3aa7b163da96
区域访问限制
POST /firewall/region/
通过增加接口可以修改 active 的开关
{
"domain_uuid": "727d45a1-1d42-4b9e-8e32-ab057b0de689",
"regions": ["陕西"],
"active": false
}
GET /firewall/region/?domain_uuid=727d45a1-1d42-4b9e-8e32-ab057b0de689
{
"code": 200,
"message": "成功",
"data": {
"domain_uuid": "727d45a1-1d42-4b9e-8e32-ab057b0de689",
"config": {
"regions": [
"陕西",
"山西"
]
}
}
}
DELETE /firewall/region/?domain_uuid=727d45a1-1d42-4b9e-8e32-ab057b0de689®ions=山西,陕西
APP专用防CC策略
POST /firewall/ccforapp
{
"domain_uuid": "abdb9c19-8d02-48b4-909e-2c628c500f97",
"key": "key",
"header": "he_name",
"hash": "md5",
"active": true
}
GET /firewall/ccforapp/?domain_uuid=abdb9c19-8d02-48b4-909e-2c628c500f97
{
"code": 200,
"message": "成功",
"data": {
"domain_uuid": "abdb9c19-8d02-48b4-909e-2c628c500f97",
"config": {
"key": "key",
"header": "ss",
"hash": "md5",
"active": true
}
}
}
内容安全风控:关键字
POST /firewall/content/keywords/
{
"domain_uuid":"abdb9c19-8d02-48b4-909e-2c628c500f97",
"keywords": ["key"],
"gzip": false,
"active": false
}
GET /firewall/content/keywords/?domain_uuid=abdb9c19-8d02-48b4-909e-2c628c500f97
{
"code": 200,
"message": "成功",
"data": {
"domain_uuid": "abdb9c19-8d02-48b4-909e-2c628c500f97",
"config": {
"gzip": false,
"keywords": [
"key"
],
"active": false
}
}
}
内容安全风控:图片
POST /firewall/content/img/
{
"domain_uuid": "727d45a1-1d42-4b9e-8e32-ab057b0de689",
"active": false
}
GET /firewall/content/img/?domain_uuid=abdb9c19-8d02-48b4-909e-2c628c500f97
{
"code": 200,
"message": "成功",
"data": {
"domain_uuid": "abdb9c19-8d02-48b4-909e-2c628c500f97",
"config": {
"active": false
}
}
}
安全访问控制
POST /firewall/requestpwd
{
"domain_uuid":"abdb9c19-8d02-48b4-909e-2c628c500f97",
"config": {
"url": "sss",
"password": "sss"
}
}
GET /firewall/requestpwd?domain_uuid=abdb9c19-8d02-48b4-909e-2c628c500f97
{
"code": 200,
"message": "成功",
"data": {
"domain_uuid": "abdb9c19-8d02-48b4-909e-2c628c500f97",
"config": [
{
"url": "sss",
"password": "sss"
}
]
}
}
DELETE /firewall/requestpwd?domain_uuid=abdb9c19-8d02-48b4-909e-2c628c500f97
修改于 2023-06-07 17:01:06