Skip to content

cryptrunner49/linux-hardening-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ§πŸ›‘οΈ Linux Hardening Toolkit

Overview

The Linux Hardening Toolkit is a powerful and easy-to-use script to enhance the security of your Linux systems.
It applies a wide range of best practices for system hardening, service minimization, kernel protection, and package security.

Designed for Debian, Ubuntu, and Fedora systems.


Features

βœ… Harden system configuration (sysctl, limits, permissions)
βœ… Install essential security packages (e.g., Firejail, AppArmor, AIDE, Zeek, Suricata)
βœ… Disable unnecessary and vulnerable services
βœ… Blacklist unused and risky kernel modules
βœ… Runs multiple times without conflict
βœ… Logging of all operations to /var/log/harden_linux.log
βœ… Dry-run mode and Assume-yes automation
βœ… Colored terminal output for better readability
βœ… Compatible with Ubuntu, Debian, and Fedora


Requirements

  • Bash 4+
  • sudo privileges
  • Supported Linux distribution:
    • Ubuntu 20.04/22.04+
    • Debian 11+
    • Fedora 36+

Usage

First, make the script executable:

chmod +x harden_linux.sh

Then, you can run it with different options:

Command Example Description
sudo ./harden_linux.sh --all --assume-yes Apply full system hardening automatically
sudo ./harden_linux.sh --install Only install security-related packages
sudo ./harden_linux.sh --permissions Only fix system file permissions
sudo ./harden_linux.sh --services Only disable unnecessary services
sudo ./harden_linux.sh --dry-run --all Simulate all changes without applying them
./harden_linux.sh --help Show help message
./harden_linux.sh --version Display version information

Important Notes

  • Backups: The script automatically backs up critical configuration files before modifying them.
  • Dry-Run: Always recommended on production servers before applying changes.
  • Logs: All actions are logged to /var/log/harden_linux.log for audit and troubleshooting.

About

πŸ§πŸ›‘οΈ Linux Hardening Toolkit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages