Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remote engine fips mode #652

Merged
merged 1 commit into from
Sep 20, 2022
Merged

Conversation

didib
Copy link
Member

@didib didib commented Sep 13, 2022

No description provided.

@didib didib force-pushed the fix-remote-engine-fips-mode branch 3 times, most recently from d6b546f to 37e63e6 Compare September 20, 2022 06:44
In fips mode, we fail with:
  File "/usr/lib/python3.6/site-packages/otopi/context.py", line 132, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine-dwh/core/remote_engine.py", line 83, in _remote_engine_customization
    oenginecons.ConfigEnv.ENGINE_FQDN
  File "/usr/share/ovirt-engine/setup/ovirt_engine_setup/remote_engine.py", line 146, in configure
    self._style.configure(fqdn=fqdn)
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-common/base/remote_engine/remote_engine_root_ssh.py", line 177, in configure
    self._ssh_connect()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-common/base/remote_engine/remote_engine_root_ssh.py", line 153, in _ssh_connect
    osetupcons.ConfigEnv.REMOTE_ENGINE_HOST_CLIENT_KEY
  File "/usr/lib/python3.6/site-packages/paramiko/client.py", line 416, in connect
    self, server_hostkey_name, server_key
  File "/usr/lib/python3.6/site-packages/paramiko/client.py", line 837, in missing_host_key
    key.get_name(), hostname, hexlify(key.get_fingerprint())
  File "/usr/lib/python3.6/site-packages/paramiko/pkey.py", line 180, in get_fingerprint
    return md5(self.asbytes()).digest()

This is because we use paramiko.WarningPolicy, which uses
get_fingerprint to show the missing key, which uses hashlib.md5 [1],
which is disabled in fips mode.

Create our own policy instead, that does not show the key.

Please note that this isn't a complete fix for [1] - e.g. if you have
any keys in normal locations, such as ~/.ssh/id_rsa, paramiko will fail
later, when mentioning that it's going to try loading them.

[1] paramiko/paramiko#1103

Change-Id: I99a934ceefc707cdff127229d1bebf196aac4140
Signed-off-by: Yedidyah Bar David <didi@redhat.com>
Copy link
Member

@mwperina mwperina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@didib didib merged commit d7adf05 into oVirt:master Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants