Mitigations

Centralized configuration management

The benchmarks of the Center for Internet Security (CIS) are a well-known standard for best-practice configuration management. Their benchmarks for the various Linux and UNIX versions include various checks for SSH Server and Client configuration settings and include:

  • Permissions and ownerships of configuration files

  • SSH Protocol usage, Log level

  • Root login, password and key requirements, authorization retries, session timeouts

  • Cipher Algorithms for Message Authentication, Key Exchange, and Encryption

  • Etc.

SSH Server configurations

When using question Get SSH Audit - Sshd Config from all machines, you see below a typical example of how often these vary among the many systems using SSH.


Picture 7. Various SSH server configurations

Picture 7. Various SSH server configurations

Note:

One customer was surprised to find 1000+ Windows systems using SSH and thereby bypassing policies enforced in Active Directory.

An obvious option is to consider centralizing the AuthorizedKey file. This is the file which specifies which SSH public and private key pairs are allowed to login without a password. By default, every user is allowed to maintain this in his home directory .ssh/authorized_keys file. Centralizing them (e.g. /etc/ssh/authorized_keys) eases the maintenance and configuration hygiene you can do with tools like ansible, puppet etc.

SSH Server configuration recommendations

As OpenSSH releases newer versions, new and more secure cipher algorithms and configuration settings become available. However, for backwards compatibility reasons the old and potentially weak or vulnerable options remain in effect.

Third-party content is available from Joe Testa that evaluates existing SSH Server configurations and provides recommendations for more secure implementations. It will connect to SSH server daemons (local or remote) and report what old options are still in effect and what the recommendations are for a more secure implementation. The content is available at https://github.com/jtesta/ssh-audit.

This content can be imported and used in Tanium, subject to your organization’s policy and review. An example of this is below, where the content is named as the sensor SSH Audit - (Remote) Recommendations. Here, you can see it reporting on remote SSH configurations used by firewalls, routers, printers, and other SSH-enabled network devices.

Note:

Tanium may offer Tanium supported content that performs similar functions in the future.


Picture 8. Recommendations regarding SSH server settings which have been improved or made more secure

Picture 8. Recommendations regarding SSH server settings which have been improved or made more secure

Sudo configurations

The same centralized management argument can be applied to sudo configurations. Especially when administrators use the NOPASSWD option at their own discretion.

When using question Get SSH Audit - Sudo Settings from all machines, you see below a typical example of how the sudo NOPASSWD setting varies among systems.


Picture 9. Sudo NOPASSWD settings among various systems

Picture 9. Sudo NOPASSWD settings among various systems

Enforce passphrase usage

When all SSH keys require a passphrase, SSH Snake will not be able to traverse to other systems. Although an enhanced version could hijack passphrase enabled keys which are added to an ssh-agent (see also Known Hosts).


Picture 10. Identifying passphrase usage in SSH private keys

Picture 10. Identifying passphrase usage in SSH private keys

SSH key hygiene

Duplicate SSH Host fingerprints

When you ask question Get SSH Audit - Host Fingerprints from all machines you can quickly identify if system administrators clone cloud or virtual systems correctly. In the picture below you see multiple systems with the same SSH public key fingerprint. This is often not a big issue as their IP addresses are different, but it makes you wonder about spoofing risks and IT Hygiene in general.


Picture 13. SSH public key fingerprint duplicates

Picture 11. SSH public key fingerprint duplicates