• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.circleci/H07-Jul-2021-

.github/H07-Jul-2021-

cmd/vault-plugin-secrets-kv/H07-Jul-2021-

scripts/H07-Jul-2021-

vendor/H03-May-2022-

.gitignoreH A D07-Jul-2021515

LICENSEH A D07-Jul-202116.3 KiB

MakefileH A D07-Jul-20211.5 KiB

README.mdH A D07-Jul-20214 KiB

backend.goH A D07-Jul-202112.5 KiB

delete_version_after.goH A D07-Jul-20211.5 KiB

delete_version_after_test.goH A D07-Jul-20216.8 KiB

go.modH A D07-Jul-2021547

go.sumH A D07-Jul-202116.5 KiB

passthrough.goH A D07-Jul-20217.9 KiB

passthrough_test.goH A D07-Jul-20216 KiB

path_config.goH A D07-Jul-20214.4 KiB

path_config_test.goH A D07-Jul-20213.7 KiB

path_data.goH A D07-Jul-202112.8 KiB

path_data_test.goH A D07-Jul-20218.1 KiB

path_delete.goH A D07-Jul-20215.1 KiB

path_delete_test.goH A D07-Jul-20214.7 KiB

path_destroy.goH A D07-Jul-20212.4 KiB

path_destroy_test.goH A D07-Jul-20212.1 KiB

path_metadata.goH A D07-Jul-20217.1 KiB

path_metadata_test.goH A D07-Jul-20217.3 KiB

types.pb.goH A D07-Jul-202115.4 KiB

types.protoH A D07-Jul-20212.4 KiB

upgrade.goH A D07-Jul-20216.7 KiB

upgrade_test.goH A D07-Jul-20212.1 KiB

README.md

1# Vault Plugin: Key-Value Secrets Backend [![Build Status](https://travis-ci.org/hashicorp/vault-plugin-secrets-kv.svg?branch=master)](https://travis-ci.org/hashicorp/vault-plugin-secrets-kv)
2
3This is a standalone backend plugin for use with [Hashicorp Vault](https://www.github.com/hashicorp/vault).
4This plugin provides Key-Value functionality to Vault.
5
6**Please note**: We take Vault's security and our users' trust very seriously. If you believe you have found a security issue in Vault, _please responsibly disclose_ by contacting us at [security@hashicorp.com](mailto:security@hashicorp.com).
7
8## Quick Links
9    - Vault Website: https://www.vaultproject.io
10    - KV Docs: https://www.vaultproject.io/docs/secrets/kv/index.html
11    - Main Project Github: https://www.github.com/hashicorp/vault
12
13## Getting Started
14
15This is a [Vault plugin](https://www.vaultproject.io/docs/internals/plugins.html)
16and is meant to work with Vault. This guide assumes you have already installed Vault
17and have a basic understanding of how Vault works.
18
19Otherwise, first read this guide on how to [get started with Vault](https://www.vaultproject.io/intro/getting-started/install.html).
20
21To learn specifically about how plugins work, see documentation on [Vault plugins](https://www.vaultproject.io/docs/internals/plugins.html).
22
23## Usage
24
25Please see [documentation for the plugin](https://www.vaultproject.io/docs/secrets/kv/index.html)
26on the Vault website.
27
28This plugin is currently built into Vault and by default is accessed
29at `kv`. To enable this in a running Vault server:
30
31```sh
32$ vault secrets enable kv
33Success! Enabled the kv secrets engine at: kv/
34```
35
36Additionally starting with Vault 0.10 this backend is by default mounted
37at `secret/`.
38
39## Developing
40
41If you wish to work on this plugin, you'll first need
42[Go](https://www.golang.org) installed on your machine
43(version 1.10+ is *required*).
44
45For local dev first make sure Go is properly installed, including
46setting up a [GOPATH](https://golang.org/doc/code.html#GOPATH).
47Next, clone this repository into
48`$GOPATH/src/github.com/hashicorp/vault-plugin-secrets-kv`.
49You can then download any required build tools by bootstrapping your
50environment:
51
52```sh
53$ make bootstrap
54```
55
56To compile a development version of this plugin, run `make` or `make dev`.
57This will put the plugin binary in the `bin` and `$GOPATH/bin` folders. `dev`
58mode will only generate the binary for your platform and is faster:
59
60```sh
61$ make
62$ make dev
63```
64
65Put the plugin binary into a location of your choice. This directory
66will be specified as the [`plugin_directory`](https://www.vaultproject.io/docs/configuration/index.html#plugin_directory)
67in the Vault config used to start the server.
68
69```json
70...
71plugin_directory = "path/to/plugin/directory"
72...
73```
74
75Start a Vault server with this config file:
76```sh
77$ vault server -config=path/to/config.json ...
78...
79```
80
81Once the server is started, register the plugin in the Vault server's [plugin catalog](https://www.vaultproject.io/docs/internals/plugins.html#plugin-catalog):
82
83```sh
84$ vault write sys/plugins/catalog/kv \
85        sha_256=<expected SHA256 Hex value of the plugin binary> \
86        command="vault-plugin-secrets-kv"
87...
88Success! Data written to: sys/plugins/catalog/kv
89```
90
91Note you should generate a new sha256 checksum if you have made changes
92to the plugin. Example using openssl:
93
94```sh
95openssl dgst -sha256 $GOPATH/vault-plugin-secrets-kv
96...
97SHA256(.../go/bin/vault-plugin-secrets-kv)= 896c13c0f5305daed381952a128322e02bc28a57d0c862a78cbc2ea66e8c6fa1
98```
99
100Enable the auth plugin backend using the secrets enable plugin command:
101
102```sh
103$ vault secrets enable -plugin-name='kv' plugin
104...
105
106Successfully enabled 'plugin' at 'kv'!
107```
108
109#### Tests
110
111If you are developing this plugin and want to verify it is still
112functioning (and you haven't broken anything else), we recommend
113running the tests.
114
115To run the tests, invoke `make test`:
116
117```sh
118$ make test
119```
120
121You can also specify a `TESTARGS` variable to filter tests like so:
122
123```sh
124$ make test TESTARGS='--run=TestConfig'
125```
126