我添加这个 api接口过白名单是正常的 全站js 也是开启的

redis-cli -a \((cat /opt/secrets/redis_password) SET security:bypass_rule:api_bypass_247962 '{ "id":"api_bypass_247962", "domain":"247962.ant-waf.com", "path":"~^/api/.*\)",
"method":"*",
"priority":150,
"description":"API接口白名单规则,仅匹配/api/开头的路径"
}'

curl -i http://127.0.0.1:9180/apisix/admin/routes/route_247962 -H "X-API-KEY: C8M2coDxAFISYB4spb3X8Rsxassjw1N1" -X PUT -d '
{
"status": 1,
"uri": "/*",
"plugins": {
"security-controller": {
"blacklist_expires": 43200,
"protection_level": 2,
"blacklist": {
"enabled": false,
"threshold": 5,
"expires": 43200
},
"auth_type": "progressive",
"rules": [],
"mode": "default",
"default_policy": {
"protection_level": 2,
"auth_type": "progressive",
"enabled": true,
"blacklist": {
"enabled": true,
"threshold": 5,
"expires": 43200
},
"advanced_firewall": {
"auth_cookie_name": "security_auth_token",
"auth_type": "progressive",
"enabled": true,
"redis_database": 0,
"captcha_threshold": 3,
"cookie_age": 86400,
"js_threshold": 10,
"redis_host": "127.0.0.1",
"blacklist_threshold": 5,
"redis_port": 6379,
"storage_type": "redis"
},
"js_protection": {
"enabled": true,
"threshold": 2,
"expires": 3600
},
"captcha_protection": {
"enabled": true,
"threshold": 3,
"expires": 7200
}
},
"enabled": true,
"js_protection": {
"action": "block",
"timeout": 5,
"expires": 3600,
"threshold": 10,
"enabled": true
},
"js_threshold": 10,
"whitelist": [],
"captcha_expires": 7200,
"js_expires": 3600,
"blacklist_threshold": 5,
"captcha_threshold": 3,
"captcha_protection": {
"action": "block",
"timeout": 300,
"expires": 7200,
"threshold": 3,
"enabled": true
}
}
},
"priority": 100,
"host": "247962.ant-waf.com",
"id": "route_247962",
"upstream": {
"type": "roundrobin",
"hash_on": "vars",
"scheme": "http",
"nodes": {"172.247.244.139:8000":1},
"pass_host": "pass"
}
}'

posted @ 2025-07-07 18:20  昆仑葫芦  阅读(0)  评论(0)    收藏  举报