Skip to content

Latest commit

ย 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

LinuxSentinel

Linux Security Audit Framework

LinuxSentinel is a lightweight and modular Linux security auditing tool built with Bash.

It performs automated security checks across important areas of a Linux system, including user accounts, file permissions, privileged files, network configuration, firewall status, services, SSH configuration, persistence mechanisms, and security logs.

LinuxSentinel is designed for cybersecurity learning, Linux administration, defensive security, and authorized system auditing.


โœจ Features

LinuxSentinel provides multiple security auditing modules through a single command-line framework.

๐Ÿ–ฅ๏ธ System Audit

Collects important system information:

  • Operating system
  • Kernel version
  • System architecture
  • Hostname
  • System uptime
  • CPU information
  • Memory usage
  • Disk usage
  • Current user

๐Ÿ‘ค User & Account Security

Analyzes Linux user and account configuration.

Checks include:

  • Total user accounts
  • UID 0 accounts
  • Sudo-enabled users
  • Empty-password accounts
  • Root account configuration

The module helps identify unusual privileged accounts and weak account configurations.


๐Ÿ“ File Permission Security

Analyzes potentially risky Linux file permissions.

Checks include:

  • World-writable files
  • SUID files
  • SGID files

The tool reports discovered files for further security review.

SUID and SGID files are not automatically vulnerabilities. Many legitimate Linux applications require them.


๐Ÿ” Privileged File Audit

Provides detailed visibility into privileged executables.

The module:

  • Searches for SUID files
  • Searches for SGID files
  • Lists discovered privileged files
  • Provides security review information

LinuxSentinel does not automatically remove or modify privileged files.


๐ŸŒ Network Security Audit

Analyzes the current network configuration.

Checks include:

  • Network interfaces
  • Interface status
  • IP addresses
  • Default routes
  • Listening TCP ports
  • Listening UDP ports

This helps identify network exposure and unexpected listening services.


๐Ÿ”ฅ Firewall Security Audit

Checks commonly used Linux firewall technologies.

Supported checks include:

  • UFW
  • nftables
  • iptables

The module determines whether an active firewall ruleset is detected.

LinuxSentinel uses a detection-only approach and does not modify firewall configuration.


โš™๏ธ Service Security Audit

Analyzes system services using Linux service management information.

Checks include:

  • Running services
  • Enabled services
  • Failed services

The purpose is to identify failed or unexpected service configurations that may require investigation.


๐Ÿ”‘ SSH Security Audit

Reviews important SSH security settings.

Checks include:

  • SSH installation
  • SSH service status
  • SSH root-login configuration
  • Password authentication
  • Public-key authentication
  • Empty-password authentication
  • SSH port configuration

The module provides security observations without automatically modifying SSH configuration.


๐Ÿ•’ Persistence & Cron Audit

Searches common Linux persistence and scheduled-task mechanisms.

Checks include:

Cron

/etc/crontab
User Crontabs

Checks available user-specific scheduled tasks.

Systemd Timers

Enumerates systemd timers that may execute tasks automatically.

Scheduled tasks are not automatically classified as malicious. Unfamiliar commands, scripts, binaries, or execution paths should be manually reviewed.

๐Ÿ“œ Security Log Analysis

Analyzes available authentication information.

The module can:

Check traditional authentication logs
Analyze system journal information
Detect failed authentication events
Report authentication-related findings

LinuxSentinel adapts to systems where traditional authentication log files may not exist.

๐Ÿ“Š Automated Security Scoring

LinuxSentinel includes a security scoring module.

The scoring system evaluates detected findings and produces:

Security Score
Risk Level
Critical Findings
High Findings
Medium Findings
Low Findings
Informational Findings

Example format:

==========================================
LINUX SENTINEL SECURITY SCORE
==========================================


Score       : XX / 100
Risk Level  : LOW


------------------------------------------
FINDINGS
------------------------------------------


Critical : 0
High     : 0
Medium   : 0
Low      : 0
Info     : 0

The score is intended as a general security assessment indicator, not a replacement for a professional vulnerability assessment.

๐Ÿ—๏ธ Architecture

LinuxSentinel follows a modular architecture.

The main script acts as the controller and executes individual security modules.

                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚    LinuxSentinel    โ”‚
                         โ”‚   Main Controller   โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
                                    โ–ผ
                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚ linuxsentinel.sh    โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚                            โ”‚                            โ”‚
       โ–ผ                            โ–ผ                            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ System Audit โ”‚             โ”‚ User Audit   โ”‚             โ”‚ File Audit   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚                            โ”‚                            โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚                            โ”‚                            โ”‚
       โ–ผ                            โ–ผ                            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Privilege   โ”‚             โ”‚   Network    โ”‚             โ”‚  Firewall    โ”‚
