cheffish icon indicating copy to clipboard operation
cheffish copied to clipboard

encrypted ssh keys are overwritten if a pass_phrase is not defined

Open cfortier2 opened this issue 10 years ago • 2 comments

If you attempt to use an existing encrypted ssh_key but do not provide a pass_phrase, the keyformatter can't read key and is 'rescued' by returning nil.

The private_key class receives a 'nil' key and generates then overwrites the existing key.

cfortier2 avatar Jul 10 '14 17:07 cfortier2

the issue can be replicated by: create encrypted ssh keys add those keys to AWS account

run chef-metal with a block like: fog_key_pair 'foo' do private_key_path "#{ec2keydir}/foo" public_key_path "#{ec2keydir}/foo.pub" end

chef will error out with mismatched fingerprints and the original ssh key will be overwritten.

cfortier2 avatar Jul 10 '14 17:07 cfortier2

this is rather bad.

lamont-granquist avatar Dec 07 '16 18:12 lamont-granquist