mirror of
https://gitea.com/gitea/docs.git
synced 2026-06-23 12:45:56 +00:00
fail2ban-setup: *.local instead of *.conf (#14)
`man 5 jail.conf`:
CONFIGURATION FILES FORMAT
*.conf files are distributed by Fail2Ban. It is recommended that *.conf files should remain unchanged to ease upgrades. If needed,
customizations should be provided in *.local files. For example, if you would like to enable the [ssh-iptables-ipset] jail specified
in jail.conf, create jail.local containing
Reviewed-on: https://gitea.com/gitea/docs/pulls/14
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
Co-authored-by: webracer999 <webracer999@noreply.gitea.com>
Co-committed-by: webracer999 <webracer999@noreply.gitea.com>
This commit is contained in:
committed by
techknowlogick
parent
ac6de8756f
commit
26f2306525
@@ -60,16 +60,16 @@ on a bad authentication from the web or CLI using SSH or HTTP respectively:
|
||||
2020/10/15 16:08:44 ...s/context/context.go:204:HandleText() [E] invalid credentials from xxx.xxx.xxx.xxx
|
||||
```
|
||||
|
||||
Add our filter in `/etc/fail2ban/filter.d/gitea.conf`:
|
||||
Add our filter in `/etc/fail2ban/filter.d/gitea.local`:
|
||||
|
||||
```ini
|
||||
# gitea.conf
|
||||
# gitea.local
|
||||
[Definition]
|
||||
failregex = .*(Failed authentication attempt|invalid credentials|Attempted access of unknown user).* from <HOST>
|
||||
ignoreregex =
|
||||
```
|
||||
|
||||
Add our jail in `/etc/fail2ban/jail.d/gitea.conf`:
|
||||
Add our jail in `/etc/fail2ban/jail.d/gitea.local`:
|
||||
|
||||
```ini
|
||||
[gitea]
|
||||
@@ -83,7 +83,7 @@ action = iptables-allports
|
||||
```
|
||||
|
||||
If you're using Docker, you'll also need to add an additional jail to handle the **FORWARD**
|
||||
chain in **iptables**. Configure it in `/etc/fail2ban/jail.d/gitea-docker.conf`:
|
||||
chain in **iptables**. Configure it in `/etc/fail2ban/jail.d/gitea-docker.local`:
|
||||
|
||||
```ini
|
||||
[gitea-docker]
|
||||
|
||||
Reference in New Issue
Block a user