All Projects → Luzifer → Vault2env

Luzifer / Vault2env

Licence: apache-2.0
Small utility to transfer fields of a key in Vault into the environment

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Vault2env

as-a
Runs a given command with additional environment settings for simple local development
Stars: ✭ 60 (+900%)
Mutual labels:  utility, environment
Pie
🍕 Enjoy a slice! A utility library for dealing with slices and maps that focuses on type safety and performance.
Stars: ✭ 788 (+13033.33%)
Mutual labels:  utility
Thor
Switch the right application ASAP.
Stars: ✭ 660 (+10900%)
Mutual labels:  utility
Reloading
Change Python code while it's running without losing state
Stars: ✭ 723 (+11950%)
Mutual labels:  utility
Backslide
💦 CLI tool for making HTML presentations with Remark.js using Markdown
Stars: ✭ 679 (+11216.67%)
Mutual labels:  utility
Vault Operator
Run and manage Vault on Kubernetes simply and securely
Stars: ✭ 750 (+12400%)
Mutual labels:  vault
Vault Guides
Example usage of HashiCorp Vault secrets management
Stars: ✭ 636 (+10500%)
Mutual labels:  vault
Xonotic Map Manager
A command line package manager for Xonotic community maps
Stars: ✭ 5 (-16.67%)
Mutual labels:  utility
Remeda
A utility library for JavaScript and TypeScript.
Stars: ✭ 774 (+12800%)
Mutual labels:  utility
Quicktile
Adds window-tiling hotkeys to any X11 desktop. (An analogue to WinSplit Revolution for people who don't want to use Compiz Grid)
Stars: ✭ 719 (+11883.33%)
Mutual labels:  utility
Embedmd
embedmd: embed code into markdown and keep everything in sync
Stars: ✭ 714 (+11800%)
Mutual labels:  utility
Devutils
🔥 ( 持续更新,目前含 160+ 工具类 ) DevUtils 是一个 Android 工具库,主要根据不同功能模块,封装快捷使用的工具类及 API 方法调用。该项目尽可能的便于开发人员,快捷、高效开发安全可靠的项目。
Stars: ✭ 680 (+11233.33%)
Mutual labels:  environment
Utils
A collection of useful PHP functions, mini classes and snippets that you need and can use every day.
Stars: ✭ 750 (+12400%)
Mutual labels:  utility
Plots2
a collaborative knowledge-exchange platform in Rails; we welcome first-time contributors! 🎈
Stars: ✭ 666 (+11000%)
Mutual labels:  environment
Tip
Programmable tooltip that can be used with any Mac OS app
Stars: ✭ 798 (+13200%)
Mutual labels:  utility
Basscss
Low-level CSS Toolkit – the original Functional/Utility/Atomic CSS library
Stars: ✭ 5,669 (+94383.33%)
Mutual labels:  utility
Goto
Alias and navigate to directories with tab completion in Linux
Stars: ✭ 698 (+11533.33%)
Mutual labels:  utility
Pydash
The kitchen sink of Python utility libraries for doing "stuff" in a functional way. Based on the Lo-Dash Javascript library.
Stars: ✭ 728 (+12033.33%)
Mutual labels:  utility
Fabio
Consul Load-Balancing made simple
Stars: ✭ 6,834 (+113800%)
Mutual labels:  vault
Git Repo
Git-Repo: CLI utility to manage git services from your workspace
Stars: ✭ 818 (+13533.33%)
Mutual labels:  utility

Go Report Card

Luzifer / vault2env

vault2env is a really small utility to transfer fields of a key in Vault into the environment. It uses the app-role or simple token authentication to identify itself with the Vault server, fetches all fields in the specified keys and returns export directives for bash / zsh. That way you can do eval stuff and pull those fields into your ENV. If you don't want to use export directives you also can pass commands to vault2env to be executed using those environment variables.

Usage

In general this program can either output your ENV variables to use with eval or similar or it can run a program with populated environment.

$ vault2env --key=<secret path> <command>
<program is started, you see its output>

$ vault2env --export --key=<secret path>
export ...

For further examples and "special cases" see the Wiki: Usage Examples

Using evironment variables

# export VAULT_ADDR="https://127.0.0.1:8200"
# export VAULT_ROLE_ID="29c8febe-49f5-4620-a177-20dff0fda2da"
# export VAULT_SECRET_ID="54d24f66-6ecb-4dcc-bdb7-0241a955f1df"
# vault2env --export --key=secret/my/path/with/keys
export FIRST_KEY="firstvalue"
export SECOND_KEY="secondvalue"

# eval $(vault2env --export --key=secret/my/path/with/keys)
# echo "${FIRST_KEY}"
firstvalue

Using CLI parameters

The command does differ only with its parameters specified for the different authentication mechanisms:

  • When using AppRole you need to specify --vault-role-id and optionally --vault-secret-id if you're using the bind_secret_id flag for your AppRole
  • When using Token auth only specify --vault-token
# vault2env --vault-addr="..." --vault-app-id="..." --vault-user-id="..." --key=secret/my/path/with/keys
export FIRST_KEY="firstvalue"
export SECOND_KEY="secondvalue"

Though it's possible to use CLI parameters I strongly recommend to stick to the ENV variant as it's possible under certain conditions to read CLI parameters on a shared system using for example ps aux.


project status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].