SSH Encryption Cipher
Overview
The Secure Shell (SSH) management uses various algorithms in the security mechanisms such as key exchange (KEX), message authentication code (MAC), and encryption (Cipher) for security and flexibility. As part of the security enhancement, additional SSH management algorithms are added into KEX, MAC, and encryption methods.
The security encryption algorithms used in SSH are enhanced to enable the users to use preferable (including weaker algorithms) security mechanisms (for legacy SSH clients) if they want to use them in their network apart from the default cipher algorithms. The default SSH configurations do not use these weaker encryption ciphers algorithms due to security priority.
However, OcNOS allows the users to enable or disable the desired algorithms option using the following commands.
If the user wishes to modify these defaults, they can reconfigure them with the desired algorithms. For instance, by default, the following algorithms are applied: "chacha20-poly1305@openssh.com, aes256-gcm@openssh.com, aes128-gcm@openssh.com, aes256-ctr, aes192-ctr, aes128-ctr." To remove any of these algorithms, the user must explicitly reconfigure the necessary algorithms, such as using the command:sshserver algorithm encryption aes256-gcm@openssh.com,aes128-gcm@openssh.com.
Feature Characteristics
Following are the currently supported encryptions in the SSH session.
|
•
|
Provides flexibility to user to add or remove the desired SSH encryption algorithms for the following encryption methods. |
|
•
|
By default,chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctrciphers are supported for a new SSH client to connect with the SSH server |
|
•
|
Allows user to configure multiple algorithms. |
|
•
|
Supports following Strongest Cipher algorithms |
|
•
|
chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
|
|
•
|
hmac-sha2-512-etm@openssh.com, |
|
•
|
hmac-sha2-256-etm@openssh.com, |
|
•
|
curve25519-sha256@libssh.org, |
|
•
|
diffie-hellman-group18-sha512, |
|
•
|
diffie-hellman-group16-sha512, |
|
•
|
diffie-hellman-group14-sha256 (uses 2048-bit keys and considered strong) |
|
•
|
Avoid configuring the weaker Cipher algorithms |
|
•
|
aes256-cbc(CBC mode is vulnerable to padding Oracle attacks) |
|
•
|
blowfish-cbc(Less efficient) |
|
•
|
arcfour(Based on RC4 which has significant vulnerabilities) |
|
•
|
hmac-md5(MD5 can be broken and should not be used) |
|
•
|
umac-64@openssh.com (Weaker than SHA-2 based MACs)
|
|
•
|
hmac-sha1(Less secured and weak) |
|
•
|
Extents support to all interfaces including user-defined. |
|
•
|
Allows users with Network Admin or Network Engineer or Network Operator privilege to configure. |
|
•
|
Provides a show CLI command to view the configured SSH algorithms. |
|
•
|
Configured algorithms are persistent even after reload. |
Benefits
Enhanced security for remote terminal connections via SSH. It enables users to utilize the legacy SSH clients with the algorithms option through newly introduced commands.
Prerequisites
SSH process should be enabled.
Configuration
This section provides an example to encrypt an SSH session with cipher algorithm.
Use any one or all of the algorithms to encrypt a default, management or user defined interface SSH session.
Topology
In the below topology, the SSH client from the OcNOS device is initiating an SSH connection to a remote machine.
Figure 16. SSH Sample Topology
Before configuration meet all Prerequisites.
Assign SSH security algorithm to a management Interface
|
1.
|
Set the SSH server encryption algorithm for the management VRF. |
Copy
(config)# ssh server algorithm mac hmac-sha2-256-etm hmac-sha1-96 hmac-md5-etm vrf management
|
2.
|
Set the SSH server KEX algorithm for the management VRF. |
Copy
(config)#ssh server algorithm kex ecdh-sha2-nistp256 ecdh-sha2-nistp384
ecdh-sha2-nistp521 vrf management
|
3.
|
Set the SSH server MAC algorithm for the management VRF. |
Copy
(config)# ssh server algorithm mac hmac-sha2-256-etm hmac-sha1-96 hmac-md5-etm vrf management
|
4.
|
Commit the configuration and exit. |
Copy
(config)#commit
(config)#exit
Assign SSH security algorithm to a default VRF Interface
|
1.
|
Set the SSH server encryption algorithm for the default VRF. |
Copy
(config)#ssh server algorithm encryption 3des-cbc aes128-cbc aes192-cbc aes256-cbc
|
2.
|
Set the SSH server KEX algorithm for the default VRF. |
Copy
(config)#ssh server algorithm kex diffie-hellman-group14-sha256 diffie-hellman-group16-sha512 diffie-hellman-group18-sha512
|
3.
|
Set the SSH server MAC algorithm for the default VRF. |
Copy
(config)# ssh server algorithm mac hmac-md5-etm umac-128
|
4.
|
Commit the configuration and exit. |
Copy
(config)#commit (config)#exit
Assign SSH security algorithm to a User Defined Interface
|
1.
|
Create a user defined VRF interface with the name vrf1. |
Copy
(config)#ip vrf vrf1
(config-vrf)# exit
|
2.
|
Set the SSH server encryption algorithm for the User Defined vrf1. |
Copy
(config)#ssh server algorithm encryption 3des-cbc aes128-cbc aes192-cbc aes256-cbc vrf vrf1
|
3.
|
Set the SSH server KEX algorithm for the management vrf1. |
Copy
ssh server algorithm kex diffie-hellman-group1-sha1 diffie-hellman-group14-sha1
|
4.
|
Set the SSH server MAC algorithm for the management vrf1. |
Copy
(config)#ssh server algorithm mac hmac-md5 hmac-md5-96 vrf vrf1
|
5.
|
Commit the configuration and exit. |
Copy
(config)#commit (config)#exit
Validation
Execute the following show command to view the SSH server informations.
Copy
#show running ssh server
feature ssh vrf management
ssh server algorithm mac hmac-sha2-256-etm hmac-sha1-96 hmac-md5-etm vrf management
ssh server algorithm encryption aes256-gcm rijndael-cbc aes128-ctr vrf management
ssh server algorithm kex ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 vrf management
feature ssh
ssh server algorithm mac umac-128 hmac-md5-etm
ssh server algorithm encryption 3des-cbc aes128-cbc aes192-cbc aes256-cbc
ssh server algorithm kex diffie-hellman-group14-sha256 diffie-hellman-group16-sha512 diffie-hellman-group18-sha512
feature ssh vrf vrf1
ssh server algorithm mac hmac-md5 hmac-md5-96 vrf vrf1
ssh server algorithm encryption 3des-cbc aes128-cbc aes192-cbc aes256-cbc vrf vrf1
ssh server algorithm kex diffie-hellman-group1-sha1 diffie-hellman-group14-sha1 diffie-hellman-group14-sha256 vrf vrf1
Execute the following show command to view the configured SSH algorithms.
Copy
#show ssh server algorithm
management vrf ssh server algorithm:
Ciphers aes128-ctr,rijndael-cbc@lysator.liu.se,aes256-gcm@openssh.com,
KexAlgorithms ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
MACs hmac-sha1-96,hmac-sha2-256-etm@openssh.com,hmac-md5-etm@openssh.com,
default vrf ssh server algorithm:
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc, KexAlgorithms diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,
MACs umac-128@openssh.com,hmac-md5-etm@openssh.com,
vrf1 vrf ssh server algorithm:
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc,
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,
MACs hmac-md5,hmac-md5-96