我为 Apache 配置了 mod_security 和 GeoIP2。GeoLite2-Country.mmdbgeoipupdate
每周都会被 cron 触发下载。我的/etc/modsecurity/modsecurity.conf
配置如下:
SecRuleEngine On
SecRule ARGS:modsecparam "@contains test" "id:4321,deny,status:403,msg:'ModSecurity test rule has triggered'"
SecRule REMOTE_ADDR "@geoLookup" "chain,id:20000,deny,status:403,msg:'NON PL IP addresses'"
SecRule GEO:COUNTRY_CODE "!@streq PL"
...
我/etc/modsecurity/crs-setup.conf
对 GeoIP 数据库的看法:
SecGeoLookupDB /etc/modsecurity/GeoLite2-Country.mmdb
从我的本地机器运行 curl:curl 'https://host/login/index.html?modsecparam=test'
在日志中留下跟踪:
...
SecRule "TX:EXECUTING_PARANOIA_LEVEL" "@lt 2" "phase:1,auditlog,id:980013,nolog,skipAfter:END-RESPONSE-980-CORRELATION"
SecRule "ARGS:modsecparam" "@contains test" "phase:2,log,auditlog,id:4321,deny,status:403,msg:'ModSecurity test rule has triggered'"
SecRule "&TX:dos_burst_time_slice" "@eq 0" "phase:5,auditlog,id:912110,t:none,nolog,ver:OWASP_CRS/3.2.0,chain,skipAfter:END-DOS-PROTECTION-CHECKS"
SecRule "&TX:dos_counter_threshold" "@eq 0" "chain"
SecRule "&TX:dos_block_timeout" "@eq 0"
...
但是由于某种原因,它不会阻止除 PL 以外的国家/地区。我做错了什么?