Improve handling of SSH host keys

1. Use StrictHostKeyChecking=accept-new to implicitly accept new SSH
host keys, preventing us from having to do this manually.

2. Use VerifyHostKeyDNS=yes to allow verification of DNSSEC-signed SSHFP
records, if available.
This commit is contained in:
Joshua Boniface 2021-10-31 02:24:28 -04:00
parent e9759a08c2
commit 483f357f2b
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ def clone_repository(clone_url, config):
print(f"Cloning repository...")
if config['ssh_key'] is not None:
ssh_key_file = config['ssh_key']
os.environ['GIT_SSH_COMMAND'] = f'ssh -i {ssh_key_file} -o IdentitiesOnly=yes'
os.environ['GIT_SSH_COMMAND'] = f'ssh -i {ssh_key_file} -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new -o VerifyHostKeyDNS=yes'
os.system(f'git clone {clone_url} repo')