Skip to content

Instantly share code, notes, and snippets.

@dz0ny
Created November 2, 2015 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dz0ny/1c177010761d644776f0 to your computer and use it in GitHub Desktop.
Save dz0ny/1c177010761d644776f0 to your computer and use it in GitHub Desktop.
// Request based WAF
function process_client(ip, req_1m, req_5m, req_1h){
if (req_1m.5xx > 35) {
ban(ip);
}
}
function process_domain(domain, req_1m, req_5m, req_1h){
if (req_1h.5xx > 100) {
send_notice(domain);
}
if (req_1h.traffic > 100 * 1000 * 1000) { //In mb
to_varnish(domain);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment