GithubHelp home page GithubHelp logo

vault-auto-backup's Introduction

How to have the latest data every time

using watches and handlers in cosul we can monitor for changes in consul Based on vault doc data of secret enginese saved in logical path of kv So we should monitor consul kv kv/vault-ha/logical and the watch should execute and backup from the consul In this way we can have automated and updated backup.

Setup

Run setup.sh with the kv store of vault in consul. so, if kv store of vault in Consul is v1/vault-ha/original so it will be ./setup.sh

What it does?

Setup script will watch over data of vault secret engines' changes which is persistent in consul, whenever a change happen watch notify handler to trigger handler run consul snapshot cmd to save a snapshot locally. Note: for preventing lots of backup creation we will save just the last backup of the day called: /backup/backup-YYYY-mm-dd".back logs will be in /backup/vault-backup-logs.log

Docker way

docker build -t vault-backup . create image and you can add it to the consul server with three env:

CONSUL_HTTP_TOKEN= <token of consul with acl access>
KV_PATH=<key/vale path of vault in consul>
CONSUL_HTTP_ADDR=<http address of consul for connecting consul agent to>

Executing container with args:

docker run afrouzmash/vault-backup:v1 -it --name vault-backup -e CONSUL_HTTP_TOEKN=blahblah -e KV_APTH=vault-ha -e CONSUL_HTTP_ADDR=http://127.0.0.1:8500 -v /backup:/backup
docker exec -it vault-backup ./setup.sh

you can run docker image as an deployment or a sideCar

kubectl apply -f ./

vault-auto-backup's People

Contributors

afrouzmashayekhi avatar

Watchers

 avatar  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.