11# Fail2ban for easyengine-docker quick start
22## 1. Download docker-compose.yml, fail2ban.env, jail and filter:
33``` bash
4- mkdir -p ./ fail2ban/data/{jail.d,filter.d,action.d} && cd fail2ban
4+ sudo mkdir -p /opt/ fail2ban/data/{jail.d,filter.d,action.d}
55
6- curl -o . /docker-compose.yml -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/docker-compose.yml
7- curl -o . /fail2ban.env -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/fail2ban.env
6+ sudo curl -o /opt/fail2ban /docker-compose.yml -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/docker-compose.yml
7+ sudo curl -o /opt/fail2ban /fail2ban.env -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/fail2ban.env
88
9- curl -o . /data/filter.d/sshd.local -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/filter.d/sshd.local
10- curl -o . /data/filter.d/nginx-req-limit.conf -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/filter.d/nginx-req-limit.conf
11- curl -o . /data/filter.d/wp-login-fail.conf -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/filter.d/wp-login-fail.conf
9+ sudo curl -o /opt/fail2ban /data/filter.d/sshd.local -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/filter.d/sshd.local
10+ sudo curl -o /opt/fail2ban /data/filter.d/nginx-req-limit.conf -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/filter.d/nginx-req-limit.conf
11+ sudo curl -o /opt/fail2ban /data/filter.d/wp-login-fail.conf -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/filter.d/wp-login-fail.conf
1212
13- curl -o . /data/jail.d/jail.local -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/jail.d/jail.local
13+ sudo curl -o /opt/fail2ban /data/jail.d/jail.local -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/jail.d/jail.local
1414```
1515## 2. Add your sites logs
1616``` bash
17- vi . /docker-compose.yml
17+ vi /opt/fail2ban /docker-compose.yml
1818```
1919## 3. Run
2020``` bash
@@ -24,7 +24,7 @@ sudo docker compose up -d
2424## 4 More
2525Use Cloudflare WAF
2626``` bash
27- curl -o . /data/jail.d/jail-cloudflare.local -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/jail.d/jail-cloudflare.local
27+ sudo curl -o /opt/fail2ban /data/jail.d/jail-cloudflare.local -L https://raw.githubusercontent.com/dinhngocdung/easyengine-docker-stack/refs/heads/main/fail2ban/jail.d/jail-cloudflare.local
2828
2929# And change your cfzone and cftoken
3030```
0 commit comments