fail2ban
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| fail2ban [2009/10/11 07:04] – k2patel | fail2ban [2020/08/10 02:35] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 77: | Line 77: | ||
| enabled | enabled | ||
| filter | filter | ||
| - | action | + | action |
| | | ||
| logpath | logpath | ||
| maxretry = 5 | maxretry = 5 | ||
| + | |||
| + | |||
| + | [kernel-iptables] | ||
| + | |||
| + | enabled | ||
| + | filter | ||
| + | action | ||
| + | | ||
| + | logpath | ||
| + | maxretry = 2 | ||
| + | |||
| Line 222: | Line 233: | ||
| ignoreip = 168.192.0.1 | ignoreip = 168.192.0.1 | ||
| </ | </ | ||
| + | |||
| + | NOTE : In above configuration i am using custom config file for " | ||
| + | which require you to create new file as below. | ||
| + | |||
| + | <code bash | / | ||
| + | # Fail2Ban configuration file | ||
| + | # | ||
| + | # Author: K2patel | ||
| + | # | ||
| + | # $Revision: 1 $ | ||
| + | # | ||
| + | |||
| + | [Definition] | ||
| + | |||
| + | # Option: | ||
| + | # Notes.: | ||
| + | # host must be matched by a group named " | ||
| + | # be used for standard IP/hostname matching and is only an alias for | ||
| + | # (?::: | ||
| + | # Values: | ||
| + | # | ||
| + | failregex = Treason uncloaked! Peer < | ||
| + | |||
| + | # Option: | ||
| + | # Notes.: | ||
| + | # Values: | ||
| + | # | ||
| + | ignoreregex = | ||
| + | </ | ||
| + | |||
| Restart service now | Restart service now | ||
| Line 262: | Line 303: | ||
| </ | </ | ||
| OR | OR | ||
| + | |||
| <code bash> | <code bash> | ||
| fail2ban-regex / | fail2ban-regex / | ||
| Line 268: | Line 310: | ||
| which provides you result if your strings match.\\ | which provides you result if your strings match.\\ | ||
| + | ==== Rotate log ==== | ||
| + | |||
| + | As your standard installation from distribution will generate log on the system.\\ | ||
| + | So it is necessary to rotate it to avoid any file limit.\\ | ||
| + | |||
| + | <code bash | / | ||
| + | / | ||
| + | weekly | ||
| + | rotate 7 | ||
| + | missingok | ||
| + | compress | ||
| + | size 4M | ||
| + | postrotate | ||
| + | / | ||
| + | endscript | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | If you do not have init script you can use following code to reload fail2ban as postrotate command. | ||
| + | |||
| + | <code bash> | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | NOTE : Path for fail2ban-client need to changed if you are using other than OpenSUSE | ||
| ==== Final Words ==== | ==== Final Words ==== | ||
fail2ban.1255244670.txt.gz · Last modified: 2020/08/10 02:30 (external edit)
