mirror of
https://github.com/Motion-Project/motion.git
synced 2026-01-31 18:11:41 -05:00
Create example for fail2ban
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
<li> <a href="#dnn_setup">DNN setup</a></li>
|
||||
<li> <a href="#haar_train">Haar Model Training</a></li>
|
||||
<li> <a href="#sound_sample">Sound Frequency Sample</a></li>
|
||||
<li> <a href="#fail2ban">Fail2Ban example</a></li>
|
||||
<p></p>
|
||||
<p></p>
|
||||
</ul>
|
||||
@@ -442,6 +443,56 @@
|
||||
|
||||
</ul>
|
||||
|
||||
<h3><a name="fail2ban"></a>Fail2Ban Example</h3>
|
||||
<ul>
|
||||
The following are example files to use with the fail2ban application. This allows users to ban IPs that
|
||||
may be attempting to get in. This example was created using Debian 11. Adjust as appropriate for other
|
||||
distros and versions.
|
||||
<br>
|
||||
Install fail2ban and create the following files:
|
||||
<br>File 1:
|
||||
<small><small><code><ul>
|
||||
<br> # Fail2Ban configuration file: /etc/fail2ban/filter.d/motionplus.conf
|
||||
<br> # Author: Mr Dave
|
||||
<br> #
|
||||
<br> [INCLUDES]
|
||||
<br> # Read common prefixes. If any customizations available -- read them from common.local
|
||||
<br> before = common.conf
|
||||
<br>
|
||||
<br> [Definition]
|
||||
<br> daemon = nsd
|
||||
<br>
|
||||
<br> # Option: failregex
|
||||
<br> # Notes.:
|
||||
<br> # regex to match the log in failures messages in the logfile. The
|
||||
<br> # host must be matched by a group named "host". The tag "<HOST>" can
|
||||
<br> # be used for standard IP/hostname matching and is only an alias for
|
||||
<br> # (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
|
||||
<br> # Sample: Jul 01 02:50:32 [EMG][STR][00:wc00] webu_failauth_check: Ignoring connection from: 192.168.1.10
|
||||
<br> # Values: TEXT
|
||||
<br>
|
||||
<br> failregex = ^.*Ignoring connection from: <HOST>$
|
||||
<br>
|
||||
<br> ignoreregex =
|
||||
<br>
|
||||
<br> datepattern = {^LN-BEG}Epoch
|
||||
<br> {^LN-BEG}
|
||||
<br>
|
||||
</ul></code></small></small>
|
||||
<br>File2:
|
||||
<small><small><code><ul>
|
||||
<br> #Fail2Ban Jail Configuration File: /etc/fail2ban/jail.d/motionplus-jail.conf
|
||||
<br> [motionplus]
|
||||
<br> enabled = true
|
||||
<br> filter = motionplus
|
||||
<br> logpath = /var/log/motionplus/motionplus.log
|
||||
<br> bantime = 23h
|
||||
<br> banaction = iptables-allports[blocktype="DROP"]
|
||||
<br> maxretry = 0
|
||||
<br> port = 0:65535
|
||||
</ul></code></small></small>
|
||||
<br>Make sure to adjust the log file location indicated in the jail file as well as how long to ban the IP address.
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user