Skip to content

SysWarden is a tool based on the Data-Shield IPv4 Blocklists Community, Spamhaus ASN, Wazuh and Fail2ban that blocks up to 99% of noisy, disruptive, and malicious IP addresses and focuses on real signals.

License

Notifications You must be signed in to change notification settings

duggytuxy/syswarden

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

143 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

SysWarden Security Audit

Website ย ย โ€ขย ย  Issues Tracker ย ย โ€ขย ย  Linkedin ย ย โ€ขย ย  TryHackMe ย ย โ€ขย ย  Ko-Fi


Support me on Ko-fi

Alt

SysWarden

SysWarden Banner

SysWarden is a tool based on the Data-Shield IPv4 Blocklists Community, Wazuh and Fail2ban that blocks up to 99% of noisy, disruptive, and malicious IP addresses and focuses on real signals.

What Does SysWarden Protect

SysWarden acts as an advanced, preemptive shield for your infrastructure. By dropping known malicious traffic at the firewall (kernel) level before it even reaches your applications, it provides a crucial extra layer of security for any exposed asset.

  • It is highly recommended for securing:

    • Public VPS & Dedicated Servers: Protect your SSH ports, control panels, and core system services from relentless brute-force attacks and automated mass-scanning.
    • Websites & CMS (WordPress, Magento, etc.): Block bad bots, vulnerability scanners, and exploit attempts targeting your web servers (Nginx/Apache) before they consume your CPU and RAM.
    • Public APIs & SaaS Platforms: Keep your application resources dedicated to legitimate users. Prevent endpoint abuse, scrapers, and Layer 7 DDoS probes.
    • Critical Infrastructure: Add a robust perimeter defense for your business-critical applications and internal tools exposed to the internet.
    • Databases (MySQL, MongoDB, PostgreSQL): Shield your exposed or partially exposed data stores from credential stuffing, unauthorized access attempts, and ransomware gangs.

By eliminating the "background noise" of the internet, SysWarden ensures your servers remain fast, clean, and focused on serving real humans.

Architecture

๐Ÿ› ๏ธ SysWarden (Technology Stack)
โ”œโ”€โ”€ ๐Ÿš Core Orchestration
โ”‚   โ”œโ”€โ”€ ๐Ÿ“œ Bash Scripting           # Automation, Installation & Logic
โ”‚   โ””โ”€โ”€ ๐Ÿง Linux Kernel             # OS Support (Debian/Ubuntu & RHEL/Alma)
โ”‚
โ”œโ”€โ”€ ๐Ÿงฑ Firewall Backend (Auto-Detection)
โ”‚   โ”œโ”€โ”€ ๐Ÿ›ก๏ธ Nftables                 # Modern Packet Filtering (Debian 10+)
โ”‚   โ”œโ”€โ”€ ๐Ÿ”ฅ Firewalld                # Dynamic Zone Management (RHEL 8/9)
โ”‚   โ””โ”€โ”€ โšก IPSet + Iptables         # High-Performance Hashing (Legacy)
โ”‚
โ”œโ”€โ”€ ๐Ÿ‘ฎ Active Defense & Logs
โ”‚   โ”œโ”€โ”€ ๐Ÿ Python 3                 # Log Parsing & API Connector
โ”‚   โ”œโ”€โ”€ ๐Ÿšซ Fail2ban                 # Intrusion Prevention System (Jails)
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Systemd / Journalctl     # Service Management & Logging
โ”‚   โ””โ”€โ”€ โ™ป๏ธ Logrotate                # Log Maintenance & Compression
โ”‚
โ””โ”€โ”€ โ˜๏ธ External Integrations
    โ”œโ”€โ”€ ๐Ÿ“ฆ Data-Shield Repo         # Threat Intelligence Source (Git)
    โ”œโ”€โ”€ ๐Ÿ“ก AbuseIPDB API            # Community Reporting (Outbound)
    โ””โ”€โ”€ ๐Ÿฆ Wazuh XDR Agent          # SIEM & Vulnerability Detection

Key Features

  • Universal OS Support: Auto-detects and adapts to Debian, Ubuntu, CentOS Stream, Fedora, AlmaLinux, and Rocky Linux.

  • Intelligent Backend Detection: Automatically selects the best firewall technology present on your system:

    • Firewalld (CentOS Stream/Fedora/Alma/Rocky native integration)
    • Nftables (Modern Debian/Ubuntu standard)
    • IPSet/Iptables (Legacy support)
  • Smart Mirror Selection: Replaced ICMP Pings with TCP/HTTP latency checks to bypass firewall restrictions on GitHub/GitLab, ensuring you always download from the fastest mirror.

  • Kernel-Safe Optimization:

    • Enables high-performance memory hashing (hashsize) on Debian/Ubuntu.
    • Uses conservative, stability-first settings on RHEL/Rocky kernels to prevent "Invalid Argument" crashes.
  • Persistence Guaranteed: Rules are written to disk (XML for Firewalld, persistent saves for Netfilter), surviving reboots instantly.

  • Auto-Update: Installs a cron job to refresh the blocklist hourly.

Objectives

  • Noise Reduction: Drastically reduce the size of system logs (/var/log/auth.log, journalctl) by blocking scanners at the door.
  • Resource Saving: Save CPU cycles and bandwidth by dropping packets at the kernel level rather than letting application servers (Nginx, SSHD) handle them.
  • Proactive Security: Move from a "Reactive" stance (wait for 5 failed logins -> Ban) to a "Proactive" stance (Ban the IP because it attacked a server in another country 10 minutes ago).

Technical Deep Dive: Integration Logic

Many admins worry that installing a massive blocklist might conflict with Fail2ban. SysWarden solves this via layering.

Workflow

๐Ÿ“ก / (Network Traffic Flow)
โ”œโ”€โ”€ ๐Ÿ›ก๏ธ Layer 1: Firewall Shield (Static Defense)
โ”‚   โ”œโ”€โ”€ ๐Ÿงฑ Engine: Nftables / Firewalld / Ipset (Auto-detected)
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ Blocklist: ~95k - 100k IPs (Data-Shield Source)
โ”‚   โ””โ”€โ”€ ๐Ÿšซ Action: DROP packet before reaching services
โ”‚
โ””โ”€โ”€ ๐Ÿ–ฅ๏ธ Layer 2: User Space (Allowed Traffic)
    โ”œโ”€โ”€ ๐Ÿ“ Services & Logs
    โ”‚   โ”œโ”€โ”€ ๐Ÿ”“ SSH / Web / Database (Custom Ports Allowed)
    โ”‚   โ”œโ”€โ”€ ๐Ÿ“ System Logs: /var/log/syslog & journalctl
    โ”‚   โ””โ”€โ”€ โ™ป๏ธ Maintenance: Logrotate (Daily cleanup, 7-day retention)
    โ”‚
    โ””โ”€โ”€ ๐Ÿ“ Layer 3: Active Response (Dynamic Defense)
        โ”œโ”€โ”€ ๐Ÿ‘ฎ Fail2ban Service
        โ”‚   โ”œโ”€โ”€ ๐Ÿ” Watch: Brute-force patterns (SSH, Nginx, etc.)
        โ”‚   โ””โ”€โ”€ โšก Action: Ban Dynamic IP locally
        โ”‚
        โ”œโ”€โ”€ ๐Ÿ SysWarden Reporter
        โ”‚   โ”œโ”€โ”€ ๐Ÿ” Watch: Firewall Drops & Fail2ban Bans
        โ”‚   โ””โ”€โ”€ ๐Ÿ“ก Action: Report to AbuseIPDB API
        โ”‚
        โ””โ”€โ”€ ๐Ÿฆ Wazuh Agent
            โ”œโ”€โ”€ ๐Ÿ” Watch: File Integrity & System Events
            โ””โ”€โ”€ ๐Ÿ“จ Action: Forward alerts to Wazuh SIEM

1. The Nftables + Fail2ban Synergy (Debian/Ubuntu)

  • Data-Shield (Layer 1): Creates a high-performance Nftables set containing ~100k IPs. This acts as a static shield, dropping known bad actors instantly using extremely efficient kernel-level lookups.
  • Fail2ban (Layer 2): Continues to monitor logs for new, unknown attackers.
  • Result: Fail2ban uses less CPU because Data-Shield filters out the "background noise" (99% of automated scans) before Fail2ban even has to parse a log line.

2. The Firewalld + Fail2ban Synergy (RHEL/Alma/Rocky)

On Enterprise Linux, proper integration with firewalld is critical.

  • Native Sets: SysWarden creates a permanent ipset type within Firewalld's configuration logic.
  • Rich Rules: It applies a "Rich Rule" that drops traffic from this set before it reaches your zones or services.
  • Persistence: Unlike simple scripts that run ipset commands (which vanish on reload), SysWarden writes the configuration to /etc/firewalld/, ensuring the protection persists across service reloads and server reboots.

