Enforce 0600 permissions on private SSH key file.

Change-Id: Ic0864c5cd8f5ad196e76b3cea45f95662121a582
Closes-Bug: #1859244
Signed-off-by: Luke Short <ekultails@gmail.com>
This commit is contained in:
Luke Short 2020-01-12 19:52:04 -05:00
parent a4ca6e83ba
commit 3d06657c90
1 changed files with 1 additions and 0 deletions

View File

@ -1451,6 +1451,7 @@ def ssh_private_key(workdir, key):
return None
if (isinstance(key, six.string_types) and
os.path.exists(key)):
os.chmod(key, 0o600)
return key
path = os.path.join(workdir, 'ssh_private_key')