Skip to main content

ansible-vault-rekey

https://img.shields.io/pypi/v/ansible-vault-rekey.svg https://img.shields.io/travis/inhumantsar/python-ansible-vault-rekey.svg Documentation Status Updates Python version supported

Roll keys and re-encrypt secrets in any repo using Ansible Vault

Usage

WARNING: Very few guardrails present. Running this without options will overwrite data by default.

Known issues / caveats:

  • Shows a callous disregard for whitespace and comments

  • Assumes it’s in a playbook directory if -r isn’t provided

  • Will casually write secrets to STDOUT in –debug mode

$ ansible-vault-rekey --help
Usage: ansible-vault-rekey [OPTIONS]

  (Re)keys Ansible Vault repos.

Options:
  --debug
  --dry-run                 Skip any action that would overwrite an original
                            file.
  -k, --keep-backups        Keep unencrypted copies of files after a
                            successful rekey.
  -r, --code-path TEXT      Path to Ansible code.
  -p, --password-file TEXT  Path to password file. Default: vault-password.txt
  -v, --vars-file TEXT      Only operate on the file specified. Default is to
                            check every YAML file in Ansible role/play dirs
                            for encrypted assets.
  --help                    Show this message and exit.

You can confirm that your secrets were rencryped properly by running debug on an encrypted var or file. eg:

ansible --vault-password-file vault-password.txt -e "@group_vars/all.yml" -i localhost, -c local -m debug -a var=somesecurevar localhost

Installation

pip install ansible-vault-rekey

We have dependencies a couple of layers down which need to compile crypto libraries if you haven’t already got them. On most systems, you’ll need the following:

  • libffi-dev / libffi-devel

  • libssl-dev / openssl-devel

  • gcc

Features

  • TODO

Testing

With Docker (recommended):

docker build -t tmp . && docker run --rm -it -w /workspace -v $(pwd):/workspace tmp

Manually:

pip install -r requirements.txt pytest & python -m pytest tests/*.py

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

2.0.1 (2020-12-31)

  • Fix improper encrypting YAML files

2.0.0 (2020-12-31)

  • Fix dependencies errors

  • Dropped support for Python2 and Python 3.5

  • Added support for Python 3.7, 3.8, 3.9

0.1.0 (2017-10-31)

  • First release on PyPI.

Metadata

Release files for ansible-vault-rekey 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ansible-vault-rekey 2.0.1
File Size Uploaded Provenance
ansible-vault-rekey-2.0.1.tar.gz 11.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ansible-vault-rekey 2.0.1
File Interpreter ABI Platform
ansible_vault_rekey-2.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 22.1 kB

Release files / ansible-vault-rekey-2.0.1.tar.gz

Download URL ansible-vault-rekey-2.0.1.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cbbc6d425deb6f22d525dbcc928fb9d48ae76342c421d9f6b1fa284ee9b7d317
BLAKE2b-256 checksum
How to use checksums
8dd2651013e84930308686c40e74299c19e29e8b31cea7551652b376056a53f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.7

Release files / ansible_vault_rekey-2.0.1-py2.py3-none-any.whl

Download URL ansible_vault_rekey-2.0.1-py2.py3-none-any.whl
Size 10.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5aee4bff099c1a4437ae352fa4734358794cdae9c87694be840fd438f8e9eab8
BLAKE2b-256 checksum
How to use checksums
41ef67208a1a90bd56f0f18879b5529e2a076b5f6ac05ef6e40a6ccce2fa1c83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.7

Security for ansible-vault-rekey 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page