vault-init is a small utility for automating the initialization and unsealing of HashiCorp Vault.

ci-badge release-badge

vault-init

vault-init is a small utility for automating the initialization and unsealing of HashiCorp Vault. It draws inspiration from kelseyhightower/vault-init, but doesn't rely on any public cloud infrastructure for the encrypting and storing of Vault's root tokens and unseal keys.

You would typically use this if you do not have access to public cloud infrastructure, or if your Vault deployment must operate entirely on-prem. For most production deployments, you would want to use Vault's native auto-unsealing capabilities if possible.

Overview

vault-init is written in Go and packaged as a binary that exposes a command-line interface. Its core is the start command that launches a daemon process designed to be run alongside a Vault server and communicate with it over localhost. It will continuously poll the status of the Vault server and depending on its state, automatically initialize and/or unseal it.

After vault-init initializes a Vault server, it encrypts the initial root token and unseal keys before storing them for future use in unsealing operations; this runs on the idea of pluggable backends for both encryption and storage that you can mix-and-match, configurable through the CLI.

For the full list of encryption and storage backends currently supported, see docs/encryption.md and docs/storage.md respectively.

Installation

Binary

Pre-compiled vault-init binaries for various platforms can be found under the Releases section of this repository.

Source

Clone this repository and build the binary from source using the given Makefile (requires go 1.15+):

$ make

This will compile and place the vault-init binary into a local dist directory.

Docker

A Docker image for vault-init is available on Docker Hub and can be pulled via:

$ docker pull docker.io/jaceys/vault-init:latest

Usage

To use the vault-init CLI:

$ vault-init [<flags>] <command> [<args> ...]

Configuration

To view all configuration options of each command, use the --help flag:

$ vault-init --help

Configuration options can also be passed in as environment variables, using the uppercased snake-case version of the respective flag name (eg. VAULT_ADDR for --vault-addr).

Most commands require you to specify the encryption and storage backend to use via the --encryption and --storage flag, respectively. Each backend has its own set of configuration options, with their names typically following the given pattern:

--[backend-name]-[encryption|storage]-[flag-name]

You will need to specify the appropriate flags depending on the backends you have chosen. Full documentation on configuration options for each backend can be found in docs/encryption.md and docs/storage.md.

Examples

Examples on using vault-init can be found in docs/examples.md.

Contributing

All contributions are welcome, so if you don't see an encryption/storage backend that you would like to use, simply open an issue or pull request to propose it. Have a look at the code in pkg/encryption and pkg/storage for ideas on how to contribute.

License

See LICENSE.

Owner
Jace Tan
Software engineer with a passion for developer tooling, automation, distributed systems, and scalable infrastructure.
Jace Tan
Similar Resources

Git-utils - Utility to automate git workflows

Git-Utilities Utility to automate git workflows. Commands userstory get/set/upda

Jan 2, 2022

Serverless SOAR (Security Orchestration, Automation and Response) framework for automatic inspection and evaluation of security alert

Serverless SOAR (Security Orchestration, Automation and Response) framework for automatic inspection and evaluation of security alert

DeepAlert DeepAlert is a serverless framework for automatic response of security alert. Overview DeepAlert receives a security alert that is event of

Jan 3, 2023

Use AWS SQS as a clipboard to copy and paste across different systems and platforms

sqs_clipboard Use AWS SQS as a clipboard to copy and paste across different systems and platforms. Clipboard contents are encrypted in transit and at

Oct 16, 2022

A API scanner written in GOLANG to scan files recursively and look for API keys and IDs.

GO FIND APIS _____ ____ ______ _____ _ _ _____ _____ _____ _____ / ____|/ __ \ | ____|_ _| \ | | __ \ /\ | __ \_

Oct 25, 2021

planet is a blockchain built using Cosmos SDK and Tendermint and created with Starport.

planet planet is a blockchain built using Cosmos SDK and Tendermint and created with Starport. Get started starport chain serve serve command install

Oct 31, 2021

Todo-list - In this project using golang and mySql to create todo-list to Add and remove

Todo-list - In this project using golang and mySql to create todo-list to Add and remove

