util.py[WARNING]: Failed generating key type ed25519 to file /etc/ssh/ssh_host_ed25519_key in FIPS enforcing mode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Committed
|
Undecided
|
Anirban Sinha |
Bug Description
With fips enabled, cloud-init has warning log about "Failed generating key type ed25519 to file /etc/ssh/
According to doc(https:/
2023-04-17 03:46:38,665 - util.py[DEBUG]: Restoring selinux mode for /etc/ssh (recursive=True)
2023-04-17 03:46:38,672 - subp.py[DEBUG]: Running command ['ssh-keygen', '-t', 'ed25519', '-N', '', '-f', '/etc/ssh/
2023-04-17 03:46:38,721 - util.py[WARNING]: Failed generating key type ed25519 to file /etc/ssh/
2023-04-17 03:46:38,722 - util.py[DEBUG]: Failed generating key type ed25519 to file /etc/ssh/
Traceback (most recent call last):
File "/usr/lib/
out, err = subp.subp(cmd, capture=True, env=lang_c)
File "/usr/lib/
raise ProcessExecutio
cloudinit.
Command: ['ssh-keygen', '-t', 'ed25519', '-N', '', '-f', '/etc/ssh/
Exit code: 255
Reason: -
Stdout:
Stderr: ED25519 keys are not allowed in FIPS mode
2023-04-17 03:46:38,723 - util.py[DEBUG]: Restoring selinux mode for /etc/ssh (recursive=True)
2023-04-17 03:46:38,727 - util.py[DEBUG]: Reading from /etc/ssh/
This issue is seen on RHEL 9.1 but can be reproduced on other versions of RHEL. The warning is introduced in ssh-keygen with the following Fedora 26 patch : https:/
commit 9dbec70c9c30350
Author: Jakub Jelen <email address hidden>
Date: Fri Jun 30 12:18:02 2017 +0200
Sync FIPS patch with RHEL
so it has been for a while but it's a valid warning.
Steps to Reproduce:
Manual:
1. Boot into an RHEL-9.1 system with fips enabled
2. Try to clean and init cloud-init again
$ sudo cloud-init clean
$ sudo cloud-init init
cloud-init needs to check fips mode and not generate those keys that are not valid when fips is enabled.
Changed in cloud-init: | |
assignee: | nobody → Anirban Sinha (anisinha) |
Thank you for submitting this bug and the related pull request to cloud-init and improving cloud-init for other downstreams.
Upstream Pull Request in progress https:/ /github. com/canonical/ cloud-init/ pull/2142.
Thanks for representing this warning from cloud-init.log for ed25519 keys, do you also have a capture of cloud-init.log representing the WARNING for DSA key generation as well?
Given that the related PR is trying to avoid both DSA and ED25519 keys, I just wanted to confirm Redhat is seeing failures for ssh-keygen of both ed25519 and DSA keys.
running the following should give us that confirmation: keygen| Stderr: ' /var/log/ cloud-init. log
egrep 'WARN|ssh-
One inconsistency I'm seeing on Ubuntu FIPS systems is that ssh-keygen of ED25519 type seems to be allowed. So, it may not be as simple as avoiding ssh-keygen of both DSA and ED25519 key types.