
This is a bash script focus on hardening linux. This is a custom think of windows defender but unlike of their privacy issue. User can feel freedom here.
Linux Defender is a robust and easy-to-use Bash script designed to significantly enhance the security posture of your Linux system. Targeting security professionals, enthusiasts, and system administrators, this tool automates the intricate process of installing, configuring, and managing essential security tools across a wide range of popular Linux distributions. With Linux Defender, fortifying your system against threats becomes efficient, practical, and straightforward.
ufw and iptables for robust network protection.chkrootkit, rkhunter, and clamav to detect and neutralize malicious software.auditd to meticulously log system activity, providing a detailed trail for security analysis and incident response.Anonsurf (for Kali Linux) to route all traffic through the Tor network.TGPT for intelligent assistance and query resolution directly within your security workflow.auditd rules and to gain comprehensive insights into system events and security alerts.Linux Defender offers flexible installation methods to suit your preferences. It is generally recommended to install via your distribution's package manager where possible for system integration and easier updates.
This method involves cloning the repository and running the setup.py script, which automates dependency installation and sets up the linux-defender command system-wide.
git clone https://gitlab.com/0warn/defender.git
cd defender
sudo python3 ./setup.py
The setup.py script will detect your distribution and install all necessary dependencies, including: auditd, audispd-plugins, logwatch, libpam-pwquality, libpam-google-authenticator, postfix, mailutils, inotify-tools, rkhunter, clamav, ufw, inxi, xterm, curl, , , and .
For more robust system integration and easier management, package-based installation is recommended.
To install on Debian-based systems (Debian, Ubuntu, Kali, Parrot), you need to build the .deb package first.
Build the .deb package:
Ensure you have dpkg-dev and devscripts installed:
sudo apt update && sudo apt install -y dpkg-dev devscripts
Navigate to the project root and build the package:
dpkg-buildpackage -us -uc
This will generate a .deb file (e.g., linux-defender_1.3-1_all.deb) in the parent directory.
Install the package:
sudo dpkg -i ../linux-defender_*.deb
Resolve dependencies (if prompted):
sudo apt install -f
To install on Arch Linux, use makepkg to build and install the package from the PKGBUILD.
Ensure git and base-devel are installed:
sudo pacman -S --needed git base-devel
Clone the repository:
git clone https://gitlab.com/0warn/defender.git
cd defender
Build and install the package:
makepkg -si
This command will handle dependencies, build the package, and install it system-wide.
Once dependencies are installed, execute the script with root privileges:
sudo defender
harden, audit, network, user, filesystem, and reporting to manage your system's security.This project is licensed under the MIT License.
Built with care and cybersecurity principles by 0warn “Secure it before someone else exploits it.”
For major changes, open an issue first to discuss what you would like to change. If this project helps secure your systems, consider giving it a ⭐ on gitlab.
logwatch| Category | Tool(s) |
|---|
| Firewall | ufw, iptables |
| Malware Protection | chkrootkit, rkhunter, clamav |
| Monitoring | audit / auditd, inotify-tools, inxi, logwatch |
| Anonymity (Kali) | tor, kali-anonsurf |
| Arch-only Tool | torctl |
| AI | TGPT |
| Hardening | sysctl, modprobe |
| Network Security | iptables, sysctl, resolvconf |
| User Management | pam, libpam-pwquality, libpam-google-authenticator |
| Filesystem | chattr |
| Reporting | postfix, mailutils |
| Core Dependencies | curl, unzip, grep, sort |
unzipgrepsort