mirror of https://github.com/fail2ban/fail2ban
Updated How to ban something other as host (IP address), like user or mail, etc. (markdown)
parent
66809c0552
commit
b77a6f8e3b
|
@ -48,6 +48,10 @@ Action config file `action.d/test-ban-user.local`:
|
|||
actionstart =
|
||||
actionstop =
|
||||
actioncheck =
|
||||
# v. 0.10:
|
||||
actionban = echo 'ban f2b-<name> --user "<fid>"'
|
||||
actionunban = echo 'unban f2b-<name> --user "<fid>"'
|
||||
# v. 0.9:
|
||||
actionban = echo 'ban f2b-<name> --user <ip>'
|
||||
actionunban = echo 'unban f2b-<name> --user <ip>'
|
||||
```
|
||||
|
@ -89,7 +93,7 @@ failregex = ^<F-ID>DDOS</F-ID> attack detected$
|
|||
* set small `bantime` (e. g. 1 second) to this "jail" (otherwise no "ban" action will be executed in this time, because "already banned" occurs), e. g. `bantime = 1`
|
||||
* you need to specify only `actionban` parameter in your custom action file:
|
||||
```INI
|
||||
actionban = /user/bin/ids-attack.sh '<fid>'
|
||||
actionban = /user/bin/ids-attack.sh "<fid>"
|
||||
```
|
||||
* `actionban` script will be executed as root (or with user, fail2ban running), so use `su` if other/restricted user needed;
|
||||
- set `usedns`, `ignoreip`, `ignorecommand` as suggested above, otherwise you can get error by comparison with empty/illegal host (that will be found by "failure");
|
||||
|
|
Loading…
Reference in New Issue