You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+12-20
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
-
# pyFilter
2
-
pyFilter aims to filter out all of the requests that are not legitimate to your server, and blocks them if too many are sent. It works by reading log files and checking if a failed request has came from the same IP address within a user configurable amount of time and adding rules to the firewall if too many attempts have been captured.
1
+
# PyFilter
2
+
PyFilter aims to filter out all of the requests that are not legitimate to your server, and blocks them if too many are sent. It works by reading log files and checking if a failed request has came from the same IP address within a user configurable amount of time and adding rules to the firewall if too many attempts have been captured.
3
3
4
-
By default pyFilter is configured to read from `/var/log/auth.log` for incoming SSH requests, however there are options for `Apache, Nginx and MySQL` too.
4
+
By default PyFilter is configured to read from `/var/log/auth.log` for incoming SSH requests, however there are options for `Apache, Nginx and MySQL` too.
5
5
6
-
pyFilter uses a database to store all the banned ip addresses to ensure ips arent added more than once. pyFilter currently supports sqlite and redis, by default it is setup to use sqlite so no installation of a redis server is needed. However redis has support for cross server ban syncing (more info below).
6
+
PyFilter uses a database to store all the banned ip addresses to ensure ips arent added more than once. PyFilter currently supports sqlite and redis, by default it is setup to use sqlite so no installation of a redis server is needed. However redis has support for cross server ban syncing (more info below).
7
7
8
8
Installation:
9
9
-------------
@@ -15,9 +15,9 @@ Optional:
15
15
-[py-redis](https://pypi.python.org/pypi/redis)
16
16
-[redis](https://redis.io)
17
17
18
-
To install pyFilter download the files from this repo via your preferred method, for example `git clone https://github.com/Jason2605/pyFilter.git`.
18
+
To install PyFilter download the files from this repo via your preferred method, for example `git clone https://github.com/Jason2605/PyFilter.git`.
19
19
20
-
**Optional:**`install.sh` will setup a service for pyFilter, and you can start/stop it by using `sudo systemctl start/stop pyFilter` and get the status of the pyFilter service using `sudo systemctl status pyFilter`. To run this make sure you give permission to the `install.sh` file `sudo chmod +x install.sh`.
20
+
**Optional:**`install.sh` will setup a service for PyFilter, and you can start/stop it by using `sudo systemctl start/stop PyFilter` and get the status of the PyFilter service using `sudo systemctl status PyFilter`. To run this make sure you give permission to the `install.sh` file `sudo chmod +x install.sh`.
21
21
22
22
**Note: The default configuration file runs on sqlite, so installing py-redis and redis are optional.**
23
23
@@ -49,7 +49,7 @@ Starting/stopping redis
49
49
Configuration:
50
50
-------------
51
51
52
-
- Copy the [default config file](https://github.com/Jason2605/pyFilter/blob/master/Config/config.default.json) and call it config.json.
52
+
- Copy the [default config file](https://github.com/Jason2605/PyFilter/blob/master/Config/config.default.json) and call it config.json.
53
53
```json
54
54
{
55
55
"settings": {
@@ -101,7 +101,7 @@ Configuration:
101
101
}
102
102
},
103
103
"sqlite": {
104
-
"database": "pyFilter.db"
104
+
"database": "PyFilter.db"
105
105
},
106
106
"redis": {
107
107
"host": "127.0.0.1",
@@ -135,7 +135,7 @@ To swap from sqlite to redis, change the current value `"database": "sqlite"` to
135
135
136
136
### Reload iptables
137
137
138
-
`iptables` is not persistant over restarts, so this setting will reload the table with the saved bans so far on launch and update the rules.
138
+
`iptables` is not persistent over restarts, so this setting will reload the table with the saved bans so far on launch and update the rules.
139
139
140
140
### Log files
141
141
@@ -164,7 +164,7 @@ The time format needs to match the log format to form a datetime object. For exa
164
164
165
165
### Ignored IP addresses
166
166
167
-
This is quite explanitory, if a regex matches however the IP address is within this list, it will be ignored so that IP address will not get banned.
167
+
This is quite explanatory, if a regex matches however the IP address is within this list, it will be ignored so that IP address will not get banned.
168
168
169
169
You can add more IPs
170
170
`"ignored_ips": ["127.0.0.1", "123.456.789.1"]`
@@ -179,15 +179,7 @@ Deny type is the way iptables will deal with the incoming packets, `DENY` is rec
179
179
180
180
### Failed attempts
181
181
182
-
Failed attempts is the number of matches that IP address needs to get trying to connect each rule for it to get blacklisted, for example `"failed_attempts": 5` 5 failed attempts on an SSH connection will get it banned, however 3 on SSH and 2 on MySQL will not get it banned, they are seperate.
183
-
184
-
### Run once
185
-
186
-
This setting will only run the script once and not check many times, useful if you want to create your own more advanced schedules.
187
-
188
-
### Check time
189
-
190
-
Check time is the amount of time in seconds it takes to do each rule, for example `"check_time": 600` check time is 600 seconds and there are 4 rules, there will be a gap of 150 seconds until the next rule is run, and a 600 second wait until the same rule is run again.
182
+
Failed attempts is the number of matches that IP address needs to get trying to connect each rule for it to get blacklisted, for example `"failed_attempts": 5` 5 failed attempts on an SSH connection will get it banned, however 3 on SSH and 2 on MySQL will not get it banned, they are separate.
191
183
192
184
### Redis - Optional
193
185
@@ -213,7 +205,7 @@ Enables/disables cross server ban syncing.
213
205
214
206
### Name
215
207
216
-
This is the name of the server, this **has** to be different for each server running pyFilter or the bans will not get synced properly. This name can be anything as long as it is unique, for example `"name": "VPS-Lon-1"`.
208
+
This is the name of the server, this **has** to be different for each server running PyFilter or the bans will not get synced properly. This name can be anything as long as it is unique, for example `"name": "VPS-Lon-1"`.
0 commit comments