| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository is a collection of independent scripts designed to audit and harden Linux-based distributions.
Each script is intended to be used on its own. There is no required install order, shared runtime, or single hardening profile for the whole repository. Review the README for the specific script you plan to run before applying it to a system.
Table of ContentsBelow is a list of scripts included in this repository. Each script has its own README with requirements, usage, compatibility notes, safety warnings, and a changelog link.
| Script | Purpose | Category | Details |
|---|---|---|---|
| Lynis Installer | Download Lynis, a security auditing tool for Unix-like systems. | Auditing | README / Script |
| Root Locker | Lock the root account to prevent direct root logins. | Hardening | README / Script |
| SSHD Hardening | Harden OpenSSH server configuration based on Lynis recommendations. | Hardening | README / Script |
| UFW Cloudflare | Configure UFW to allow HTTP/HTTPS traffic only from Cloudflare IP ranges. | Hardening | README / Script |
| Nginx WAF | Install and configure ModSecurity with the OWASP Core Rule Set for Nginx. | Hardening | README / Script |
The following requirements apply broadly to the repository:
Note
Individual scripts may require root privileges, network access, packages, or services such as OpenSSH, UFW, or Nginx. Check the script's README before running it.
All you need to do is download this repository to your local machine:
git clone https://github.com/StrangeRanger/linux-security-scripts
cd linux-security-scriptsAn audit-first workflow can help you decide which hardening changes are appropriate for a system:
Install Lynis: Run the Lynis installer to download the auditing tool.
./auditing/Lynis\ Installer/lynis-installer.bashRun a security audit: Use Lynis to identify security issues.
cd ~/lynis
clear
sudo ./lynis audit systemApply hardening selectively: Based on the audit results, run only the hardening scripts that match your needs.
This workflow is optional. The hardening scripts do not depend on the Lynis installer.
Caution
Production Environment Warning: Always test scripts in a non-production environment first. Some scripts modify critical system configurations and may affect system accessibility.
Run only the script you need. Most hardening scripts require root privileges:
sudo ./path/to/script.bashScripts can also be run through Bash directly:
bash ./path/to/script.bashSee each script's README for exact usage, requirements, warnings, and verification steps.
After running a script:
The scripts target Linux systems with Bash 4.0 or newer. Compatibility varies by script because each one touches different tools, services, and configuration files.
Refer to each script's README for tested distributions and script-specific compatibility notes.
Below is a list of additional resources that you can/should use to help make your system as secure as possible.
Please use GitHub Issues for bug reports and feature requests.
Licensing may vary by script; see individual file headers.
| Back | FazBrowse Home | New Git URL |