[Fixed in 2.2.3] Connecting via SSH to hardened Junos device

Unimus support forum
Post Reply
Asiya
Posts: 3
Joined: Sun Sep 16, 2018 10:44 am

Sun Sep 16, 2018 10:47 am

Hi there,

Unimus will not connect to our Junos devices with the following SSH config set:

ssh {
no-tcp-forwarding;
protocol-version v2;
max-sessions-per-connection 2;
ciphers [ aes128-ctr "aes128-gcm@openssh.com" aes192-ctr aes256-ctr "aes256-gcm@openssh.com" "chacha20-poly1305@openssh.com" ];
macs [ hmac-sha2-256 "hmac-sha2-256-etm@openssh.com" hmac-sha2-512 "hmac-sha2-512-etm@openssh.com" "umac-128-etm@openssh.com" "umac-128@openssh.com" ];
key-exchange [ curve25519-sha256 group-exchange-sha2 ];
client-alive-count-max 3;
client-alive-interval 10;
hostkey-algorithm {
no-ssh-dss;
no-ssh-rsa;
no-ssh-ecdsa;
}
connection-limit 10;
rate-limit 2;
}
User avatar
Tomas
Posts: 1206
Joined: Sat Jun 25, 2016 12:33 pm

Sun Sep 16, 2018 10:48 am

Hi,

What is the job fail reason?
(Dashboard > Latest failed jobs > Show log)

Is there anything in the log file?
("/var/log/unimus/unimus.log" or "C:\ProgramData\Unimus\log\unimus.log")
Asiya
Posts: 3
Joined: Sun Sep 16, 2018 10:44 am

Mon Sep 17, 2018 9:21 am

If I remove the rate-limit related lines, I get 'ssh_unsupported_algorithm'. There's nothing related to the error in the main log file.

We can manage the device using the Bitvise SSH client:

Code: Select all

21:15:32.250 Server version: SSH-2.0-OpenSSH_6.9
21:15:32.251 First key exchange started. Cryptographic provider: Windows CNG (x86) with additions
21:15:32.338 Received host key from the server. Algorithm: Ed25519, size: 256 bits, MD5 fingerprint: xxx, Bubble-Babble: xxx, SHA-256 fingerprint: xxx.
21:15:34.704 Host key has been saved to the global database.
21:15:34.712 First key exchange completed using Curve25519@libssh. Session encryption and integrity: aes256-gcm, compression: none.
21:16:18.992 Attempting password authentication.
21:16:20.183 Authentication completed.
21:16:20.236 Terminal channel opened.

Unimus can discover and back-up the device if the SSH ciphers are left to Junos defaults which we can't do in this environment

Cheers
User avatar
Tomas
Posts: 1206
Joined: Sat Jun 25, 2016 12:33 pm

Mon Sep 17, 2018 10:34 am

EDIT: this has now been changed, please see https://wiki.unimus.net/display/UNPUB/S ... yptography

Indeed, Ed25519 and Curve25519 and diffie-hellman-group-exchange-sha2 are not currently supported by Unimus.
We do have matching Ciphers and MACs for your config, but KEX is a no-match.

For reference, here is what we currently support:
Host keys: ssh-rsa, ssh-dss, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521

Key exchange (KEX): ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha1, diffie-hellman-group-exchange-sha256, diffie-hellman-group-exchange-sha1, diffie-hellman-group1-sha1

Ciphers: aes128-ctr, aes128-cbc, 3des-ctr, 3des-cbc, blowfish-cbc, aes192-ctr, aes192-cbc, aes256-ctr, aes256-cbc

MAC: hmac-md5, hmac-sha1, hmac-sha2-256, hmac-sha1-96, hmac-md5-96
Any chance any of the available KEXes would be acceptable in your environment?
Asiya
Posts: 3
Joined: Sun Sep 16, 2018 10:44 am

Mon Sep 17, 2018 10:02 pm

Hi Tomas,

Our sec team have strict requirements around acceptable ciphers etc so we won't be able to change them.

Is support for the additional KEXes on the roadmap?

Cheers
User avatar
Tomas
Posts: 1206
Joined: Sat Jun 25, 2016 12:33 pm

Tue Sep 18, 2018 10:22 am

I have checked, and this is sadly not currently possible.

To explain how SSH is integrated in Unimus:
Unimus code > SSH code > cryptography providers > crypto algorithm implementation > low-level cryptography engine

We maintain the Unimus and SSH code, but we do not write, or maintain crypto providers or crypto algo implementations.
Just like everyone else, we use open-source crypto libraries for this.
(we are not cryptography experts, and it is much more secure to use community-reviewed crypto implementations)

There currently simply isn't any mature Ed25519 and Curve25519 crypto algorithm implementations for Java yet.
(these crypto algos are quite new - standartized only recently in the TLS 1.3 standard)

As for diffie-hellman-group-exchange-sha2, there is an algo implementation, but there isn't a cryptography provider.
I have checked if we would be able to write a cryptography provider, but sadly that's not a possibility.
DBrooks
Posts: 1
Joined: Mon Jul 22, 2019 3:28 am

Mon Jul 22, 2019 3:44 am

Hi Tomas,

Has there been any recent changes in this space? We recently upgraded the firmware in our Fortigate 600C (5.6.9 build 1673) and it's insisting that we use Ed25519. It no longer is able to discover the device, displaying the same 'ssh_unsupported_algorithm' error.

I'm not aware of any way in FortiOS to disable a specific cipher or force it to use a single one of my choosing without completely disabling 'strong-crypto' which disables everything in the list here: https://kb.fortinet.com/kb/documentLink ... ID=FD36913

I just noticed the list of ciphers that are available when strong-crypto is enabled (see the bottom of that kb), can Unifus work with any of those?

Regards,
DBrooks
User avatar
Tomas
Posts: 1206
Joined: Sat Jun 25, 2016 12:33 pm

Tue Jul 30, 2019 3:57 pm

DBrooks wrote:
Mon Jul 22, 2019 3:44 am
Hi Tomas,

Has there been any recent changes in this space? We recently upgraded the firmware in our Fortigate 600C (5.6.9 build 1673) and it's insisting that we use Ed25519. It no longer is able to discover the device, displaying the same 'ssh_unsupported_algorithm' error.

I'm not aware of any way in FortiOS to disable a specific cipher or force it to use a single one of my choosing without completely disabling 'strong-crypto' which disables everything in the list here: https://kb.fortinet.com/kb/documentLink ... ID=FD36913

I just noticed the list of ciphers that are available when strong-crypto is enabled (see the bottom of that kb), can Unimus work with any of those?
We are currently investigating what is the best way forward on support for newer crypto algos.
No update or changes to announce yet however, as we are still in the early investigation phases.

As for the F5 kb article - there seem to be only HTTPS crypto algos listed there.
We actually support all of those listed in that article in the "hardened" section.

But since Unimus uses SSH, there are 3 separate algos:
KEX (key exchange), Cipher and MAC.

Do you know of any F5 KB article that would list all supported algos for all 3 for SSH so we can take a look?
Vik@Unimus
Posts: 198
Joined: Thu Aug 05, 2021 6:35 pm

Thu Mar 24, 2022 8:57 pm

So while this thread is a little older, I wanted to update this one with the information as well. We have a new Unimus version 2.2.3-Beta1 live now, which contains a new SSH library which comes with improvements to compatibility with newer and stricter algorithms and some other encountered limitations like when a device used some non-standard key sizes for key exchange algorithms. You can find more information in our Beta branch thread

viewtopic.php?f=4&t=1454

and download a new version below

https://unimus.net/download-dev

So in case anyone is still tracking the progress of this thread and if you get a chance, give it a try and let us know if it worked as expected, or if you encounter any other issue.
jpwgc
Posts: 1
Joined: Thu May 05, 2022 5:04 pm

Thu May 05, 2022 5:18 pm

Vik@Unimus wrote:
Thu Mar 24, 2022 8:57 pm
So while this thread is a little older, I wanted to update this one with the information as well. We have a new Unimus version 2.2.3-Beta1 live now, which contains a new SSH library which comes with improvements to compatibility with newer and stricter algorithms and some other encountered limitations like when a device used some non-standard key sizes for key exchange algorithms. You can find more information in our Beta branch thread

viewtopic.php?f=4&t=1454

and download a new version below

https://unimus.net/download-dev

So in case anyone is still tracking the progress of this thread and if you get a chance, give it a try and let us know if it worked as expected, or if you encounter any other issue.
Thank you, this worked for our Mellanox Onyx devices. Now we can finally buy Unimus :D
Post Reply