-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from userjack6880/dev
Dev
- Loading branch information
Showing
6 changed files
with
95 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,38 @@ | ||
# RBL Updater Suite | ||
|
||
This is the RBL Updater Suite version 0 alpha-1.1 (0-α1.1) by John Bradley ([email protected]). The RBL Updater Suite is an Open Source suite of tools to be used in conjunction with rpsamd to help autogenerate a local realtime block list (RBL) not reliant on any external lists, such as spamhaus and the like. | ||
This is the RBL Updater Suite version 0 alpha-1.2 (0-α1.2) by John Bradley ([email protected]). The RBL Updater Suite is an Open Source suite of tools to be used in conjunction with rpsamd to help autogenerate a local realtime block list (RBL) not reliant on any external lists, such as spamhaus and the like. | ||
|
||
This software is extremely experimental and may cause collateral damage on deliverability. USE AT YOUR OWN RISK. | ||
|
||
# Suite Components | ||
|
||
## `monitor` | ||
|
||
This is the script that monitors your mail log for a `NOQUEUE: reject` message or a `milter-reject` message containing additional keywords `BLOCKLIST`, `spam`, or `Spam`. When it does that, it flags the IP address associated with the message, and performs a number of actions outlined under the Principle of Operation section of this Readme. | ||
|
||
## `report` | ||
|
||
This script is used to manually report an IP address or range. Regardless of previous infractions, it will always issue a 1-day ban based on the current time. This can inadvertantly shorten a ban if you are not careful. | ||
|
||
``` | ||
Usage: | ||
./report [OPTIONS] | ||
This script add to the database either an IP address or an IP Range. | ||
Options: | ||
-i [IPv4 Address] Adds a single IP address | ||
-n [CIDR Notation] Adds a CIDR notation network range | ||
-p Makes either IP address or network range permabanned | ||
``` | ||
|
||
## `generate_list` | ||
|
||
This script will create a plaintext file with the IP addresses and network ranges, deliminated by newlines, at the location specified in the config file. | ||
|
||
# Principle of Operation | ||
|
||
The script assumes that you have configured postfix in a way that it blocks misconfigured hosts attempting to connect to your mail server, already is blocking messages, and has rspamd installed and running. | ||
The `monitor` script assumes that you have configured postfix in a way that it blocks misconfigured hosts attempting to connect to your mail server, already is blocking messages, and has rspamd installed and running. | ||
|
||
Whenever an IP address gets blocked in the mail logs, the monitor script will flag the IP and increase the time it is banned. The ban gets more agressive the more the IP is flagged, ultimately ended up in prefix and asn bans as the issue worsens. | ||
|
||
|
@@ -23,6 +49,7 @@ For network prefixes, infractions and bans are given based on the number of indi | |
- On the third IP permaban, the prefix receives a 1 day ban. | ||
- Every additional IP permaban after the third results in a 1 week ban. | ||
- On the twenty-fifth (25th) IP permaban, the prefix is permanently banned. | ||
- Exception: if more than 5 IP addresses within a prefix have concurrent temporary bans at the same time, the prefix is issued a ban. | ||
|
||
Bans are cumulative, and infractions are permanently recorded. | ||
|
||
|
@@ -70,12 +97,14 @@ Install anywhere you want. Probably will want to run it as a privleged user, or | |
|
||
# Latest Changes | ||
|
||
## 0-α1.1 | ||
- Fixed bug where config file cannot be found if script is not run from the directory it's located in. | ||
|
||
## 0-α1 | ||
|
||
- Created the project. | ||
## 0-α1.2 | ||
- Fixed log regex for monitor script. | ||
- Added a case for where punishment is issued for a prefix has a ton of bad IPs that do not have their ban expirations timeout. | ||
- Fixed DB query column typo. | ||
- When an IP network range is added, on duplicate key it now adds ban expiration. | ||
- Added variation of `spam` to the keywords monitor looks for. | ||
- Fixed issue where script couldn't find the config file. | ||
- Fixed bug where script would die if it encountered a JSON error when doing a BGP Info Query. | ||
|
||
# Planned Features | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ $dbuser = ''; | |
$dbpass = ''; | ||
|
||
# version number | ||
$version = '0 alpha-1.1'; | ||
$version = '0 alpha-1.2'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters