Giter Site home page Giter Site logo

nathandines / docker-vault-samplewebapp Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 59 KB

A demonstration of how Vault can be used by an application to authenticate to a database backend using dynamically generated credentials

License: MIT License

Shell 1.50% Python 0.83% HTML 0.76% CSS 96.90%

docker-vault-samplewebapp's Introduction

docker-vault-samplewebapp

Description

This repo contains a (potential) example pattern which could be used when utilising Vault as a secret backend for a webapp which needs to access a PostgreSQL DB backend.

This example relies on an automated process (start_app.sh emulates this) deploying a webapp, and passing it wrapped approle credentials, which it then uses to generate a Vault token which consul-template maintains the renewal for, while a Python webapp hosts a simple people list database; the page also exposes some of the database authentication information.

Please be aware that Vault starts in dev mode using an in-memory storage backend. This example is not provided to indicate the proper implementation of a Vault setup, but rather it suggests how your application could authenticate against an already active Vault implementation.

Requirements

  • Docker (uses docker-compose)
  • Vault (binary must be accessible from your PATH)

How to use

Everything is scripted, so you should be able to get by, by simply doing the following:

Setup the Vault and PostgreSQL backend:

./init_backend.sh

Run the webapp (you can navigate to this on http://localhost:80):

./start_app.sh

Clean up your environment when complete:

./clean_environment.sh

docker-vault-samplewebapp's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

albertfougy

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.