scripts/security-audit.sh — the single entry point for all checks.
The script is self-contained, portable, and works on any modern Linux system. It auto-detects available tools (ss/netstat, ufw/iptables/nftables, journalctl) and gracefully skips unavailable ones.
Run a full audit:
bash
bash scripts/security-audit.sh --all
Or with no arguments (same as --all):
bash
bash scripts/security-audit.sh
Run any single check by name:
CommandWhat it checks--sshPermitRootLogin, PasswordAuthentication, Port, Protocol in sshd_config--portsListening TCP ports (ss or netstat)--firewallufw status, iptables filter rules, nftables ruleset--failed-loginslastb output and journalctl SSH auth failures (last 24h)--sudoersSudoers file permissions (must be 440), files present, NOPASSWD entries, full sudo access grants--world-writableWorld-writable files in /etc, /tmp, /var, /home, /opt (depth 3)--suidAll SUID binaries, risk assessment, unusual path detection
Example:
bash
bash scripts/security-audit.sh --ssh --failed-logins
bash scripts/security-audit.sh --all$REPORT variable (accessible within the same shell session)