-
Notifications
You must be signed in to change notification settings - Fork 89
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
openssh_keypair: Adding passphrase parameter #225
openssh_keypair: Adding passphrase parameter #225
Conversation
4a80b08
to
0a97d10
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution! I really like it :)
What do you think of (probably more for a follow-up PR ;) ) adding backends to openssh_keypair, similar to the cryptography
vs pyopenssl
backends for some of the openssl_*
modules? Assuming that the code for the cryptography
backend would only rely on cryptography
and no longer would need ssh-keygen
.
tests/integration/targets/openssh_keypair/tasks/setup_cryptography.yml
Outdated
Show resolved
Hide resolved
Freeing this module from |
Great!
Well, I'd already be happy if only the (
We definitely do not want to maintain that :-) |
@@ -0,0 +1,24 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be at some point moved to tests/integration/targets/setup_bcrypt/ so it can be used by other integration tests as well. No need to do that in this PR though :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sorry was just pushing through issues with CI so there's definitely cleanup work to be done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tell me whether you want to do more work on the PR right now, or in a follow-up PR.
I'm good to go with this PR for now. |
@Ajpantuso thanks for working on this! :) |
SUMMARY
Added
passphrase
paramter toopenssh_keypair
for encrypting/decrypting OpenSSH private keys.ISSUE TYPE
COMPONENT NAME
plugins/modules/openssh_keypair
plugins/module_utils/openssh/cryptography_openssh
ADDITIONAL INFORMATION
openssh_keypair
cryptography
instead of ssh_keygen to avoid passing passphrases over command linepassphrase
is used as a switch so if empty or not supplied behavior will be the same as before this feature (Some more lines are included intry
blocks, but are really just variable assignments)cryptography_openssh
Integration tests have been updated as well.
Unfortunately the following containers have system packages of
cryptography
less than what is required to replicate the installed OpenSSH versions and the local pip versions are not able to install an updated version.For these containers currently only the test cases which do not use the
passphrase
option are executed.