Advertisement
Typhoon

Fail2Ban NGINX-AUTH

Mar 24th, 2015
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.73 KB | None | 0 0
  1. 0) Fail2Ban filter for Elasticsearch behind NGINX Proxy with password file auth.
  2. 1) Add this to : /etc/fail2ban/jail.conf
  3.  
  4. ################################
  5. # NGINX AUTH for Elasticsearch
  6. [nginx-auth]
  7.  
  8. enabled = true
  9. filter  = nginx-auth
  10. action  = iptables-multiport[name=nginx-auth,port="80,443,9200"]
  11. logpath = /var/log/nginx/error.log
  12. ################################
  13.  
  14. 2) Create file /etc/fail2ban/filter.d/nginx-auth.conf with this inside :
  15.  
  16. ################################
  17. [Definition]
  18.  
  19. failregex = no user/password was provided for basic authentication.*client: <HOST>
  20.             user .* was not found in.*client: <HOST>
  21.             user .* password mismatch.*client: <HOST>
  22.  
  23. ignoreregex =
  24. ################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement