-
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
openssl_privatekey module's passphrase is obfuscated from unexpected places #590
Comments
looks similar to #587 in some way but I decided to open a new issue to bring proper reproduction steps (and the previous submiter seemed to say his passphrase was not matching output strings) |
This is unfortunately by design of ansible-core, and there's nothing this collection can do about it (except telling users to use proper passwords that don't show up in filenames or other random information). The only thing we (on our side) could do is not mark the passphrase fields as
It's very unlikely if you are using a serious (randomly generated) passphrase. Assuming a 8-char passphrase where every char is taken from the lower- and uppercase ASCII letters + digits, the chance that it matches a random 8-char sequence is less than 10^-14. That is similar likely as winning a 6 from 49 lottery jackpot twice in a row. |
SUMMARY
When generating a private key using
community.crypto.openssl_privatekey
the passphrase used is obfuscated in the whole output. While this can appear a good security measure it can actually be problematic or even leak the passphrase it self without realizing it.the more complex the passphrase the less likely it happens but that's still a problem. In all honesty, that happened to me while working on molecule tests which use a dummy password but that sound like a security risk to me still.
ISSUE TYPE
COMPONENT NAME
openssl_privatekey
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
MacOSX & Linux
STEPS TO REPRODUCE
just run the playbook bellow
EXPECTED RESULTS
the registered variable should have a pristine payload where no data is obfuscated or redacted.
ACTUAL RESULTS
The registered var's payload contains
********
obfuscation string (here in the filename attribute but it could be somewhere else).This make the registered variable unusable in subsequent tasks and gives very good hints of what the passphrase actually is (e.g. in the case, should you know the destination path, you'd be able to guess the passphrase.
The text was updated successfully, but these errors were encountered: