Identifying and Mitigating Secure Socket Shell (SSH) Key Security Vulnerabilities (2024)

Table of Contents
Tags About the Author FAQs

Posted on May 11, 2022 by Debarati Biswas

Last year, AT&T encountered a massive Secure Socket Shell (SSH) login failure, where the Managed Threat Detection and Response (MTDR) analysts discovered above 8000 failed login attempts within a minute with different usernames, indicating a brute force attack. An SSH brute force attack is when attackers use the trial and error method to guess login credentials to gain access to the corporate network.

Identifying and Mitigating Secure Socket Shell (SSH) Key Security Vulnerabilities (1)

SSH is a cryptographic network protocol, which uses public-key cryptography to secure access to remote servers and devices over an insecure network. It is a mechanism for mutual authentication between a client and a server and establishes a safe and encrypted channel of communication.

With the proliferation of cloud and infrastructure automation, SSH keys have become crucial to enable secured remote command-line login, execution, and administrative processes. During authentication procedures, SSH keys establish root access to critical systems, thus converting these cryptographic assets into privileged credentials.

These decentralized unregulated keys are generated on an ad-hoc basis and used by administrators having privileged access to control firewalls, routers, and mission-critical systems. Organizations often tend to overlook the security concerns of the SSH keys, even though they are enabled on major operating systems like Linux, UNIX, Mac OS, and Windows OS.

Inefficient management of SSH keys exposes your organizational networks to critical security vulnerabilities, compromising data confidentiality and integrity.

2023 EMA Report: SSL/TLS Certificate Security-Management and Expiration Challenges

Common mistakes that make SSH vulnerable

  • Weak SSH configuration: SSH client and server implementations like OpenSSH include specific configuration parameters which administrators often miss. They opt for default settings such as port forwarding for convenience, but this increases the security risks a great deal. You must consider the security implications before making changes to the SSH configurations.
  • Improper SSH key management: The explosion in the number of SSH keys cause trouble tracking and monitoring them. Homegrown custom solutions like spreadsheets are not scalable solutions for managing the SSH keys. Anyone can create SSH keys within the system using simple commands, and the keys are not governed and regulated by a centralized entity. The lack of defined management of SSH credentials can lead to potential backdoors, which hackers exploit for malicious purposes.
  • Lack of awareness: Even though organizations rely on SSH keys to authenticate and enable trust between administrators, applications, and machines, they struggle to provide the enforcement policies necessary to prevent unauthorized access.
  • Key sprawl: As SSH keys can be generated as needed, managing the deluge of these keys can be a security headache, leading to the possibility of a key sprawl, i.e. storing discarded and unmanaged keys in multiple locations. Unmanaged keys can be compromised and forged by attackers to launch eavesdropping attacks, like a man-in-the-middle (MITM) attack.

Security vulnerabilities of Secure Shell (SSH)

  • Brute force and malware attacks: Cybercriminals target SSH keys to enjoy lateral movement within the corporate network, launch brute force, and targeted malware attacks by creating backdoors using SSH keys.
  • SSH session hijacking and unauthorized access: Attackers can hijack a user’s SSH session by exploiting the trusted communication established between multiple systems via public key authentication in an SSH session. It can occur either by hijacking the SSH agent or by gaining unauthorized access to the agent’s socket. In the case of default SSH configurations, an attacker can compromise the privileged user access and create a backdoor key by tampering with the default settings.
  • Private key compromise: During SSH configuration for the public key, private key enables access to critical accounts. When a private key is compromised, the attacker can access all the accounts where the private key is trusted. As SSH keys do not expire, they are often installed and forgotten. Consequently, a shorter key length continues to exist, thus giving the attackers a chance to derive its value easily.

