Poison Nuke
16.09.16, 07:28
Hallo,
ich finde nirgendwo ein funktionierendes Beispiel für ein simples rate-limit mit mod_security. Sämtliche Beispiele die verfügbar sind, haben Syntax-Errors.
Hier das aktuellste:
<LocationMatch "^/(.*)">
#counts everything but images and such
SecAction initcol:ip=%{X-Forwarded-For},pass,nolog,id:4444446
SecAction "phase:5,deprecatevar:ip.mysiteconncounter=1/1,pass,nolog,id:4444447"
SecRule IP:MYSITECONNCOUNTER "@gt 150” “id:4444448,phase:2,pause:300,deny,status:509,sete nv:RATELIMITED,skip:1,nolog"
SecAction "id:4444449,phase:2,pass,setvar:ip.mysiteconncounte r=+1,nolog"
Header always set Retry-After "15" env=RATELIMITED
</LocationMatch>
ErrorDocument 509 "Rate Limit Exceeded"
Fehlermeldung lautet:
"ModSecurity: Rules must have at least id action"
was so aber nicht stimmt, da wie gefordert jede Rule eine id hat. Wo liegt hier das Problem?
ich finde nirgendwo ein funktionierendes Beispiel für ein simples rate-limit mit mod_security. Sämtliche Beispiele die verfügbar sind, haben Syntax-Errors.
Hier das aktuellste:
<LocationMatch "^/(.*)">
#counts everything but images and such
SecAction initcol:ip=%{X-Forwarded-For},pass,nolog,id:4444446
SecAction "phase:5,deprecatevar:ip.mysiteconncounter=1/1,pass,nolog,id:4444447"
SecRule IP:MYSITECONNCOUNTER "@gt 150” “id:4444448,phase:2,pause:300,deny,status:509,sete nv:RATELIMITED,skip:1,nolog"
SecAction "id:4444449,phase:2,pass,setvar:ip.mysiteconncounte r=+1,nolog"
Header always set Retry-After "15" env=RATELIMITED
</LocationMatch>
ErrorDocument 509 "Rate Limit Exceeded"
Fehlermeldung lautet:
"ModSecurity: Rules must have at least id action"
was so aber nicht stimmt, da wie gefordert jede Rule eine id hat. Wo liegt hier das Problem?