1
1
# Fail2ban for easyengine-docker quick start
2
2
## 1. Download docker-compose.yml, fail2ban.env, jail and filter:
3
3
``` 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}
5
5
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
8
8
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
12
12
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
14
14
```
15
15
## 2. Add your sites logs
16
16
``` bash
17
- vi . /docker-compose.yml
17
+ vi /opt/fail2ban /docker-compose.yml
18
18
```
19
19
## 3. Run
20
20
``` bash
@@ -24,7 +24,7 @@ sudo docker compose up -d
24
24
## 4 More
25
25
Use Cloudflare WAF
26
26
``` 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
28
28
29
29
# And change your cfzone and cftoken
30
30
```
0 commit comments