Skip to content

Commit

Permalink
[docs] add fail2ban regex in the doc (#2189)
Browse files Browse the repository at this point in the history
  • Loading branch information
OniriCorpe committed Sep 11, 2023
1 parent b093947 commit 79906f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/advanced/security/firewall.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ Both SSHGuard and fail2ban ship with "backends" that can target iptables and nft
* [ArchWiki](https://wiki.archlinux.org/title/sshguard) on sshguard
* [FreeBSD manual](https://man.freebsd.org/cgi/man.cgi?query=sshguard&sektion=8&manpath=FreeBSD+13.2-RELEASE+and+Ports) for sshguard
* [SSHGuard setup](https://manpages.ubuntu.com/manpages/lunar/en/man7/sshguard-setup.7.html) manual for Ubuntu

For fail2ban, you can use the following regex, which triggers fail2ban on failed logins and not another 'Unauthorized' errors (API for example):

```regex
statusCode=401 path=/auth/sign_in clientIP=<HOST> .* msg=\"Unauthorized:
```

0 comments on commit 79906f9

Please sign in to comment.