โ”‚    Audit     โ”‚             โ”‚    Audit     โ”‚             โ”‚    Audit     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚                            โ”‚                            โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚                            โ”‚                            โ”‚
       โ–ผ                            โ–ผ                            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Service    โ”‚             โ”‚     SSH      โ”‚             โ”‚ Persistence  โ”‚
โ”‚    Audit     โ”‚             โ”‚    Audit     โ”‚             โ”‚    Audit     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
                                    โ–ผ
                           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                           โ”‚   Log Analysis   โ”‚
                           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
                                    โ–ผ
                           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                           โ”‚ Security Scoring โ”‚
                           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ–ผ                     โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚ Reports โ”‚          โ”‚  Logs   โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
๐Ÿ“‚ Project Structure
LinuxSentinel/
โ”‚
โ”œโ”€โ”€ linuxsentinel.sh
โ”‚
โ”œโ”€โ”€ modules/
โ”‚   โ”œโ”€โ”€ system_audit.sh
โ”‚   โ”œโ”€โ”€ user_audit.sh
โ”‚   โ”œโ”€โ”€ file_audit.sh
โ”‚   โ”œโ”€โ”€ privilege_audit.sh
โ”‚   โ”œโ”€โ”€ network_audit.sh
โ”‚   โ”œโ”€โ”€ firewall_audit.sh
โ”‚   โ”œโ”€โ”€ service_audit.sh
โ”‚   โ”œโ”€โ”€ ssh_audit.sh
โ”‚   โ”œโ”€โ”€ persistence_audit.sh
โ”‚   โ”œโ”€โ”€ log_audit.sh
โ”‚   โ””โ”€โ”€ score.sh
โ”‚
โ”œโ”€โ”€ logs/
โ”‚
โ”œโ”€โ”€ reports/
โ”‚
โ”œโ”€โ”€ README.md
โ”‚
โ”œโ”€โ”€ LICENSE
โ”‚
โ””โ”€โ”€ .gitignore
๐Ÿงฉ Module Overview
Module	Purpose
system_audit.sh	System information and configuration
user_audit.sh	User and account security
file_audit.sh	File permission analysis
privilege_audit.sh	SUID and SGID analysis
network_audit.sh	Network configuration and listening ports
firewall_audit.sh	Firewall configuration detection
service_audit.sh	Service status analysis
ssh_audit.sh	SSH security configuration
persistence_audit.sh	Cron and systemd persistence checks
log_audit.sh	Authentication and security log analysis
score.sh	Automated security scoring
๐Ÿš€ Installation
Requirements

LinuxSentinel is designed for Linux systems.

Required
Linux operating system
Bash
Git
Standard Linux command-line utilities
sudo privileges for complete auditing
Recommended
Kali Linux
Debian-based Linux distributions
๐Ÿ“ฅ Clone the Repository

Clone the project:

git clone https://github.com/mustafajaved304/LinuxSentinel.git

Move into the project:

cd LinuxSentinel
๐Ÿ”ง Make Scripts Executable

Make the main script executable:

chmod +x linuxsentinel.sh

Make all modules executable:

