Create a gist now

Instantly share code, notes, and snippets.

@dz0ny /waf_live.js Secret
Created Nov 2, 2015

What would you like to do?
// 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