TODO-Fullstack-App-Go-Gin-Postgres-React This fullstack application creates a TODO List Web Page using the Go/Gin/Postgres/React Stack. Starting the a

Apr 7, 2022

Rest API to get KVB departures - Written in Go with hexagonal architecture and tracing via OpenTelemetry and Jaeger

KVB API Rest API to get upcoming departures per KVB train station Implemented in Go with hexagonal architecture and tracing via OpenTelemetry and Jaeg

May 7, 2022

Pokemon Unite scoreboard HUD and extra tools running over captured game feeds using the OpenCV video processing API and Client/Server architecture.

Pokemon Unite scoreboard HUD and extra tools running over captured game feeds using the OpenCV video processing API and Client/Server architecture.

unite Pokemon Unite scoreboard HUD and extra tools running over captured game feeds using the OpenCV video processing API. Client (OBS Live) Server Ar

Dec 5, 2022

The wazuh-integratord is a daemon that allows Wazuh to connect to external APIs and alerting tools such as Slack, VirusTotal and PagerDuty.

The wazuh-integratord is a daemon that allows Wazuh to connect to external APIs and alerting tools such as Slack, VirusTotal and PagerDuty.

Apr 22, 2022
Comments
  • v0.1.0 errors out failed to initialize local encryption backend: no secret key provided

    v0.1.0 errors out failed to initialize local encryption backend: no secret key provided

    Tried using the kubernetes example with v0.1.0 i get failed to initialize local encryption backend: no secret key provided v0.2.0 works fine. Will create a small pr on the doc section

OpenAPI specification and related artifacts for HashiCorp Nomad

Overview This repository contains the HashiCorp Nomad OpenAPI specification and related artifacts. The OpenAPI specification defines a machine-readabl

Dec 14, 2022
A simple Go utility to display track information from, and send commands to, spotifyd from Tiling Window Managers like Sway and i3
A simple Go utility to display track information from, and send commands to, spotifyd from Tiling Window Managers like Sway and i3

Untitled Spotifyd Controller A simple Go utility to display track information from, and send commands to, spotifyd from Tiling Window Managers like Sw

Mar 8, 2022
AWS credential_process utility to assume AWS IAM Roles with Yubikey Touch and Authenticator App TOPT MFA to provide temporary session credentials; With encrypted caching and support for automatic credential refresh.
AWS credential_process utility to assume AWS IAM Roles with Yubikey Touch and Authenticator App TOPT MFA to provide temporary session credentials; With encrypted caching and support for automatic credential refresh.

AWS credential_process utility to assume AWS IAM Roles with Yubikey Touch and Authenticator App TOPT MFA to provide temporary session credentials; With encrypted caching and support for automatic credential refresh.

Dec 20, 2022
A small, fast, reliable pastemyst API wrapper written in Golang

A small, fast, reliable pastemyst API wrapper written in Golang. Official pastemyst API docs found here.

Dec 12, 2022
A small command line tool for testing grok patterns on file contents.

grogg A small command line tool for testing grok patterns on file contents. It uses the vjeantet/grok library for parsing and pterm for some extra glo

Feb 5, 2022
This is a small Go program, which can tell you what processes are actively using a set of files

winuse This is a small Go program, which can tell you what processes are actively using a set of files. It primarily exists to show off how one can bi

Jan 28, 2022
With this small library you can interact with the timev2 API

Library for timev2 With this small library you can interact with the timev2 API.

Jan 28, 2022
📟 Tiny utility Go client for HackerNews API.

go-hacknews Tiny utility Go client for HackerNews API. Official Hackernews API Install go get github.com/PaulRosset/go-hacknews Usage Few examples a

Sep 27, 2022
A Go utility to quickly authenticate a third party application with a Plex account.

Plex Authentication (in Go!) Installation As a Go library: go get github.com/BrenekH/go-plexauth As a CLI: go install github.com/BrenekH/go-plexauth/c

Jan 7, 2022
Fedora-new-install - Utility scripts for a clean fedora installation

fedora-new-install Utility scripts for a clean fedora installation new-install.g

Nov 8, 2022