chmod +x modules/*.sh
โ–ถ๏ธ Usage
Full Security Audit

Run the complete LinuxSentinel audit:

sudo ./linuxsentinel.sh

The complete audit runs the available security modules and produces a final assessment.

Quick Audit

If quick-audit functionality is enabled in the current version:

sudo ./linuxsentinel.sh --quick

Quick mode is intended for faster security checks.

Full Mode

The full audit can also be explicitly requested:

sudo ./linuxsentinel.sh --full
Help

Display available commands:

./linuxsentinel.sh --help
Version

Display the LinuxSentinel version:

./linuxsentinel.sh --version
๐Ÿ” Running Individual Modules

Each module can also be executed independently.

For example:

sudo ./modules/system_audit.sh
sudo ./modules/user_audit.sh
sudo ./modules/file_audit.sh
sudo ./modules/privilege_audit.sh
sudo ./modules/network_audit.sh
sudo ./modules/firewall_audit.sh
sudo ./modules/service_audit.sh
sudo ./modules/ssh_audit.sh
sudo ./modules/persistence_audit.sh
sudo ./modules/log_audit.sh
sudo ./modules/score.sh

Running the main controller is recommended because it provides a complete and consistent audit workflow.

๐Ÿ“„ Reports

LinuxSentinel generates timestamped security reports.

Reports are stored inside:

reports/

Example:

reports/
โ””โ”€โ”€ audit_<timestamp>.txt

Reports allow users to review audit results after the scan has completed.

๐Ÿ“ Logs

Execution logs are stored inside:

logs/

Example:

logs/
โ””โ”€โ”€ audit_<timestamp>.log

Logs can be used for:

Audit history
Troubleshooting
Security review
Comparing assessments
Documentation
๐Ÿ”’ Privacy

LinuxSentinel is designed to keep generated machine-specific information separate from the source code.

Audit reports and logs may contain sensitive system information such as:

IP addresses
Usernames
Hostnames
Running services
Network interfaces
Security configuration

For this reason, generated reports and logs should not be publicly uploaded unless they have been reviewed and sanitized.

The repository should use .gitignore to prevent accidental publication of local audit data.

๐Ÿ›ก๏ธ Non-Destructive Design

LinuxSentinel follows a detection and reporting approach.

It does not automatically:

Delete users
Change passwords
Disable services
Modify firewall rules
Modify SSH configuration
Delete cron jobs
Delete systemd timers
Remove SUID files
Remove SGID files
Modify system security settings

The tool reports findings so that the system administrator can decide what action is appropriate.

โš ๏ธ Security Considerations

Some Linux security findings require manual investigation.

For example:

SUID Files

A SUID executable may be completely legitimate.

SGID Files

An SGID executable may be required by a system application.

Open Ports

A listening port does not automatically indicate a vulnerability.

Running Services

A running service may be expected depending on the system's purpose.

Scheduled Tasks

Cron jobs and systemd timers can be legitimate system maintenance tasks.

LinuxSentinel therefore focuses on visibility and assessment rather than automatically declaring every finding malicious.

๐Ÿ“Š Risk Levels

LinuxSentinel categorizes findings using severity levels.

Severity	Description
Critical	Severe security condition requiring immediate investigation
High	Significant security concern
Medium	Security weakness requiring attention
Low	Lower-risk security observation
Info	Informational finding

The final risk level is based on the findings detected during the audit.

๐Ÿ› ๏ธ Technologies Used

LinuxSentinel is intentionally built with lightweight Linux-native technologies.

Core
Bash
Linux
Git
System Utilities
awk
grep
sed
find
sort
uniq
cut
wc
df
free
uname
Networking
ip
ss
Services & Logs
systemctl
journalctl
Security Components
SSH
Cron
Systemd
UFW
nftables
iptables
๐ŸŽฏ Project Goals

LinuxSentinel was created to provide practical experience with:

Linux security
Bash scripting
Linux administration
Security auditing
Defensive cybersecurity
User privilege analysis
File permission analysis
Network security
Firewall analysis
SSH hardening concepts
Persistence detection
Security log analysis
Security automation
Command-line security tooling
๐Ÿง  Learning Outcomes

Working with LinuxSentinel provides practical experience in:

Linux
Linux filesystem
Linux users and groups
File permissions
Privileges
Services
Processes
Networking
System logs
Cybersecurity
Security auditing
Attack surface identification
Privilege analysis
Persistence analysis
Network exposure
Authentication security
Defensive monitoring
Bash
Variables
Functions
Conditions
Loops
Command substitution
Exit codes
Text processing
Modular scripting
Automation
๐Ÿ”ฎ Future Improvements

Potential future versions may introduce:

JSON report generation
HTML reports
PDF reports
Security baseline comparison
Historical security scores
Configuration recommendations
File integrity monitoring
Hash-based integrity verification
CVE integration
Additional Linux distributions
More advanced SSH analysis
Automated scheduled audits
Email notifications
Centralized logging
Web-based dashboard
Extended security checks
๐Ÿ“ˆ Possible Future Architecture

Future versions could extend LinuxSentinel into a larger defensive security platform:

                 LinuxSentinel
                       โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚              โ”‚              โ”‚
        โ–ผ              โ–ผ              โ–ผ
     Auditing      Monitoring      Reporting
        โ”‚              โ”‚              โ”‚
        โ–ผ              โ–ผ              โ–ผ
    Security       Integrity       HTML/PDF
    Modules        Monitoring       Reports
        โ”‚              โ”‚              โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
                       โ–ผ
                Security Dashboard
๐Ÿงช Recommended Testing Environment

LinuxSentinel should preferably be tested in:

Personal Linux systems
Virtual machines
Cybersecurity laboratories
Authorized testing environments

Testing on production systems should be performed carefully because security auditing commands can inspect sensitive system information.

โš–๏ธ Disclaimer

LinuxSentinel is intended for:

Authorized security auditing
Cybersecurity education
Defensive security research
Linux administration
Personal laboratory environments
Systems owned or explicitly authorized for testing

Do not use LinuxSentinel to inspect systems without authorization.

The author is not responsible for misuse of this project.

๐Ÿ‘จโ€๐Ÿ’ป Author
Mustafa Mehmood Javed

Cybersecurity Student

Interests include:

Cybersecurity
Linux Security
Defensive Security
Security Auditing
Bash Scripting
Network Security
System Security

GitHub:

https://github.com/mustafajaved304

๐Ÿ“œ License

LinuxSentinel is released under the MIT License.

See the LICENSE file for details.
/etc/cron.d
/etc/cron.hourly

About

Modular Linux security auditing framework built with Bash for system, user, file, network, firewall, SSH, persistence, log analysis, and automated security scoring.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages