45 lines
1.5 KiB
Markdown
45 lines
1.5 KiB
Markdown
# Mailcow-Ban-Check
|
|
|
|
This Bash script monitors a remote IP ban list, compares it with previously tracked IPs in SQLite, records changes, and sends notifications to a Discord-compatible webhook
|
|
|
|
# Still in development
|
|
# Not for Production
|
|
|
|
## !!! Important: the URLs placed into this script will contain credentials/access tokens or API Keys. Treat this script as sensitive. These credentials will be stored in a more secure way in a future update !!!
|
|
|
|
A Bash-based monitoring tool that tracks changes to a remote IP ban list.
|
|
|
|
The script downloads a ban list, compares it with previously tracked addresses in a local SQLite database, records new bans and removals, and sends notifications to a Discord-compatible webhook.
|
|
|
|
### Features
|
|
|
|
- Downloads a remote ban list over HTTPS
|
|
- Supports IPv4, IPv6, and CIDR notation
|
|
- Removes duplicates and surrounding whitespace
|
|
- Tracks active and inactive IP addresses
|
|
- Maintains a ban history
|
|
- Sends notifications for:
|
|
- Newly banned IPs
|
|
- IPs removed from the ban list
|
|
- Prevents overlapping executions with `flock`
|
|
- Supports cron and systemd timer execution
|
|
- Provides commands for viewing history, statistics, and active bans
|
|
|
|
### Requirements
|
|
|
|
The following commands must be installed:
|
|
|
|
- Bash
|
|
- `curl`
|
|
- `sqlite3`
|
|
- `jq`
|
|
- `flock`
|
|
- `awk`
|
|
- `sort`
|
|
- `comm`
|
|
- `date`
|
|
- `wc`
|
|
|
|
|
|
## !!! Important: the URLs placed into this script will contain credentials/access tokens or API Keys. Treat this script as sensitive. These credentials will be stored in a more secure way in a future update !!!
|