All Projects → lrstanley → vault-unseal

lrstanley / vault-unseal

Licence: MIT license
auto-unseal utility for Hashicorp Vault

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to vault-unseal

vault-plugin-secrets-wireguard
Vault's plugin for managing server and dynamic client configurations
Stars: ✭ 41 (-28.07%)
Mutual labels:  vault, hashicorp
vauth
VMware vSphere VM Identity Platform
Stars: ✭ 32 (-43.86%)
Mutual labels:  vault, hashicorp
vaultrs
An asynchronous Rust client library for the Hashicorp Vault API
Stars: ✭ 63 (+10.53%)
Mutual labels:  vault, hashicorp
Ansible Vault
🔑 Ansible role for Hashicorp Vault
Stars: ✭ 189 (+231.58%)
Mutual labels:  vault, hashicorp
vault-terraform-demo
Deploy HashiCorp Vault with Terraform in GKE.
Stars: ✭ 47 (-17.54%)
Mutual labels:  vault, hashicorp
vault-consul-kubernetes
vault + consul on kubernetes
Stars: ✭ 60 (+5.26%)
Mutual labels:  vault, hashicorp
teller
Cloud native secrets management for developers - never leave your command line for secrets.
Stars: ✭ 998 (+1650.88%)
Mutual labels:  vault, hashicorp
Vaultron
🤖 Vault clusters Terraformed onto Docker for great fun and learning!
Stars: ✭ 96 (+68.42%)
Mutual labels:  vault, hashicorp
vault-consul-docker
Vault + Consul + Docker
Stars: ✭ 75 (+31.58%)
Mutual labels:  vault, hashicorp
vaulter
No description or website provided.
Stars: ✭ 23 (-59.65%)
Mutual labels:  vault, hashicorp
Hashi Helper
Disaster Recovery and Configuration Management for Consul and Vault
Stars: ✭ 155 (+171.93%)
Mutual labels:  vault, hashicorp
vault-consul-swarm
Deploy Vault and Consul with Docker Swarm
Stars: ✭ 20 (-64.91%)
Mutual labels:  vault, hashicorp
Kubernetes External Secrets
Integrate external secret management systems with Kubernetes
Stars: ✭ 2,412 (+4131.58%)
Mutual labels:  vault, hashicorp
hashicorp-labs
Deploy locally on VM an Hashicorp cluster formed by Vault, Consul and Nomad. Ready for deploying and testing your apps.
Stars: ✭ 32 (-43.86%)
Mutual labels:  vault, hashicorp
Hashi Up
bootstrap HashiCorp Consul, Nomad, or Vault over SSH < 1 minute
Stars: ✭ 113 (+98.25%)
Mutual labels:  vault, hashicorp
vault-load-testing
Automated load tests for Vault and Consul using the locust.io Python framework
Stars: ✭ 44 (-22.81%)
Mutual labels:  vault, hashicorp
Vault.net
.NET API client for vault
Stars: ✭ 74 (+29.82%)
Mutual labels:  vault, hashicorp
Vault Ui
Vault-UI — A beautiful UI to manage your Vault, written in React
Stars: ✭ 1,296 (+2173.68%)
Mutual labels:  vault, hashicorp
hookpick
A tool to manage some operational concepts of Hashicorp Vault
Stars: ✭ 83 (+45.61%)
Mutual labels:  vault, hashicorp
nomad-box
Nomad Box - Simple Terraform-powered setup to Azure of clustered Consul, Nomad and Traefik Load Balancer that runs Docker/GoLang/Java workloads. NOTE: Only suitable in dev environments at the moment until I learn more Terraform, Consul, Nomad, Vault :P
Stars: ✭ 18 (-68.42%)
Mutual labels:  vault, hashicorp

vault-unseal -- auto-unseal utility for Hashicorp Vault

🔗 Table of Contents

Why

Depending on your use-case for Vault, you may or may not have opted for Vault Enterprise. If you have not, auto-unseal functionality for on-prem is currently only in enterprise (for cloud, it is now in the OSS version). If what you are storing in vault isn't sensitive enough to require human intervention, you may want to roll your own unseal functionality. The problem with this is it is very hard to do safely.

