Limiting SSH ciphers and MAC algorithms in Messaging Gateway
search cancel

Limiting SSH ciphers and MAC algorithms in Messaging Gateway

book

Article ID: 163608

calendar_today

Updated On:

Products

Messaging Gateway

Issue/Introduction

Vulnerability scans show Messaging Gateway is using CBC ciphers (CVE-2008-5161) or other weaker Message Authentication Code (MAC) algorithms used by the Messaging Gateway SSH service.

Cause

Messaging Gateway ships with the default set of SSH ciphers and message MAC algorithms but this set of algorithms can be limited to a smaller set of more secure ciphers and algorithms using the 'sshd-config' command line interface (CLI) command.

Resolution

The sshd-config command was upgraded in the 10.7.5 version release, both the newer and the older information is listed here.

Please note that Broadcom Support cannot provide specific recommendations on setting encryption parameters for your environment. Examples command usage is provided below but Broadcom Support can only provide assistance in returning the Messaging Gateway SSH daemon to its original configuration.

Version 10.7.5 and Later

Usage for the sshd-config command:

Usage: sshd-config (--list | --help)
       sshd-config --add (allow|deny)
       sshd-config --delete (allow|deny) <rule#>
       sshd-config --view
       sshd-config (--protocol | --ciphers | --macs | --kexalgorithms) <new_setting>
       sshd-config --keygen <type> [ --bits <bits> ]

Options:
    -h,--help      Show more extensive help
    -l,--list           List current rules
    -a,--add            Add more allow/deny rules
    -d,--delete         Delete a rule by number
    -v,--view           Display ciphers/macs/kexalgorithm settings
    -p,--protocol       Set the allowed protocols (to <new_setting> )
    -c,--ciphers        Set the allowed ciphers (to <new_setting> )
    -m,--macs           Set the allowed message authentication codes (to <new_setting> )
    -k,--kexalgorithms  Set the allowed key exchange algorithms (to <new_setting> )
    -y,--keygen         Regenerate ssh key (of <type> )
    -b,--bits           specify the number of bits for a new key to be generated

In version 10.7.5 and newer, you can explicitly specify what ciphers and MAC algorithms to use with the --ciphers and --macs options. Broadcom does not have specific recommendations for this, allowable configurations can be found in the following SSH configuration information:

https://www.ssh.com/academy/ssh/sshd_config

Default SSH Cipher Configuration in Messaging Gateway

The running configuration for the SSH server can be displayed by running the sshd-config --view command:

smg[10.9.0-3] sshd-config --view
Attribute 'protocol' is set to 'default'.
Attribute 'ciphers' is set to '3des-cbc,blowfish-cbc,cast128-cbc,aes128-cbc,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr'.
Attribute 'macs' is set to 'hmac-sha2-256,hmac-sha2-512'.
Attribute 'kexalgorithms' is set to 'default'.
Attribute 'clientaliveinterval' is set to 'default'

Disabling CBC Ciphers

To disable CBC ciphers in the SSH server configuration, you will need to manually set the list of ciphers and exclude all ciphers with the cbc tag. For example:

reference [10.9.0-3]> sshd-config --ciphers 'aes128-ctr,aes192-ctr,aes256-ctr'
Previous setting for Ciphers:
        3des-cbc,blowfish-cbc,cast128-cbc,aes128-cbc,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr
New setting for Ciphers:
        aes128-ctr,aes192-ctr,aes256-ctr

Do you wish to make this change? (yes/no) yes
Connection to 10.20.30.40 closed by remote host.
Connection to 10.20.30.40 closed.

Resetting the cipher list will disconnect all SSH sessions as the SSH daemon is reconfigured and restarted.

Resetting the SSHD cipher list to the original default values

You can reset the SSH cipher list to the default values by running sshd-config --ciphers default. After setting the cipher list to the default, the sshd-config --view command will reflect this by displaying "default" for the cipher list. 

smg [10.9.0-3]> sshd-config --ciphers default
Previous setting for Ciphers:
        3des-cbc,blowfish-cbc,cast128-cbc,aes128-cbc,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr
New setting for Ciphers:
        default

Do you wish to make this change? (yes/no) yes
Connection to 10.20.30.405 closed by remote host.
Connection to 10.20.30.40 closed.

smg [10.9.0-3]> sshd-config --view
Attribute 'protocol' is set to 'default'.
Attribute 'ciphers' is set to 'default'.
Attribute 'macs' is set to 'hmac-sha2-256,hmac-sha2-512'.
Attribute 'kexalgorithms' is set to 'default'.
Attribute 'clientaliveinterval' is set to 'default'.

The "default" string results in the same cipher list as the original sshd configuration but the original configuration can also be manually set by specifying the original cipher list:

smg [10.9.0-3]> sshd-config --ciphers "3des-cbc,blowfish-cbc,cast128-cbc,aes128-cbc,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr"
Previous setting for Ciphers:
       aes128-ctr,aes192-ctr,aes256-ctr
New setting for Ciphers:
        3des-cbc,blowfish-cbc,cast128-cbc,aes128-cbc,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr

Do you wish to make this change? (yes/no) yes

Versions 10.7.4 and previous

Usage: sshd-config (--list | --help)
       sshd-config --add (allow|deny) 
       sshd-config --delete (allow|deny) <rule#>
       sshd-config --version [1|2]
       sshd-config --cbc [on|off]
       sshd-config --mac [on|off]

Options:
    -h,--help      Show more extensive help
    -l,--list      List current rules
    -a,--add       Add more allow/deny rules
    -d,--delete    Delete a rule by number
    -v,--version   Show or change the version number
    -c,--cbc       Turn on or off support for CBC ciphers
    -m,--mac       Turn on or off the limited support for hmac algorithms

 

Disabling CBC Ciphers

To disable the use of CBC ciphers by the SMG SSH service, run the following command on rach SMG appliance of virtual machine:

sshd-config --cbc off

Disabling insecure MAC Algorithms

To enable limiting of MAC algorithms to a secure set, run the following command on rach SMG appliance of virtual machine:

smg> sshd-config --mac on