3. AbuseIPDB reporting

In a community setting, during the script installation phase, it is possible to report triggered and confirmed alerts to ABUSEIPDB in order to keep the database of malicious IP addresses up to date.

  • Enable the option Simply confirm with y when prompted during installation.
  • API key Paste your AbuseIPDB API key to automatically report malicious IPs and contribute to the community database.

4. Wazuh Agent Integration

For organizations using a SIEM, SysWarden includes an interactive module to deploy the Wazuh XDR Agent effortlessly, bridging local protection with centralized monitoring.

  • Seamless Deployment: The script automatically detects your OS, installs the official GPG keys/repositories, and deploys the latest agent version.
  • Smart Configuration: By simply providing your Manager IP, Agent Name, and Group during the prompt, the script injects the configuration immediatelyโ€”no manual editing of ossec.conf required.
  • Auto-Whitelisting: To ensure uninterrupted log forwarding, SysWarden creates a high-priority exception rule allowing traffic to/from your Wazuh Manager (ports 1514/1515) to bypass the strict blocklist.

How to Install (root)

This script automatically detects installed services (Nginx, Apache, MongoDB) and configures protections accordingly. If a service is installed AFTER SysWarden, simply run the update command or rerun the installer to activate the new jails.

# For Ubuntu/Debian
apt update && apt upgrade -y
apt install wget -y

# For Rocky/AlmaLinux/CentOS Stream/Fedora
dnf update -y
dnf install wget -y

# install script
cd /usr/local/bin/
wget https://github.com/duggytuxy/syswarden/releases/download/v8.00/install-syswarden.sh
chmod +x install-syswarden.sh
./install-syswarden.sh

# Update configurations and Blocklists
./install-syswarden.sh update

# View Alerts
./install-syswarden.sh alerts

# Whitelist an IP
./install-syswarden.sh whitelist

# Block an IP
./install-syswarden.sh blocklist

# Docker protection
./install-syswarden.sh protect-docker

# SysWarden Upgrade Checker
././install-syswarden.sh upgrade
๐Ÿ“‚ / (Root System)
โ”œโ”€โ”€ ๐Ÿ“ etc/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ syswarden.conf                   # Main Configuration (Auto-generated)
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ fail2ban/
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“„ jail.local                   # Custom Jails (SSH, Web, DB) injected by SysWarden
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ logrotate.d/
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“„ syswarden                    # Log Rotation Config (7-day retention & compression)
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ cron.d/
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“„ syswarden-update             # Hourly Update Job
โ”‚   โ””โ”€โ”€ ๐Ÿ“ systemd/system/
โ”‚       โ””โ”€โ”€ ๐Ÿ“„ syswarden-reporter.service
โ”œโ”€โ”€ ๐Ÿ“ usr/local/bin/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“œ install-syswarden.sh             # Main Script (CLI Tool)
โ”‚   โ””โ”€โ”€ ๐Ÿ syswarden_reporter.py            # Python Log Analyzer
โ””โ”€โ”€ ๐Ÿ“ var/
    โ”œโ”€โ”€ ๐Ÿ“ log/
    โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ syswarden-install.log        # Installation & Debug Logs
    โ”‚   โ””โ”€โ”€ ๐Ÿ“„ fail2ban.log                 # Banned IPs logs
    โ””โ”€โ”€ ๐Ÿ“ ossec/etc/
        โ””โ”€โ”€ ๐Ÿ“„ ossec.conf                   # Wazuh Agent Config (Manager IP & Ports injected here)

Uninstallation (root)

./install-syswarden.sh uninstall

Support & Sustainability

Help keep the tool alive Developing and maintaining a high-fidelity, real-time blocklist requires significant infrastructure resources and dedicated time. Your contributions are vital to ensure the project remains sustainable, up-to-date, and free for the community. If you find this project useful, consider supporting its ongoing development:

ABUSEIPDB Contributor

Duggy Tuxy
Verified Contributor

License & Copyright

  • SysWarden ยฉ 2026
  • Developed by Duggy Tuxy (Laurent Minne).

"This tool is open-source software licensed under the GNU GPLv3 License."

About

SysWarden is a tool based on the Data-Shield IPv4 Blocklists Community, Spamhaus ASN, Wazuh and Fail2ban that blocks up to 99% of noisy, disruptive, and malicious IP addresses and focuses on real signals.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Languages