将IP列入白名单的自定义Mod安全规则阻止国家

时间:2020-01-16 13:22:53

标签: security block whitelist mod countries

我有一个能够阻止某些国家/地区正常运行的mod安全规则,但我需要能够将其中一个国家/地区的IP列入白名单,而我似乎做得不好。有谁知道如何使它起作用?任何帮助将不胜感激。

 # Test IP address and block by country code
SecRule REMOTE_ADDR "@geoLookup" "phase:1,chain,id:1,drop,nolog,msg:'Blocking %{geo.country_code}'"
SecRule GEO:COUNTRY_CODE "@pm AL AR AT AU BG BO BR CH CL CN CO CZ DK ES DE FI FR GB HU ID IE IL IN IR IT JP KE KR MY NL NO NZ PL PT RO RS SC SE SG TH TR TW UA VN ZA" 

SecRule REMOTE_ADDR "@IPMatch 11.222.333.444" "id:2,ctl:ruleRemoveById=1"

更新01/22:也没有运气尝试过这一点。

SecRule REMOTE_ADDR "@IPMatch 111.222.333.444,222.333.444.555" "phase:1,nolog,allow,ctl:ruleEngine=off,id:2"

0 个答案:

没有答案