$ show nuver-labs/vps-audit
This is a single-file Bash script that performs a comprehensive security and performance audit of a Linux VPS. It checks SSH configuration, firewall status, intrusion prevention systems (Fail2ban/CrowdSec), failed login attempts, system updates, running services, open ports, disk/memory/CPU usage, sudo logging, password policy, and SUID files. The script outputs color-coded PASS/WARN/FAIL results to the console and writes a detailed timestamped report to a file. It is designed for Ubuntu/Debian-based systems and requires root or sudo privileges. The architecture is a monolithic Bash script with no external dependencies beyond standard Linux utilities and optional tools like UFW, Fail2ban, and Docker. The code is well-structured with configurable thresholds and file paths, demonstrating solid Bash scripting practices. However, it is not designed for reuse as a library; it is a standalone tool.
The LLM identified 1 files worth highlighting for reuse:
The `check_fail2ban_port_alignment` function (lines ~250-290) detects a common misconfiguration where Fail2ban's SSH jail blocks a different port than the one sshd actually listens on, rendering bans silently ineffective. It reads Fail2ban configuration files with proper precedence (jail.conf, jail.d/*.conf, jail.local, jail.d/*.local), resolves port tokens (service names or numbers), and checks if the jail's port list covers the effective SSH port. This is a non-obvious security check that demonstrates deep understanding of Fail2ban internals and is reusable in any Bash-based security audit script.