Skip to content

Instantly share code, notes, and snippets.

@countryroadgraphics
Created January 30, 2017 18:58
Show Gist options
  • Save countryroadgraphics/be10063dbaaa4ae3960579a86bccb41d to your computer and use it in GitHub Desktop.
Save countryroadgraphics/be10063dbaaa4ae3960579a86bccb41d to your computer and use it in GitHub Desktop.
XML-RPC Modsec Rules
SecAction phase:1,nolog,pass,initcol:IP=%{REMOTE_ADDR},id:690010
<LocationMatch "/xmlrpc(\.php)?$">
SecAction phase:2,nolog,pass,deprecatevar:ip.count_a=1/20,id:690010
SecRule IP:COUNT_A "@gt 5" "phase:2,deny,status:403,log,msg:'WAF Rules : XMLRPC - Ratelimited to one call in 20 seconds',id:690012"
SecRule RESPONSE_BODY "fault(Code|String)" "phase:4,pass,nolog,setvar:ip.count_a=+1,id:690013"
</LocationMatch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment