Giter Club home page Giter Club logo

ansible-filter-eyaml's Introduction

ansible-filter-eyaml

Ansible filter plugin to de-crypt eyaml encrypted variables

The typical approach to encrypting secrets with Ansible is to use ansible-vault or alternatively a third party encryption tool such as git-crypt. The problem with both of these methods is that they perform full file encryption thus turning your inventory and variable files into binary blobs. This makes it difficult to navigate and version your inventory facts within your chosen revision control system.

[Hiera-eyaml] ( https://github.com/TomPoulton/hiera-eyaml ) is a backend for the puppet hiera key/value store. It provides per-value / in-line encryption of sensitive data within yaml files. This jinja2 filter_plugin provides support for eyaml de-cryption in ansible.

Given the following yaml file:

---
plaintext_variable: “my variable”
secret_variable: >
    ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEw
    DQYJKoZIhvcNAQEBBQAEggEAlAsdarpE3+YcDCR2/VOcVo2URlmgTA0G1GKH
    idHXKry/mc7irPGErhnAO/T++MUQtyiNCEm0hEOx+y1fDUv0v3NNzXvhoDwl
    ug0xJEOVToE5PR5aPXnmj8QtCrwRbbkiq4PXkxPsznhVn5k70wlI3C9SbciF
    xV6pjHHOzYoC/E9cdw9CvtzoTmKPJzAVhIAwC7g7eqvOW41JySO3AEwjj49I
    e6V9X0OtmEAYxXjjbtiq2LRqzQ3QP3rHbiGeHjNoq0S+6umuoMZblDvGnGQu
    0Vd61IS+IcsLPv0/EMFnzme2D8HXc+C5hD31AzfMWzOT8c85iRUlohyXTokS
    XRZxbzA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBC4VCBEfwwPn33Rbd0t

The in-line encrypted variable can be referenced and automaticly de-crypted within your ansible plays/roles using the following Jinja2 instantiation {{ secret_variable | eyaml }}.

Obvioulsy it depends on a working installation of hiera-eyaml being avaialble.

The script expects a file named "eyaml.yml" next to itself, in which the paths to the private and public key used for (en|de)cryption. (An example is provided in this repository)

To produce encrypted variables for inclusion in your inventory you can use the eyaml command line tool:

eyaml encrypt -s "plain text variable"

Author

ansible-filter-eyaml's People

Contributors

cmstokoe avatar gunzl1ng3r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yujunz

ansible-filter-eyaml's Issues

Updated dependencies

Is this still relevant now ansible has the functionality as a first class citizen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.