ansible-vault-pass-client
Ansible vault password client script to integrate your password manager (LastPass, 1Password, etc.)
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.6%) to scientific vocabulary
Repository
Ansible vault password client script to integrate your password manager (LastPass, 1Password, etc.)
Basic Info
- Host: GitHub
- Owner: bkahlert
- License: mit
- Language: Shell
- Default Branch: master
- Size: 21.5 KB
Statistics
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 1
Metadata Files
README.md
ansible-vault-pass-client 
About
ansible-vault-pass-client is an Ansible vault password client script to integrate your password manager (LastPass, 1Password, etc.).
Installation
ansible-vault-pass-client is a Bash script.
In order to use it, it needs to be downloaded, put on your $PATH
and made executable, which is exactly what the following line is doing:
shell
sudo curl -LfsSo /usr/local/bin/ansible-vault-pass-client \
https://raw.githubusercontent.com/bkahlert/ansible-vault-pass-client/master/ansible-vault-pass-client
sudo chmod +x /usr/local/bin/ansible-vault-pass-client
Configuration
Edit your .bashrc, .zshrc, ... depending on the password manager you want to integrate.
LastPass
Please install lastpass-cli and customize your environment as follows:
sh
export ANSIBLE_VAULT_PASS_CLIENT=lastpass
export ANSIBLE_VAULT_PASS_CLIENT_USERNAME='john.doe@example.com'
export ANSIBLE_VAULT_PASSWORD_FILE=$(command -v ansible-vault-pass-client)
1Password
You need to install op-cli and follow its instructions to create a so called shorthand which
you'll need in your configuration:
sh
export ANSIBLE_VAULT_PASS_CLIENT=1password
export ANSIBLE_VAULT_PASS_CLIENT_SHORTHAND='<SHORTHAND GOES HERE>'
export ANSIBLE_VAULT_PASSWORD_FILE=$(command -v ansible-vault-pass-client)
Usage
Whenever Ansible needs a password ansible-vault-pass-client will use your configured password manager to retrieve it.
The query used to find the best matching password manager item is based on your current working directory.
If an item is found, its password is returned to Ansible.
Suppose your current working directory is /root/tld.comain/parent/current
- First, the directory's name
currentis given a go. - If nothing is found, the parent directory's name
parentis added:current.parent - If that still no match is produced the search goes on the same way.
Now comes the domain-like nametld.domainwhich will be reversed todomain.tldbefore being added:current.parent.domain.tld - The directory
rootis the last one given a shot:current.parent.domain.tld.root - If no item was matched until now, no password is returned.
If you use a vault ID its label will be added to each query.
For the just described case and the option --vault-id label or --vault-id label@source
this would produce the following queries to be attempted:
current:labelcurrent.parent:labelcurrent.parent.domain.tld:labelcurrent.parent.domain.tld.root:label
Only if the label is default, no label is added to the query.
Testing
To test your configuration, go in a directory of your choosing and type:
shell mkdir -p foo/bar cd foo/bar ansible-vault create secrets.ymlSupposing you don't already have a matching item, you will be informed that no password can be found.
Now create an item with the namebar.fooin your password manager's vault.Try again
ansible-vault create secrets.yml
Ansible should successfully createsecrets.yml.Run
ansible-vault --vault-id baz show secrets.yml
Ansible will be unable to decrypt as it's looking forbar.foo:baz.Change your item's name to
bar.foo:baz.Run
ansible-vault --vault-id baz show secrets.ymlagain.
Ansible will show the contents ofsecrets.yml.Create a new item
bar:bazwith a different password in your password manager's vault.Run
ansible-vault --vault-id baz show secrets.ymlagain.
Ansible will no longer decryptsecrets.ymlbecause itembar:bazis returned instead ofbar.foo:baz.
Contributing
Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You can also support this project by making a PayPal donation to ensure this journey continues indefinitely!
Thanks again for your support, it is much appreciated! :pray:
License
MIT. See LICENSE for more details.
Owner
- Name: Björn Kahlert
- Login: bkahlert
- Kind: user
- Location: Berlin, Germany
- Website: bkahlert.com
- Repositories: 23
- Profile: https://github.com/bkahlert
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- given-names: "Björn"
family-names: "Kahlert"
orcid: "https://orcid.org/0000-0003-1705-4067"
title: "ansible-vault-pass-client — Ansible vault password client script to integrate your password manager (LastPass, 1Password, etc.)"
version: 0.1.0
date-released: 2022-03-07
url: "https://github.com/bkahlert/ansible-vault-pass-client"
GitHub Events
Total
Last Year
Committers
Last synced: 12 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Björn Kahlert | m****l@b****m | 8 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0