Mitigate SSH security risks

  • Discover and map keys: You need to discover SSH servers, certificates, and private keys that are authorized to grant SSH access. Periodic network scans and employing a discovery tool to locate and maintain a centralized inventory are crucial. Also important is mapping the key-user relationship. Use an agentless or agent-based discovery tool versus manual tracking to build a searchable inventory of all SSH keys.
  • Create fresh key pairs and rotate keys: Use an automated workflow that will enable authorized users to create and deploy new keys. Rotate key pairs regularly at pre-defined intervals. Automated alerts and built-in integrations with active directory (AD) groups as well as self-service UI’s or APIs can help streamline the process. You can also look at implementing maximum key lifespans for smooth management.
  • Control SSH keys and access: Implement SSH key management policies and practices to generate new keys and discard any orphaned keys. Practice granular access controls to ensure that only authorized users can create and access the SSH credentials. You can leverage directory services to assign the required levels of clearance based on the roles of the concerned security teams. This will help reduce the risk margin caused by key sprawl and mismanagement of keys.
  • Disable root login: The root is the primary user account that is responsible for enabling complete access to Linux and UNIX-based systems. Hackers target root login to gain unlimited access to critical systems. Disable SSH root login to harden server security.
  • Apply public key authentication: While password-based authentication mechanism is vulnerable to brute force attacks, key-based authentication is safe and secure. By using public-key authentication, you can log in to the SSH account using cryptographic key pairs (public and private keys) instead of passwords.
  • Monitor continuously – Robust monitoring of your key inventory will help you stay proactive and ward off threats. Maintain audit trails to ensure that all keys in use adhere to policies. This will provide you with transparency into access, key modifications, and important events like key generation and rotation.

Stay proactive and secure your SSH keys today!

Talk to an Expert

Tags

  • Certificate Management
  • public-key cryptography
  • Secure Socket Shell
  • SSH configuration
  • SSH key management
  • SSH Keys
  • SSH keys security

About the Author

Identifying and Mitigating Secure Socket Shell (SSH) Key Security Vulnerabilities (2)

Debarati Biswas

Senior Specialist- Product Marketing

A content creator and a lifelong learner with an ongoing curiosity. She pens insightful resources to address the pain points of the readers and prospective buyers and help them make well-informed decisions.

More From the Author →

Identifying and Mitigating Secure Socket Shell (SSH) Key Security Vulnerabilities (2024)

FAQs

What are the vulnerabilities of SSH? ›

The potential risk here is mainly nodes or public-facing workloads that are running an SSH server. If they use a vulnerable version of “liblzma” at either level, the nodes can be exploited by anyone who has network access to the SSH port.

What are the security issues with SSH keys? ›

Common SSH security risks
  • Unapproved SSH servers. ...
  • Unpatched SSH software. ...
  • Vulnerable SSH configuration. ...
  • SSH port forwarding. ...
  • Private key compromise. ...
  • Unauthorized SSH access. ...
  • Privilege escalation. ...
  • Rogue known host keys.
Oct 30, 2023

How can we minimize risk and still use SSH? ›

Here are some best practices:
  1. Properly generate SSH key pairs. Use a reputable tool such as OpenSSH. ...
  2. Safeguard private keys. The private key is akin to a secret password and should be treated as such. ...
  3. Rotate SSH keys. ...
  4. Revoke SSH keys. ...
  5. Regularly audit your SSH keys. ...
  6. Implement key management solutions.

What is the difference between secure socket shell and secure shell? ›

Differences between SSL and SSH

One of the most noticeable differences between SSL/TLS and SSH is that SSL normally (yes, there can be exceptions) employs X. 509 digital certificates for server and client authentication whereas SSH does not.

What is the vulnerability of secure shell protocol? ›

Security researchers have discovered a new vulnerability called Terrapin that impacts the Secure Shell (SSH) network protocol. According to the study, at least 77% of SSH servers support modes that can be exploited through the vulnerability.

How secure is SSH key authentication? ›

SSH is also resistant to brute force attacks and protects against certain attack vectors used to gain access to remote machines. Public key encryption ensures passwords need not be sent over the network, providing an additional layer of security.

Which SSH key is most secure? ›

We strongly recommend using only the ed25519 algorithm (an ECDSA variant). It is the most secure SSH key type widely available, and is very well supported in the majority of systems. If you are using an client or server without ed25519 support, you should consider upgrading where possible.

How do I resolve SSH problems? ›

Here are some steps you can take to troubleshoot this error.
  1. Verify that the host IP address is correct for the Droplet.
  2. Verify that your network supports connectivity over the SSH port being used. Some public networks may block port 22 or custom SSH ports. ...
  3. Verify the Droplet firewall rules.
Mar 13, 2024

What does SSH not protect against? ›

SSH does not protect against: A malicious user gaining root access to host (remote) machine. A malicious user gaining root access to the recipient machine.

How to use secure shell SSH? ›

How to use an SSH client
  1. Start PuTTY.
  2. In the Host Name (or IP address) text box, type the hostname or IP address of the server where your account is located.
  3. In the Port text box, type 7822. ...
  4. Confirm that the Connection type radio button is set to SSH.
  5. Click Open.

How do I protect SSH access? ›

  1. Overview. ...
  2. Understanding the Need. ...
  3. Keep SSH Updated. ...
  4. Disable Root Login. ...
  5. Implement Two-Factor Authentication (2FA) ...
  6. Configure SSH Port. ...
  7. Enable Fail2ban. ...
  8. Disable Password Authentication and Enable Public Key Authentication.
Mar 18, 2024

How do you store SSH keys safely? ›

After the SSH Keys in your organization have been discovered, they can be stored securely in the Digital Vault. This way, the SSH Key secret is secure and is protected by control and access restrictions.

What are the advantages of Secure Shell SSH? ›

Benefits of SSH

SSH allows users to execute shell commands on a remote computer in the same way as if they were sitting in front of the physical computer. Using SSH commands and scripts, administrators can view, remove, or move files, create new folders, files, and directories, and download files.

What makes Secure Shell secure? ›

SSH uses public key cryptography for authentication, allowing both the user and the server to verify each other's identity securely. In addition, SSH can use password authentication or public key authentication, enabling password-less login and increased security for remote access.

How safe is secure socket layer? ›

In order to provide a high degree of privacy, SSL encrypts data that is transmitted across the web. This means that anyone who tries to intercept this data will only see a garbled mix of characters that is nearly impossible to decrypt.

How insecure is SSH? ›

SSH is "secure" because it incorporates encryption and authentication via a process called public key cryptography. Public key cryptography is a way to encrypt data, or sign data, with two different keys. One of the keys, the public key, is available for anyone to use.

Why SSH is not recommended? ›

It's not that SSH isn't secure, but that a hacker could hack your computer, and then get access to the company's network, and they would have no way of knowing the difference.

Is SSH port vulnerable? ›

Port 22 is associated with the SSH (Secure Shell) protocol, which is used to securely connect to a remote device and issue commands just like you would on your own device. This default port does have its vulnerabilities, though: port 22 a popular target for brute force attacks and unauthorized access attempts.

What is SSH advantages and disadvantages? ›

Advantages and Disadvantages of SSH

It allows you to safely tunnel insecure programs such as SMTP, IMAP, POP3, and CVS. It permits users to remotely inspect the directory's content, change files, and access custom database apps. It is free to use for non-commercial purposes.

Top Articles
Latest Posts
Article information

Author: Chrissy Homenick

Last Updated:

Views: 6021

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Chrissy Homenick

Birthday: 2001-10-22

Address: 611 Kuhn Oval, Feltonbury, NY 02783-3818

Phone: +96619177651654

Job: Mining Representative

Hobby: amateur radio, Sculling, Knife making, Gardening, Watching movies, Gunsmithing, Video gaming

Introduction: My name is Chrissy Homenick, I am a tender, funny, determined, tender, glorious, fancy, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.