GithubHelp home page GithubHelp logo

asmtal / consul-vault Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adamgoldsmith/consul-vault

0.0 0.0 0.0 5.49 MB

HashiCorp Vault service running on Consul cluster backend with HAProxy frontend

License: MIT License

Shell 46.64% HCL 53.36%

consul-vault's Introduction

Hashicorp vault & consul cluster

License: MIT

Installs & configures Hashicorp's Consul & Vault + HAProxy to run as an HA cluster

Note: Please see this repo for a similar project that uses the latest integrated storage backend made available in Vault 1.4 release, removing the need for a Consul-based backend storage deployment

Symbolic representation overview of deployment

Alt text

Consul UI Dashboard

Alt text

Although the vault installation creates OpenSSL TLS private key, CSR & resultant certificate, the URI modules in these roles currently use "validate_certs: no". It is up to you to complete the TLS configuration.

WARNING - When vault is initialized, the master key shards & root token are stored in the ansible user's HOME dir on the Ansible control machine. This is NOT good practice, but was used to get things running. I am considering various future options that won't break the non-interactive execution of the playbooks, such as ansible vault'ing the file with a pre-defined ansible vault password file. But this is really no more secure than the current setup. Hashicorp vault has the ability to encrypt the master key shards using PGP, GPG, and Keybase. This is the ideal solution but might prove too difficult to implement while maintaining non-interactive playbook execution.

Heavily based on the documentation supplied by HashiCorp at https://www.vaultproject.io/guides/operations/vault-ha-consul.html

Currently tested on these Operating Systems

  • Oracle Linux/RHEL/CentOS 7 (Note: Enables EPEL repo using Jeff Geerling's EPEL role)
  • Debian/Stretch64

Requirements

  • Hashicorp Vagrant
  • Ansible 2.5 or higher

Dependencies

  • Requires elevated root privileges
  • Copy Ansible control machine user's public SSH key (usually called id_rsa.pub) into the vagrant working directory

Getting the code

git clone https://github.com/AdamGoldsmith/consul-vault.git --recurse-submodules

Running the deployment

cd vagrant
export BOX_NAME="centos/7"     # Optional (defaults to debian/stretch64)
vagrant up

On the Ansible Control Machine

To deploy

./deploy.sh

or

ansible-playbook playbooks/site.yml

To remove

./deploy.sh -t remove

or

ansible-playbook playbooks/site.yml --tags 'remove'

asciicast

Known Issues

  • deploy.sh

The deploy.sh script has been updated to use /bin/bash which might not be universally available on your system so you may need to update this to use the shell of your choice.

  • PyOpenSSL

If you get the message "You need to have PyOpenSSL>=0.15 to generate CSRs", then it is most likely an issue with the OpenSSL package that python has imported. When pyOpenSSL is installed/upgraded via the PIP Ansible module in this playbok, it will install the python package under /usr/lib/pythonx.x/site-packages, however it is possible that another OpenSSL python package could be installed under /usr/lib64/pythonx.x/site-packages that is being loaded in preference to the higher-level package.
In order to prevent this happening, temporarily move the directory "/usr/lib64/pythonx.x/site-packages/OpenSSL" out of the way while running this playbook.

License

MIT License

Author Information

Adam Goldsmith

consul-vault's People

Contributors

adamgoldsmith avatar

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.