So, what do we need to solve? we want to auto-unseal a vault, by providing the necessary unseal tokens when we find vault is sealed. We also want to make sure we're sending notifications when this happens, so if vault was unsealed unintentionally (not patching, upgrades, etc), possibly related to crashing or malicious intent, a human can investigate at a later time (not 3am in the morning).

✔️ Solution

The goal for this project is to find the best way to unseal vault in a way that doesn't compromise too much security (a good balance between security and ease of use/uptime), without the requirement of Vault Enterprise, or having to move to a cloud platform.

We do this by running multiple instances of vault-unseal (you could run one on each node in the cluster). Each instance of vault-unseal is given a subset of the unseal tokens. You want to give each node just enough tokens, that when paired with another vault-unseal node, they can work together to unseal the vault. What we want to avoid is giving a single vault-unseal instance enough tokens to unseal (to prevent a compromise leading to enough tokens being exposed that could unseal the vault). Let's use the following example:

  • cluster-1 consists of 3 nodes:
    • node-1
    • node-2
    • node-3
  • cluster-1 is configured with 5 unseal tokens (tokens A, B, and C), but 3 are required to unseal a given vault node.
  • given there are 3 nodes, and 3 tokens are required:
    • vault-unseal on node-1 gets tokens A and B.
    • vault-unseal on node-2 gets tokens B and C.
    • vault-unseal on node-3 gets tokens A and C.

With the above configuration:

  • Given each vault-unseal node, each node has two tokens.
  • Given the tokens provided to vault-unseal, each token (A, B, and C), there are two instances of that token across nodes in the cluster.
  • If node-1 is completely hard-offline, nodes node-2 and node-3 should have all three tokens, so if the other two nodes reboot, as long as vault-unseal starts up on those nodes, vault-unseal will be able to unseal both.
  • If node-2 becomes compromised, and the tokens are read from the config file (note: vault-unseal will not start if the permissions on the file aren't 600), this will not be enough tokens to unseal the vault.
  • vault-unseal runs as root, with root permissions.

💻 Installation

Check out the releases page for prebuilt versions.

🐳 Container Images (ghcr)

$ docker run -it --rm ghcr.io/lrstanley/vault-unseal:master
$ docker run -it --rm ghcr.io/lrstanley/vault-unseal:0.2.1
$ docker run -it --rm ghcr.io/lrstanley/vault-unseal:latest
$ docker run -it --rm ghcr.io/lrstanley/vault-unseal:0.2.0

🧰 Source

Note that you must have Go installed (latest is usually best).

$ git clone https://github.com/lrstanley/vault-unseal.git && cd vault-unseal
$ make
$ ./vault-unseal --help

⚙️ Usage

The default configuration path is /etc/vault-unseal.yaml when using deb/rpm. If you are not using these package formats, copy the example config file, example.vault-unseal.yaml, to vault-unseal.yaml. Note, all fields can be provided via environment variables (vault-unseal also supports .env files).

$ ./vault-unseal --help
Usage:
  vault-unseal [OPTIONS]

Application Options:
  -v, --version          Display the version of vault-unseal and exit
  -l, --log-path=PATH    Optional path to log output to
  -c, --config=PATH      Path to configuration file (default: ./vault-unseal.yaml)

Help Options:
  -h, --help             Show this help message

☑️ TODO

  • add option to use vault token/another vault instance to obtain keys (e.g. as long the leader is online)?
  • memory obfuscating/removing from memory right after unseal?

🙋‍♂️ Support & Assistance

  • ❤️ Please review the Code of Conduct for guidelines on ensuring everyone has the best experience interacting with the community.
  • 🙋‍♂️ Take a look at the support document on guidelines for tips on how to ask the right questions.
  • 🐞 For all features/bugs/issues/questions/etc, head over here.

🤝 Contributing

  • ❤️ Please review the Code of Conduct for guidelines on ensuring everyone has the best experience interacting with the community.
  • 📋 Please review the contributing doc for submitting issues/a guide on submitting pull requests and helping out.
  • 🗝️ For anything security related, please review this repositories security policy.

⚖️ License

MIT License

Copyright (c) 2018 Liam Stanley <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Also located here

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