pyinfra-dev / pyinfra-dev/pyinfra
password vault
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6k
- Forks
- 548
- Avg merge
- 7d 17h
- Merged PRs (30d)
- 13
Description
Pyinfra2 is missing a useful feature from Ansible, which is the password vault. Oftentimes, you need to use credentials and other secrets in your tasks. For example, you might need to write a config file on the remote host that includes a password. Ideally, task code could do something like this:
vault = pyinfra.get_vault()
files.template(src=whatever, dest=whatever, some_password=vault.get('password.myserver.elasticsearch')
Ideally the vault is specified on the command line, and the password can be in a file:
pyinfra --vault ~/.config/my_vault --vault_pw_file ~/.config/my_vault_pw ...
Also, pyinfra would need to securely transfer files over to the other system. The main problem with the way it does it in ssh.py:put_file is that it creates a temp file and writes the contents of the file (potentially with a secret embedded in the text), and after that it moves the file to its proper location and sets the owner and mode bits. Before it moves the file, it could be accessed on the remote machine.
This means that even if someone implements their own secure vault, they still can't securely transfer files to the target system.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading ssh.py:put_file and the command-line handling described for --vault and --vault_pw_file. Trace how templated file contents reach the remote host, then define the vault access and transfer behavior needed to keep secrets protected; done means both requested vault usage and secure file transfer are addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- infrastructure, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100