You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**[Lynis Installer](auditing/Lynis%20Installer/lynis-installer.bash)**| Download (clone) Lynis, a security auditing tool for Unix-like systems. | Auditing | Git, Internet connection | No root required |
38
+
|**[Root Locker](hardening/Root%20Locker/root-locker.bash)**| Locks the root account to prevent direct logins. | Hardening | Root privileges | Preserves sudo access |
39
+
|**[SSHD Hardening](hardening/SSHD%20Hardening/harden-sshd.bash)**| Harden OpenSSH server (sshd) per Lynis recommendations. | Hardening | Root privileges | Creates backups |
40
+
|**[UFW Cloudflare](hardening/UFW%20Cloudflare/ufw-cloudflare.bash)**| Configure UFW to only allow HTTP/HTTPS from Cloudflare IP ranges. | Hardening | Root privileges, UFW, Internet connection | Creates backups |
8
41
9
-
<!-- TODO: Add a list of all avaliable scripts and what they do. -->
42
+
> [!NOTE]
43
+
> All scripts include version information in their headers. Check individual CHANGELOG.md files in each tool's directory for version history and updates.
10
44
11
45
## Getting Started
12
46
13
-
### Downloading
47
+
### Prerequisites
48
+
49
+
The following requirements extend to every tool in this repository:
50
+
51
+
-**Bash**: Version 4.0 or higher
52
+
-**Operating System**: Linux-based distribution
53
+
54
+
> [!NOTE]
55
+
> Individual scripts may have additional requirements listed in the table above.
56
+
57
+
### Download and Setup
14
58
15
59
All you need to do is download this repository to your local machine:
> Some of the scripts in this repository require root privileges to run. You can run the scripts with the `sudo` command to give them the necessary permissions.
68
+
### Quick Start
69
+
70
+
For users who want to get started immediately:
71
+
72
+
1.**Audit your system first**: Run the Lynis installer to download the auditing tool.
73
+
```bash
74
+
./auditing/Lynis\ Installer/lynis-installer.bash
75
+
```
76
+
77
+
2.**Run a security audit**: Use Lynis to identify security issues.
78
+
```bash
79
+
cd~/lynis && sudo ./lynis audit system
80
+
```
81
+
82
+
3.**Apply hardening**: Based on the audit results, run the appropriate hardening scripts with root privileges.
83
+
84
+
> [!CAUTION]
85
+
> **Production Environment Warning**: Always test scripts in a non-production environment first. Some scripts modify critical system configurations and may affect system accessibility.
86
+
87
+
### Individual Script Usage
88
+
89
+
You can run any script individually using one of the following methods:
23
90
24
-
You can run the scripts in this repository by using the following command:
91
+
```bash
92
+
./[script-name]
93
+
```
25
94
26
-
`./[script name]` OR `bash [script name]`
95
+
**or**
96
+
97
+
```bash
98
+
bash [script-name]
99
+
```
100
+
101
+
## Post-Installation
102
+
103
+
After running the hardening scripts:
104
+
105
+
1.**Verify SSH access**: Before logging out, test SSH connectivity in a new terminal session.
106
+
2.**Review firewall rules**: Check UFW status with `sudo ufw status verbose` if you used the UFW Cloudflare script.
107
+
3.**Run Lynis again**: Re-audit your system to see security improvements.
108
+
4.**Backup configurations**: Keep copies of any modified configuration files.
109
+
110
+
> [!WARNING]
111
+
> The SSHD hardening script modifies SSH configurations. Ensure you have alternative access to your system before applying changes in production environments.
27
112
28
113
## Tested On
29
114
30
-
All of the scripts should work on most, if not all Linux Distributions. With that said, below is a list of Linux Distributions that the scripts have been officially tested and are confirmed to work on.
115
+
All of the scripts should work on most, if not all, Linux distributions with Bash v4.0+ installed. With that said, below is a list of Linux distributions that the scripts have been officially tested and are confirmed to work on.
31
116
32
117
| Distributions | Distro Versions |
33
118
| ------------- | ---------------------- |
@@ -36,6 +121,28 @@ All of the scripts should work on most, if not all Linux Distributions. With tha
36
121
37
122
## Other Resources
38
123
39
-
While this repository has scripts that can help secure Linux, it's not nearly enough to secure the system as much as it needs to be. Below is a list of other resources that you can/should use to help make your system as secure as possible.
124
+
Below is a list of additional resources that you can/should use to help make your system as secure as possible.
Copy file name to clipboardExpand all lines: auditing/Lynis Installer/CHANGELOG.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
7
+
## v1.0.9 - 2025-08-10
8
+
9
+
### Removed
10
+
11
+
- Remove pointless `-e` flag in `echo`.
12
+
7
13
## v1.0.8 - 2024-12-20
8
14
9
15
### Changed
@@ -17,7 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
17
23
- No longer requires root permission to run the script.
18
24
- Won't download lynis if is already present on the system.
Copy file name to clipboardExpand all lines: hardening/Root Locker/CHANGELOG.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.
4
4
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Copy file name to clipboardExpand all lines: hardening/SSHD Hardening/CHANGELOG.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,22 @@
2
2
3
3
All notable changes to this project will be documented in this file.
4
4
5
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+
## v2.1.0 - 2025-08-09
8
+
9
+
### Added
10
+
11
+
-**Session backup system**: Automatic restoration during script interruptions with temporary backup preservation for manual recovery
12
+
-**Cross-platform SSH service restart**: Automatically detects and restarts either `sshd` or `ssh` service based on distribution
13
+
-**Enhanced signal handling**: Proper restoration and cleanup on script interruption (SIGHUP, SIGINT, SIGTERM)
14
+
15
+
### Changed
16
+
17
+
-**Backup strategy**: Dual backup system with permanent `.bak` file for user reference and session backup for auto-restoration
18
+
-**Exit handling**: Strategic use of `clean_exit` function only when cleanup or restoration is needed
19
+
-**User messaging**: Enhanced feedback throughout backup, restoration, and cleanup processes
20
+
-**Output colors**: "Already set" messages now use note (cyan) instead of success (green) for better semantic clarity
0 commit comments