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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ def _ssh_get_port(self):

def _ssh_connect(self):
import paramiko

logger = self.logger

class my_missing_key_policy(paramiko.MissingHostKeyPolicy):
def missing_host_key(self, client, hostname, key):
logger.warn(
f'Unknown {key.get_name()} host key for {hostname}'
)

connected = False
interactive = False
password = self.environment[
Expand All @@ -130,9 +139,7 @@ def _ssh_connect(self):
default='',
)
client = paramiko.SSHClient()
client.set_missing_host_key_policy(
paramiko.WarningPolicy()
)
client.set_missing_host_key_policy(my_missing_key_policy)
# TODO Currently the warning goes only to the log file.
# We should probably write our own policy with a custom
# exception so that we can catch it below and verify with
Expand Down