Jump to content

fail2ban & cloudflare - help pls?

Featured Replies

Posted

I found this, and it worked perfectly when I did not use CloudFlare: https://rtcamp.com/tutorials/nginx/fail2ban/

However, I am currently using CloudFlare. I did some re-search and I found that these two commands would work to ban and unban:

actionban = curl -s "https://www.cloudflare.com/api.html?a=ban&key=<ip>&u=<account>&tkn=<token>"
actionunban = curl -s "https://www.cloudflare.com/api.html?a=nul&key=<ip>&u=<account>&tkn=<token>"

Does anyone know how I could use https://rtcamp.com/tutorials/nginx/fail2ban/ configuration, with CloudFlare API? 

I will obviously replace the toke and account my self.

Note:
- I am using nginx, where I limit requests also forward the real IP using set_real_ip_from. The reason why it was not working, was most likely because iptables can not see the real ip when user access, but fail2ban can using the access log.

Edited by Spendon Gavekort

  • Author

I found out how, was quiet easy.

  • 2 weeks later...

Post info plz, for all. Thanks.

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.