Critical OpenSSH Vulnerability (CVE-2024-6387): Please Update Your Linux
A critical security flaw (CVE-2024-6387) has been identified in OpenSSH, a program widely used for secure remote connections. This vulnerability could allow attackers to completely compromise affected systems (remote code execution).
Who is Affected?
Only specific versions of OpenSSH (8.5p1 to 9.7p1) running on glibc-based Linux systems are vulnerable. Newer versions are not affected.
What to Do?
Update OpenSSH: Check your version by running ssh -V in your terminal. If you're using a vulnerable version (8.5p1 to 9.7p1), update immediately.
Temporary Workaround (Use with Caution): Disabling the login grace timeout (setting LoginGraceTime=0 in sshd_config) can mitigate the risk, but be aware it increases susceptibility to denial-of-service attacks.
Recommended Security Enhancement: Install fail2ban to prevent brute-force attacks. This tool automatically bans IPs with too many failed login attempts.
Optional: IP Whitelisting for Increased Security
Once you have fail2ban installed, consider allowing only specific IP addresses to access your server via SSH. This can be achieved using:
ufw for Ubuntu
firewalld for AlmaLinux or Rocky Linux
Additional Resources
OpenSSH Security Page: https://www.openssh.com/security.html
DevSec Hardening Framework - SSH Baseline: https://dev-sec.io/
Fail2ban: https://github.com/fail2ban
About Fail2ban
Fail2ban monitors log files like /var/log/auth.log and bans IPs with excessive failed login attempts. It updates firewall rules to block connections from these IPs for a set duration. Fail2ban is pre-configured to work with common log files and can be easily customized for other logs and errors.
Installation Instructions:
Ubuntu: sudo apt install fail2ban
AlmaLinux/Rocky Linux: sudo dnf install fail2ban
About DevSec Hardening Framework
The DevSec Hardening Framework is a set of tools and resources that helps automate the process of securing your server infrastructure. It addresses the challenges of manually hardening servers, which can be complex, error-prone, and time-consuming, especially when managing a large number of servers. The framework integrates with popular infrastructure automation tools like Ansible, Chef, and Puppet. It provides pre-configured modules that automatically apply secure settings to your operating systems and services such as OpenSSH, Apache and MySQL. This eliminates the need for manual configuration and reduces the risk of errors.
Prepare by LinuxMalaysia with the help of Google Gemini
5 July 2024
In Google Doc Format