juju generates/uses insecure ssh keys

Bug #1974132 reported by Loïc Gomez
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Jack Shaw

Bug Description

Juju generates insecure RSA 2048 client SSH keys in .local/share/juju/ssh/juju_id_rsa.

We need juju to use RSA keys of at least 4096 bits length or even better, use ed25519 keys.

Tags: canonical-is
Loïc Gomez (kotodama)
description: updated
tags: added: canonical-is
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1974132] [NEW] juju generates/uses insecure ssh keys

I don't think it is problematic to move, but as far as I can tell NIST
considers 2048 secure through 2030, and only really recommends going to
3072 beyond that point. (At least, that is what I can pull from:
https://csrc.nist.gov/publications/detail/sp/800-57-part-1/rev-5/final
).

On Thu, May 19, 2022 at 3:16 AM Loïc Gomez <email address hidden>
wrote:

> Public bug reported:
>
> Juju generates insecure RSA 2048 client SSH keys in
> .local/share/juju/ssh/juju_id_rsa.
>
> We need juju to use RSA keys of at least 4096 bits length or even
> better, use ed25519 keys.
>
> ** Affects: juju
> Importance: Undecided
> Status: New
>
>
> ** Tags: canonical-is
>
> ** Description changed:
>
> Juju generates insecure RSA 2048 client SSH keys in
> .local/share/juju/ssh/juju_id_rsa.
>
> We need juju to use RSA keys of at least 4096 bits length or even
> - better, use ed25519 256+ keys.
> + better, use ed25519 keys.
>
> ** Tags added: canonical-is
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1974132
>
> Title:
> juju generates/uses insecure ssh keys
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1974132/+subscriptions
>
>

Revision history for this message
Loïc Gomez (kotodama) wrote :

Indeed, but NIST is only listing minimum sizes, not recommended ones ;)
We need to use 4096bits when we can, 2048 makes sense only when using outdated software.

For example, Debian is recommending 4096 keys since 2010:
https://lists.debian.org/debian-devel-announce/2010/09/msg00003.html

See this article for more details: https://danielpocock.com/rsa-key-sizes-2048-or-4096-bits/

Revision history for this message
Harry Pidcock (hpidcock) wrote :

We did some work in this area around ed25519, I proposed we remove RSA2048 in 3.1.

Changed in juju:
importance: Undecided → High
milestone: none → 3.1-beta1
status: New → Triaged
Revision history for this message
Loïc Gomez (kotodama) wrote :

Nice, thank you!

Jack Shaw (jack-shaw)
Changed in juju:
assignee: nobody → Jack Shaw (jack-shaw)
Changed in juju:
milestone: 3.1-beta1 → 3.1-rc1
Revision history for this message
Jack Shaw (jack-shaw) wrote :

Hi there

To quickly resolve this, we have decided to make the quick change of sticking with rsa upping the bit count to 3072 for new keys.

A future piece of work may introduce Ed25519, ECDSA, etc. as well as resolving this relevant issue:
https://bugs.launchpad.net/juju/+bug/1951597

Revision history for this message
Jack Shaw (jack-shaw) wrote :
Revision history for this message
Loïc Gomez (kotodama) wrote :

Hi Jack,

Thank you, that's a start!
Is there any rationale behind not bumping key size to 4096 bits altogether?

Jack Shaw (jack-shaw)
Changed in juju:
status: Triaged → Fix Committed
Revision history for this message
Jack Shaw (jack-shaw) wrote :

Yes. It came down to a question of balancing security and speed. 3072 bits was found to be sufficiently secure whilst not having too great an impact on performance

Ideally, as you point out, Ed25519 would be used. However, Ed25519 isn't currently considered FIPS compliant so we would need a way switch back to RSA or to ECDSA.

This, combined with concerns expressed here https://bugs.launchpad.net/juju/+bug/1951597 lead us to the conclusion that SSH keys could do with being reworked to

However, Juju is currently in feature-freeze until 3.1 is released. Perhaps this is something we will see in 3.2

Revision history for this message
Junien F (axino) wrote :

@jack-shaw : Hello ! Would you have a link to how the performance measurements were done ? Thanks !

Revision history for this message
Jack Shaw (jack-shaw) wrote :

https://webmasters.stackexchange.com/questions/84838/performance-4096-bit-rsa-key-compared-to-2048-bit-rsa-key

As `openssl speed rsa2048 rsa3072 rsa4096` reveals, on a relative basis, 4096 bit is a significantly slower

However, upon further investigation the impact this will have on Juju's UX is quite minimal. And Debian recommending 4096 does provide a compelling reason to match, so I think on second viewing we will go straight up to 4096

Revision history for this message
Loïc Gomez (kotodama) wrote :

Wonderful news, thank you!

Revision history for this message
Harry Pidcock (hpidcock) wrote :

rsa4096 seems like a good compromise until we can properly design ways to configure juju to generate keys with different ciphers/parameters.

Jack Shaw (jack-shaw)
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.