-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
passwordstore: Distinguish between subdirs and passwords, don't use path names as passwords #4185
Closed
1 task done
Comments
Files identified in the description: If these files are incorrect, please update the |
ansibullbot
added
bug
This issue/PR relates to a bug
lookup
lookup plugin
plugins
plugin (any type)
labels
Feb 10, 2022
grembo
added a commit
to grembo/community.general
that referenced
this issue
Feb 17, 2022
Given a password stored in _path/to/secret_, requesting the password _path/to_ will literally return `path/to`. This can lead to using weak passwords by accident/mess up logic in code, based on the state of the password store. This is worked around by applying the same logic `pass` uses: If a password was returned, check if there is a .gpg file it could have come from. If not, treat it as missing. Fixes ansible-collections#4185
felixfontein
pushed a commit
that referenced
this issue
Feb 17, 2022
Given a password stored in _path/to/secret_, requesting the password _path/to_ will literally return `path/to`. This can lead to using weak passwords by accident/mess up logic in code, based on the state of the password store. This is worked around by applying the same logic `pass` uses: If a password was returned, check if there is a .gpg file it could have come from. If not, treat it as missing. Fixes #4185
patchback bot
pushed a commit
that referenced
this issue
Feb 17, 2022
Given a password stored in _path/to/secret_, requesting the password _path/to_ will literally return `path/to`. This can lead to using weak passwords by accident/mess up logic in code, based on the state of the password store. This is worked around by applying the same logic `pass` uses: If a password was returned, check if there is a .gpg file it could have come from. If not, treat it as missing. Fixes #4185 (cherry picked from commit da49c09)
patchback bot
pushed a commit
that referenced
this issue
Feb 17, 2022
Given a password stored in _path/to/secret_, requesting the password _path/to_ will literally return `path/to`. This can lead to using weak passwords by accident/mess up logic in code, based on the state of the password store. This is worked around by applying the same logic `pass` uses: If a password was returned, check if there is a .gpg file it could have come from. If not, treat it as missing. Fixes #4185 (cherry picked from commit da49c09)
felixfontein
pushed a commit
that referenced
this issue
Feb 17, 2022
Given a password stored in _path/to/secret_, requesting the password _path/to_ will literally return `path/to`. This can lead to using weak passwords by accident/mess up logic in code, based on the state of the password store. This is worked around by applying the same logic `pass` uses: If a password was returned, check if there is a .gpg file it could have come from. If not, treat it as missing. Fixes #4185 (cherry picked from commit da49c09) Co-authored-by: grembo <freebsd@grem.de>
felixfontein
pushed a commit
that referenced
this issue
Feb 17, 2022
Given a password stored in _path/to/secret_, requesting the password _path/to_ will literally return `path/to`. This can lead to using weak passwords by accident/mess up logic in code, based on the state of the password store. This is worked around by applying the same logic `pass` uses: If a password was returned, check if there is a .gpg file it could have come from. If not, treat it as missing. Fixes #4185 (cherry picked from commit da49c09) Co-authored-by: grembo <freebsd@grem.de>
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Due to the way
pass
functions,lookup('passwordstore', 'some/item')
either returns:some/item.gpg
:some/item
, in case item happens to be a tree node:This makes using passwordstore in ansible playbooks error prone, using
weak passwords by accident when a password is read from the store for
setting up an account. This can be triggered in two ways:
Ideally,
pass
would provide a command/command line option that could be utilizedto really only retrieve a password and fail otherwise (does anyone know how to
contribute to the project?).
While such a command/command option doesn't exist in
pass
, some possible workarounds:$PASSWORD_STORE_DIR/some/item.gpg
exists (the more stable option, as this is whatpass
does internally to check if there is something to decrypt)pass
matches the path requested (and if it does, return an error)Issue Type
Bug Report
Component Name
passwordstore
plugins/lookup/passwordstore
Ansible Version
Community.general Version
Configuration
OS / Environment
FreeBSD 13.0-p7
Steps to Reproduce
Prepare password store:
Run this example playbook:
Expected Results
I would expect this to fail, as the password doesn't exist (missing actions like "create" won't make sense in this context).
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: