2015-04-17 19:01:20 +00:00
---
layout: "docs"
page_title: "Server Configuration"
sidebar_current: "docs-config"
description: |-
Vault server configuration reference.
---
# Server Configuration
Outside of development mode, Vault servers are configured using a file.
The format of this file is [HCL ](https://github.com/hashicorp/hcl ) or JSON.
An example configuration is shown below:
2015-04-22 23:47:11 +00:00
```javascript
2015-04-17 19:01:20 +00:00
backend "consul" {
2015-05-28 12:11:34 +00:00
address = "127.0.0.1:8500"
2015-04-22 23:47:11 +00:00
path = "vault"
2015-04-17 19:01:20 +00:00
}
listener "tcp" {
2015-04-22 23:47:11 +00:00
address = "127.0.0.1:8200"
tls_disable = 1
2015-04-17 19:01:20 +00:00
}
2015-07-14 22:44:48 +00:00
telemetry {
statsite_address = "127.0.0.1:8125"
disable_hostname = true
}
2015-04-17 19:01:20 +00:00
```
After the configuration is written, use the `-config` flag with `vault server`
to specify where the configuration is.
2016-03-14 18:05:47 +00:00
Starting with 0.5.2, limited configuration options can be changed on-the-fly by
sending a SIGHUP to the server process. These are denoted below.
2015-04-17 19:01:20 +00:00
## Reference
2015-05-27 20:44:17 +00:00
* `backend` (required) - Configures the storage backend where Vault data
is stored. There are multiple options available for storage backends,
2015-04-17 19:01:20 +00:00
and they're documented below.
2015-12-15 02:04:58 +00:00
* `ha_backend` (optional) - Configures the storage backend where Vault HA
coordination will take place. Must be an HA-supporting backend using the
configuration options as documented below. If not set, HA will be attempted
on the backend given in the `backend` parameter.
2016-10-03 18:45:31 +00:00
* `cluster_name` (optional) - An identifier for your Vault cluster. If omitted,
Vault will generate a value for `cluster_name` . If connecting to Vault
Enterprise, this value will be used in the interface.
2015-04-17 19:01:20 +00:00
* `listener` (required) - Configures how Vault is listening for API requests.
2016-10-03 15:22:45 +00:00
"tcp" and "atlas" are valid values. A full reference for the
2015-04-17 19:01:20 +00:00
inner syntax is below.
2016-08-26 14:27:06 +00:00
* `cache_size` (optional) - If set, the size of the read cache used
2016-11-01 14:24:35 +00:00
by the physical storage subsystem will be set to this value. The
value is in number of entries so the total cache size is dependent
on the entries being stored. Defaults to 32k entries.
2016-08-26 14:27:06 +00:00
2016-04-21 13:52:42 +00:00
* `disable_cache` (optional) - A boolean. If true, this will disable all caches
within Vault, including the read cache used by the physical storage
subsystem. This will very significantly impact performance.
2015-10-12 16:55:02 +00:00
2015-04-28 22:13:07 +00:00
* `disable_mlock` (optional) - A boolean. If true, this will disable the
server from executing the `mlock` syscall to prevent memory from being
2015-05-28 10:40:56 +00:00
swapped to disk. This is not recommended in production (see below).
2015-04-28 22:13:07 +00:00
2015-07-14 22:44:48 +00:00
* `telemetry` (optional) - Configures the telemetry reporting system
(see below).
2015-04-17 19:01:20 +00:00
2015-09-24 16:17:26 +00:00
* `default_lease_ttl` (optional) - Configures the default lease duration
2016-09-28 22:32:49 +00:00
for tokens and secrets. This is a string value using a suffix, e.g. "768h".
Default value is 32 days. This value cannot be larger than `max_lease_ttl` .
2015-07-30 13:42:49 +00:00
2015-09-24 16:17:26 +00:00
* `max_lease_ttl` (optional) - Configures the maximum possible
2016-02-01 14:44:42 +00:00
lease duration for tokens and secrets. This is a string value using a suffix,
2016-09-28 22:32:49 +00:00
e.g. "768h". Default value is 32 days.
2015-07-30 13:42:49 +00:00
2016-12-06 22:13:12 +00:00
* `ui` (optional, Vault Enterprise only) - If set `true` , enables the built-in
web-based UI. Once enabled, the UI will be available to browsers at the
standard Vault address.
2016-04-06 05:18:44 +00:00
In production it is a risk to run Vault on systems where `mlock` is
unavailable or the setting has been disabled via the `disable_mlock` .
Disabling `mlock` is not recommended unless the systems running Vault only
use encrypted swap or do not use swap at all. Vault only supports memory
locking on UNIX-like systems (Linux, FreeBSD, Darwin, etc). Non-UNIX like
systems (e.g. Windows, NaCL, Android) lack the primitives to keep a process's
2016-07-06 05:57:22 +00:00
entire memory address space from spilling to disk and is therefore automatically
2016-04-06 05:18:44 +00:00
disabled on unsupported platforms.
On Linux, to give the Vault executable the ability to use the `mlock` syscall
without running the process as root, run:
2015-05-28 10:40:56 +00:00
```shell
sudo setcap cap_ipc_lock=+ep $(readlink -f $(which vault))
```
2015-12-22 15:50:31 +00:00
## Listener Reference
2016-10-03 15:22:45 +00:00
For the `listener` section, the only required listener is "tcp".
Regardless of future plans, this is the recommended listener,
as it allows for HA mode. If you wish to use the Vault
2016-10-03 18:45:31 +00:00
Enterprise interface in HashiCorp Atlas, you may add an ["atlas" listener block ](#connecting-to-vault-enterprise-in-hashicorp-atlas )
2016-10-03 15:22:45 +00:00
in addition to the "tcp" one.
2015-12-22 15:50:31 +00:00
The supported options are:
* `address` (optional) - The address to bind to for listening. This
defaults to "127.0.0.1:8200".
2016-08-15 13:42:42 +00:00
* `cluster_address` (optional) - The address to bind to for cluster
server-to-server requests. This defaults to one port higher than the
value of `address` , so with the default value of `address` , this would be
"127.0.0.1:8201".
2015-12-29 17:56:19 +00:00
* `tls_disable` (optional) - If true, then TLS will be disabled.
This will parse as boolean value, and can be set to "0", "no",
"false", "1", "yes", or "true". This is an opt-in; Vault assumes
by default that TLS will be used.
2015-12-22 15:50:31 +00:00
* `tls_cert_file` (required unless disabled) - The path to the certificate
2016-05-12 22:34:47 +00:00
for TLS. To configure the listener to use a CA certificate, concatenate
the primary certificate and the CA certificate together. The primary
certificate should appear first in the combined file. This is reloaded
via SIGHUP.
2015-12-22 15:50:31 +00:00
* `tls_key_file` (required unless disabled) - The path to the private key
2016-03-14 18:05:47 +00:00
for the certificate. This is reloaded via SIGHUP.
2015-12-22 15:50:31 +00:00
* `tls_min_version` (optional) - ** (Vault > 0.2)** If provided, specifies
the minimum supported version of TLS. Accepted values are "tls10", "tls11"
or "tls12". This defaults to "tls12". WARNING: TLS 1.1 and lower
are generally considered less secure; avoid using these if
possible.
2016-10-03 15:22:45 +00:00
### Connecting to Vault Enterprise in HashiCorp Atlas
Adding an "atlas" block will initiate a long-running connection to the
[SCADA ](https://scada.hashicorp.com ) service. The SCADA connection allows the
Vault Enterprise interface to securely communicate with and operate on your
Vault cluster.
The "atlas" `listener` supports these options:
* `endpoint` (optional) - The endpoint address used for Vault Enterprise interface
integration. Defaults to the public Vault Enterprise endpoints on Atlas.
* `infrastructure` (required) - Used to provide the Atlas infrastructure name and
the SCADA connection. The format of this is `username/environment` .
* `node_id` (required) - The identifier for an individual node—used in
the Vault Enterprise dashboard.
* `token` (required) - A token from Atlas used to authenticate SCADA session. Generate
one in the [Atlas ](https://atlas.hashicorp.com/settings/tokens ).
2016-10-03 18:45:31 +00:00
Additionally, the [`cluster_name` ](#cluster_name ) config option will be used to
identify your cluster members inside the infrastructure in the Vault Enterprise
interface. It is important for operators to use the same value for
`cluster_name` across cluster members because Vault overwrites this value
internally on instance instantiation.
This allows the connection of multiple clusters to a single `infrastructure` .
2016-10-03 15:22:45 +00:00
For more on Vault Enterprise, see the [help documentation ](https://atlas.hashicorptest.com/help/vault/features ).
2015-12-22 15:50:31 +00:00
## Telemetry Reference
For the `telemetry` section, there is no resource name. All configuration
is within the object itself.
* `statsite_address` (optional) - An address to a [Statsite ](https://github.com/armon/statsite )
2016-08-22 16:17:48 +00:00
instance for metrics. This is highly recommended for production usage.
2015-12-22 15:50:31 +00:00
* `statsd_address` (optional) - This is the same as `statsite_address` but
for StatsD.
* `disable_hostname` (optional) - Whether or not to prepend runtime telemetry
with the machines hostname. This is a global option. Defaults to false.
2016-07-22 19:49:23 +00:00
* `circonus_api_token`
A valid [Circonus ](http://circonus.com/ ) API Token used to create/manage check. If provided, metric management is enabled.
* `circonus_api_app`
A valid app name associated with the API token. By default, this is set to "consul".
* `circonus_api_url`
The base URL to use for contacting the Circonus API. By default, this is set to "https://api.circonus.com/v2".
* `circonus_submission_interval`
The interval at which metrics are submitted to Circonus. By default, this is set to "10s" (ten seconds).
* `circonus_submission_url`
The `check.config.submission_url` field, of a Check API object, from a previously created HTTPTRAP check.
* `circonus_check_id`
The Check ID (not **check bundle** ) from a previously created HTTPTRAP check. The numeric portion of the `check._cid` field in the Check API object.
* `circonus_check_force_metric_activation`
Force activation of metrics which already exist and are not currently active. If check management is enabled, the default behavior is to add new metrics as they are encountered. If the metric already exists in the check, it will **not** be activated. This setting overrides that behavior. By default, this is set to "false".
* `circonus_check_instance_id`
2016-11-10 21:17:55 +00:00
Serves to uniquely identify the metrics coming from this *instance* . It can be used to maintain metric continuity with transient or ephemeral instances as they move around within an infrastructure. By default, this is set to hostname:application name (e.g. "host123:vault").
2016-07-22 19:49:23 +00:00
* `circonus_check_search_tag`
2016-11-10 21:17:55 +00:00
A special tag which, when coupled with the instance id, helps to narrow down the search results when neither a Submission URL or Check ID is provided. By default, this is set to service:app (e.g. "service:vault").
* `circonus_check_display_name`
Specifies a name to give a check when it is created. This name is displayed in the Circonus UI Checks list.
* `circonus_check_tags`
Comma separated list of additional tags to add to a check when it is created.
2016-07-22 19:49:23 +00:00
* `circonus_broker_id`
The ID of a specific Circonus Broker to use when creating a new check. The numeric portion of `broker._cid` field in a Broker API object. If metric management is enabled and neither a Submission URL nor Check ID is provided, an attempt will be made to search for an existing check using Instance ID and Search Tag. If one is not found, a new HTTPTRAP check will be created. By default, this is not used and a random Enterprise Broker is selected, or, the default Circonus Public Broker.
* `circonus_broker_select_tag`
A special tag which will be used to select a Circonus Broker when a Broker ID is not provided. The best use of this is to as a hint for which broker should be used based on *where* this particular instance is running (e.g. a specific geo location or datacenter, dc:sfo). By default, this is not used.
2015-04-17 19:01:20 +00:00
## Backend Reference
2015-12-22 15:50:31 +00:00
For the `backend` section, the supported physical backends are shown below.
2015-04-17 19:01:20 +00:00
Vault requires that the backend itself will be responsible for backups,
durability, etc.
2015-12-22 15:50:31 +00:00
__*Please note*__: The only physical backends actively maintained by HashiCorp
are `consul` , `inmem` , and `file` . The other backends are community-derived and
community-supported. We include them in the hope that they will be useful to
those users that wish to utilize them, but they receive minimal validation and
testing from HashiCorp, and HashiCorp staff may not be knowledgeable about the
data store being utilized. If you encounter problems with them, we will attempt
2016-01-14 18:42:47 +00:00
to help you, but may refer you to the backend author.
2015-12-22 15:50:31 +00:00
2016-01-14 18:42:47 +00:00
* `consul` - Store data within [Consul ](https://www.consul.io ). This
2015-12-22 15:50:31 +00:00
backend supports HA. It is the most recommended backend for Vault and has
been shown to work at high scale under heavy load.
2015-04-17 19:01:20 +00:00
2015-05-24 16:38:49 +00:00
* `etcd` - Store data within [etcd ](https://coreos.com/etcd/ ).
2015-12-22 15:50:31 +00:00
This backend supports HA. This is a community-supported backend.
2015-07-13 09:01:32 +00:00
* `zookeeper` - Store data within [Zookeeper ](https://zookeeper.apache.org/ ).
2015-12-22 15:50:31 +00:00
This backend supports HA. This is a community-supported backend.
2015-05-24 16:38:49 +00:00
2016-01-08 16:30:39 +00:00
* `dynamodb` - Store data in a [DynamoDB ](https://aws.amazon.com/dynamodb/ ) table.
2016-07-18 17:19:58 +00:00
This backend optionally supports HA. This is a community-supported backend.
2016-01-08 16:30:39 +00:00
2016-01-14 18:55:53 +00:00
* `s3` - Store data within an S3 bucket [S3 ](https://aws.amazon.com/s3/ ).
This backend does not support HA. This is a community-supported backend.
2016-12-01 19:42:31 +00:00
* `gcs` - Store data within a [Google Cloud Storage ](https://cloud.google.com/storage/ ) bucket.
This backend does not support HA. This is a community-supported backend.
2016-02-24 12:14:23 +00:00
* `azure` - Store data in an Azure Storage container [Azure ](https://azure.microsoft.com/en-us/services/storage/ ).
This backend does not support HA. This is a community-supported backend.
2016-05-16 22:29:40 +00:00
* `swift` - Store data within an OpenStack Swift container [Swift ](http://docs.openstack.org/developer/swift/ ).
This backend does not support HA. This is a community-supported backend.
2015-12-22 15:50:31 +00:00
* `mysql` - Store data within MySQL. This backend does not support HA. This
is a community-supported backend.
2015-06-18 21:31:00 +00:00
2016-02-03 19:04:55 +00:00
* `postgresql` - Store data within PostgreSQL. This backend does not support HA. This
is a community-supported backend.
2015-04-17 19:01:20 +00:00
* `inmem` - Store data in-memory. This is only really useful for
2015-12-22 15:50:31 +00:00
development and experimentation. Data is lost whenever Vault is
restarted.
2015-04-17 19:01:20 +00:00
* `file` - Store data on the filesystem using a directory structure.
2015-12-22 15:50:31 +00:00
This backend does not support HA.
2015-04-17 19:01:20 +00:00
2016-08-15 13:42:42 +00:00
#### High Availability Options
All HA backends support the following options. These are discussed in much more
detail in the [High Availability concepts
page](https://www.vaultproject.io/docs/concepts/ha.html).
2017-01-06 20:07:01 +00:00
* `redirect_addr` (required) - This is the address to advertise to other
2016-08-15 13:42:42 +00:00
Vault servers in the cluster for client redirection. This can also be
set via the `VAULT_REDIRECT_ADDR` environment variable, which takes
2017-01-06 20:07:01 +00:00
precedence. Some HA backends may be able to autodetect this value, but if
not it is required to be manually specified.
2015-04-17 19:01:20 +00:00
2016-08-15 13:42:42 +00:00
* `cluster_addr` (optional) - This is the address to advertise to other Vault
servers in the cluster for request forwarding. This can also be set via the
`VAULT_CLUSTER_ADDR` environment variable, which takes precedence.
2015-04-17 19:01:20 +00:00
2016-08-15 13:42:42 +00:00
* `disable_clustering` (optional) - This controls whether clustering features
(currently, request forwarding) are enabled. Setting this on a node will
2016-10-02 18:54:01 +00:00
disable these features _when that node is the active node_ .
2015-04-17 19:01:20 +00:00
#### Backend Reference: Consul
For Consul, the following options are supported:
* `path` (optional) - The path within Consul where data will be stored.
2016-02-19 20:27:02 +00:00
Defaults to "vault/".
2015-04-17 19:01:20 +00:00
* `address` (optional) - The address of the Consul agent to talk to.
2016-02-19 20:27:02 +00:00
Defaults to the local agent address, if available.
2015-04-17 19:01:20 +00:00
* `scheme` (optional) - "http" or "https" for talking to Consul.
2016-04-24 02:56:28 +00:00
* `check_timeout` (optional) - The check interval used to send health check
information to Consul. Defaults to "5s".
2016-04-24 02:53:21 +00:00
* `disable_registration` (optional) - If true, then Vault will not register
2016-05-24 22:22:20 +00:00
itself with Consul. Defaults to "false".
2016-04-24 02:53:21 +00:00
2016-04-24 02:56:28 +00:00
* `service` (optional) - The name of the service to register with Consul.
Defaults to "vault".
2016-08-15 13:42:42 +00:00
* `service_tags` (optional) - Comma separated list of tags that are to be
2016-07-22 08:37:46 +00:00
applied to the service that gets registered with Consul.
2015-04-17 19:01:20 +00:00
* `token` (optional) - An access token to use to write data to Consul.
2016-08-15 23:45:06 +00:00
* `max_parallel` (optional) - The maximum number of concurrent requests to Consul.
Defaults to `"128"` .
2015-11-03 20:26:07 +00:00
2015-07-28 12:50:43 +00:00
* `tls_skip_verify` (optional) - If non-empty, then TLS host verification
2016-02-19 20:27:02 +00:00
will be disabled for Consul communication. Defaults to false.
2015-07-28 12:50:43 +00:00
2016-07-12 23:56:35 +00:00
* `tls_min_version` (optional) - Minimum TLS version to use. Accepted values
are 'tls10', 'tls11' or 'tls12'. Defaults to 'tls12'.
2016-02-19 20:27:02 +00:00
The following settings should be set according to your [Consul encryption
settings](https://www.consul.io/docs/agent/encryption.html):
2015-07-28 12:50:43 +00:00
2016-02-19 20:27:02 +00:00
* `tls_ca_file` (optional) - The path to the CA certificate used for Consul
communication. Defaults to system bundle if not specified. Set
accordingly to the
[ca_file ](https://www.consul.io/docs/agent/options.html#ca_file ) setting in
Consul.
2015-07-28 09:00:42 +00:00
2016-02-19 20:27:02 +00:00
* `tls_cert_file` (optional) - The path to the certificate for Consul
communication. Set accordingly to the
[cert_file ](https://www.consul.io/docs/agent/options.html#cert_file )
setting in Consul.
2015-07-28 09:00:42 +00:00
2016-02-19 20:27:02 +00:00
* `tls_key_file` (optional) - The path to the private key for Consul
communication. Set accordingly to the
[key_file ](https://www.consul.io/docs/agent/options.html#key_file ) setting
in Consul.
2015-07-28 09:00:42 +00:00
2016-04-24 02:56:28 +00:00
```
// Sample Consul Backend configuration with local Consul Agent
backend "consul" {
// address MUST match Consul's `addresses.http` config value (or
// `addresses.https` depending on the scheme provided below).
address = "127.0.0.1:8500"
#address = "unix:///tmp/.consul.http.sock"
// scheme defaults to "http" (suitable for loopback and UNIX sockets), but
// should be "https" when Consul exists on a remote node (a non-standard
// deployment). All decryption happen within Vault so this value does not
// change Vault's Threat Model.
scheme = "http"
// token is a Consul ACL Token that has write privileges to the path
// specified below. Use of a Consul ACL Token is a best pracitce.
token = "[redacted]" // Vault's Consul ACL Token
// path must be writable by the Consul ACL Token
path = "vault/"
}
```
Once properly configured, an unsealed Vault installation should be available
on the network at `active.vault.service.consul` . Unsealed Vault instances in
the standby state are available at `standby.vault.service.consul` . All
unsealed Vault instances are available as healthy in the
`vault.service.consul` pool. Sealed Vault instances will mark themselves as
critical to avoid showing up by default in Consul's service discovery.
```
% dig active.vault.service.consul srv
; < < >> DiG 9.8.3-P1 < < >> active.vault.service.consul srv
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER< < - opcode: QUERY , status: NOERROR , id: 11331
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;active.vault.service.consul. IN SRV
;; ANSWER SECTION:
active.vault.service.consul. 0 IN SRV 1 1 8200 vault1.node.dc1.consul.
;; ADDITIONAL SECTION:
vault1.node.dc1.consul. 0 IN A 172.17.33.46
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Apr 23 17:33:14 2016
;; MSG SIZE rcvd: 172
% dig +short standby.vault.service.consul srv
1 1 8200 vault3.node.dc1.consul.
1 1 8200 vault2.node.dc1.consul.
% dig +short vault.service.consul srv
1 1 8200 vault3.node.dc1.consul.
1 1 8200 vault1.node.dc1.consul.
1 1 8200 vault2.node.dc1.consul.
% dig +short vault.service.consul a
172.17.33.46
172.17.34.32
172.17.35.29
vault1% vault seal
% dig +short vault.service.consul srv
1 1 8200 vault3.node.dc1.consul.
1 1 8200 vault2.node.dc1.consul.
vault1% vault unseal
Key (will be hidden):
Sealed: false
Key Shares: 5
Key Threshold: 3
Unseal Progress: 0
% dig +short vault.service.consul srv
1 1 8200 vault1.node.dc1.consul.
1 1 8200 vault3.node.dc1.consul.
1 1 8200 vault2.node.dc1.consul.
```
2015-12-22 15:50:31 +00:00
#### Backend Reference: etcd (Community-Supported)
2015-05-24 16:38:49 +00:00
For etcd, the following options are supported:
* `path` (optional) - The path within etcd where data will be stored.
2016-02-19 20:27:02 +00:00
Defaults to "vault/".
2015-05-24 16:38:49 +00:00
* `address` (optional) - The address(es) of the etcd instance(s) to talk to.
2016-02-19 20:27:02 +00:00
Can be comma separated list (protocol://host:port) of many etcd instances.
2016-06-30 18:46:40 +00:00
Defaults to "http://localhost:2379" if not specified. May also be specified
via the ETCD_ADDR environment variable.
2015-05-24 16:38:49 +00:00
2016-01-11 18:56:58 +00:00
* `sync` (optional) - Should we synchronize the list of available etcd
2016-02-19 20:27:02 +00:00
servers on startup? This is a **string** value to allow for auto-sync to
be implemented later. It can be set to "0", "no", "n", "false", "1", "yes",
"y", or "true". Defaults to on. Set to false if your etcd cluster is
behind a proxy server and syncing causes Vault to fail.
2016-01-11 18:56:58 +00:00
2016-09-21 18:01:36 +00:00
* `ha_enabled` (optional) - Setting this to `"1"` , `"t"` , or `"true"` will
enable HA mode. _This is currently *known broken*._ This option can also be
provided via the environment variable `ETCD_HA_ENABLED` . If you are
upgrading from a version of Vault where HA support was enabled by default,
it is _very important_ that you set this parameter _before_ upgrading!
2016-01-11 16:30:51 +00:00
* `username` (optional) - Username to use when authenticating with the etcd
2016-02-19 20:27:02 +00:00
server. May also be specified via the ETCD_USERNAME environment variable.
2016-01-11 16:30:51 +00:00
* `password` (optional) - Password to use when authenticating with the etcd
2016-02-19 20:27:02 +00:00
server. May also be specified via the ETCD_PASSWORD environment variable.
2016-01-11 16:30:51 +00:00
2016-02-19 20:27:02 +00:00
* `tls_ca_file` (optional) - The path to the CA certificate used for etcd
communication. Defaults to system bundle if not specified.
2015-12-17 15:34:41 +00:00
2016-02-19 20:27:02 +00:00
* `tls_cert_file` (optional) - The path to the certificate for etcd
communication.
2015-12-17 15:34:41 +00:00
2016-02-19 20:27:02 +00:00
* `tls_key_file` (optional) - The path to the private key for etcd
communication.
2015-12-17 15:34:41 +00:00
2016-01-14 18:55:53 +00:00
#### Backend Reference: Zookeeper (Community-Supported)
2015-07-23 12:53:20 +00:00
2016-01-14 18:55:53 +00:00
For Zookeeper, the following options are supported:
2015-11-04 14:36:24 +00:00
2016-01-14 18:55:53 +00:00
* `path` (optional) - The path within Zookeeper where data will be stored.
2016-02-19 20:27:02 +00:00
Defaults to "vault/".
* `address` (optional) - The address(es) of the Zookeeper instance(s) to talk
to. Can be comma separated list (host:port) of many Zookeeper instances.
Defaults to "localhost:2181" if not specified.
The following optional settings can be used to configure zNode ACLs:
* `auth_info` (optional) - Authentication string in Zookeeper AddAuth format
(`schema:auth`). As an example, `digest:UserName:Password` could be used to
authenticate as user `UserName` using password `Password` with the `digest`
mechanism.
* `znode_owner` (optional) - If specified, Vault will always set all
permissions (CRWDA) to the ACL identified here via the Schema and User
parts of the Zookeeper ACL format. The expected format is
`schema:user-ACL-match` . Some examples:
* `digest:UserName:HIDfRvTv623G==` - Access for the user `UserName` with
the corresponding digest `HIDfRvTv623G==`
* `ip:127.0.0.1` - Access from localhost only
* `ip:70.95.0.0/16` - Any host on the 70.95.0.0 network (CIDRs are
supported starting from Zookeeper 3.5.0)
If neither of these is set, the backend will not authenticate with Zookeeper
and will set the OPEN_ACL_UNSAFE ACL on all nodes. In this scenario, anyone
connected to Zookeeper could change Vault’ s znodes and, potentially, take Vault
2016-02-24 12:14:23 +00:00
out of service.
2016-02-15 16:38:14 +00:00
Some sample configurations:
2016-02-19 20:27:02 +00:00
```
2016-02-15 16:20:32 +00:00
backend "zookeeper" {
znode_owner = "digest:vaultUser:raxgVAfnDRljZDAcJFxznkZsExs="
auth_info = "digest:vaultUser:abc"
}
2016-02-19 20:27:02 +00:00
```
The above configuration causes Vault to set an ACL on all of its zNodes
permitting access to vaultUser only. If the `digest` schema is used, please
protect this file as it contains the cleartext password. As per Zookeeper's ACL
model, the digest value (in znode_owner) must match the user (in znode_owner).
2016-02-15 16:20:32 +00:00
2016-02-19 20:27:02 +00:00
```
2016-02-15 16:38:14 +00:00
backend "zookeeper" {
znode_owner = "ip:127.0.0.1"
2016-02-19 20:27:02 +00:00
}
```
The above example allows access from localhost only - as this is the `ip` no
auth_info is required since Zookeeper uses the address of the client for the
ACL check.
2016-02-15 16:20:32 +00:00
2016-01-08 16:30:39 +00:00
#### Backend Reference: DynamoDB (Community-Supported)
2016-07-18 17:19:58 +00:00
The DynamoDB optionally supports HA. Because Dynamo does not support session
lifetimes on its locks, a Vault node that has failed, rather than shut down in
an orderly fashion, will require manual cleanup rather than failing over
automatically. See the documentation of `recovery_mode` to better understand
this process. To enable HA, set the `ha_enabled` option.
2016-01-08 16:30:39 +00:00
2016-07-18 17:19:58 +00:00
The DynamoDB backend has the following options:
2016-01-08 16:30:39 +00:00
2016-07-18 17:19:58 +00:00
* `table` (optional) - The name of the DynamoDB table to store data in. The
default table name is `vault-dynamodb-backend` . This option can also be
provided via the environment variable `AWS_DYNAMODB_TABLE` . If the
specified table does not yet exist, it will be created during
initialization.
* `read_capacity` (optional) - The read capacity to provision when creating
the DynamoDB table. This is the maximum number of reads consumed per second
on the table. The default value is 5. This option can also be provided via
the environment variable `AWS_DYNAMODB_READ_CAPACITY` .
* `write_capacity` (optional) - The write capacity to provision when creating
the DynamoDB table. This is the maximum number of writes performed per
second on the table. The default value is 5. This option can also be
provided via the environment variable `AWS_DYNAMODB_WRITE_CAPACITY` .
* `access_key` - (required) The AWS access key. It must be provided, but it
can also be sourced from the `AWS_ACCESS_KEY_ID` environment variable.
* `secret_key` - (required) The AWS secret key. It must be provided, but it
can also be sourced from the `AWS_SECRET_ACCESS_KEY` environment variable.
* `session_token` - (optional) The AWS session token. It can also be sourced
from the `AWS_SESSION_TOKEN` environment variable.
* `endpoint` - (optional) An alternative (AWS compatible) DynamoDB endpoint
to use. It can also be sourced from the `AWS_DYNAMODB_ENDPOINT` environment
variable.
* `region` (optional) - The AWS region. It can be sourced from the
`AWS_DEFAULT_REGION` environment variable and will default to `us-east-1`
if not specified.
2016-08-15 23:45:06 +00:00
* `max_parallel` (optional) - The maximum number of concurrent requests to
DynamoDB. Defaults to `"128"` .
2016-07-18 17:49:05 +00:00
* `ha_enabled` (optional) - Setting this to `"1"` , `"t"` , or `"true"` will
enable HA mode. Please ensure you have read the documentation for the
`recovery_mode` option before enabling this. This option can also be
2016-07-18 18:10:55 +00:00
provided via the environment variable `DYNAMODB_HA_ENABLED` . If you are
upgrading from a version of Vault where HA support was enabled by default,
it is _very important_ that you set this parameter _before_ upgrading!
2016-07-18 17:19:58 +00:00
* `recovery_mode` (optional) - When the Vault leader crashes or is killed
without being able to shut down properly, no other node can become the new
leader because the DynamoDB table still holds the old leader's lock record.
To recover from this situation, one can start a single Vault node with this
2016-07-18 17:49:05 +00:00
option set to `"1"` , `"t"` , or `"true"` and the node will remove the old
lock from DynamoDB. It is important that only one node is running in
recovery mode! After this node has become the leader, other nodes can be
started with regular configuration. This option can also be provided via
the environment variable `RECOVERY_MODE` .
2016-07-18 17:19:58 +00:00
For more information about the read/write capacity of DynamoDB tables, see the
[official AWS DynamoDB
docs](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput).
2016-01-08 16:30:39 +00:00
If you are running your Vault server on an EC2 instance, you can also make use
2016-07-18 17:19:58 +00:00
of the EC2 instance profile service to provide the credentials Vault will use
to make DynamoDB API calls. Leaving the `access_key` and `secret_key` fields
empty will cause Vault to attempt to retrieve credentials from the metadata
service.
2016-01-08 16:30:39 +00:00
2016-01-14 18:55:53 +00:00
#### Backend Reference: S3 (Community-Supported)
For S3, the following options are supported:
* `bucket` (required) - The name of the S3 bucket to use. It must be provided, but it can also be sourced from the `AWS_S3_BUCKET` environment variable.
* `access_key` - (required) The AWS access key. It must be provided, but it can also be sourced from the `AWS_ACCESS_KEY_ID` environment variable.
* `secret_key` - (required) The AWS secret key. It must be provided, but it can also be sourced from the `AWS_SECRET_ACCESS_KEY` environment variable.
* `session_token` - (optional) The AWS session token. It can also be sourced from the `AWS_SESSION_TOKEN` environment variable.
* `endpoint` - (optional) An alternative (AWS compatible) S3 endpoint to use. It can also be sourced from the `AWS_S3_ENDPOINT` environment variable.
2016-04-15 21:03:35 +00:00
* `region` (optional) - The AWS region. It can be sourced from the `AWS_DEFAULT_REGION` environment variable and will default to `us-east-1` if not specified.
2016-01-14 18:55:53 +00:00
If you are running your Vault server on an EC2 instance, you can also make use
of the EC2 instance profile service to provide the credentials Vault will use to
make S3 API calls. Leaving the `access_key` and `secret_key` fields empty
will cause Vault to attempt to retrieve credentials from the metadata service.
You are responsible for ensuring your instance is launched with the appropriate
profile enabled. Vault will handle renewing profile credentials as they rotate.
2016-12-01 19:42:31 +00:00
#### Backend Reference: Google Cloud Storage (Community-Supported)
For Google Cloud Storage, the following options are supported:
* `bucket` (required) - The name of the Google Cloud Storage bucket to use. It must be provided, but it can also be sourced from the `GOOGLE_STORAGE_BUCKET` environment variable.
* `credentials_file` - (required) The path to a GCP [service account ](https://cloud.google.com/compute/docs/access/service-accounts ) private key file in [JSON format ](https://cloud.google.com/storage/docs/authentication#generating-a-private-key ). It must be provided, but it can also be sourced from the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
* `max_parallel` (optional) - The maximum number of concurrent requests to Google Cloud Storage.
Defaults to `"128"` .
2016-02-24 12:14:23 +00:00
#### Backend Reference: Azure (Community-Supported)
* `accountName` (required) - The Azure Storage account name
2016-06-08 16:22:18 +00:00
2016-02-24 12:14:23 +00:00
* `accountKey` (required) - The Azure Storage account key
2016-06-08 16:22:18 +00:00
2016-02-24 12:14:23 +00:00
* `container` (required) - The Azure Storage Blob container name
2016-08-15 23:45:06 +00:00
* `max_parallel` (optional) - The maximum number of concurrent requests to Azure. Defaults to `"128"` .
2016-06-08 16:22:18 +00:00
2016-06-30 18:46:40 +00:00
The current implementation is limited to a maximum of 4 MBytes per blob/file.
2016-02-24 12:14:23 +00:00
2016-05-16 22:29:40 +00:00
#### Backend Reference: Swift (Community-Supported)
2016-11-08 11:44:34 +00:00
For Swift, the following options are valid; only v1.0 auth endpoints are supported:
2016-05-16 22:29:40 +00:00
* `container` (required) - The name of the Swift container to use. It must be provided, but it can also be sourced from the `OS_CONTAINER` environment variable.
* `username` - (required) The OpenStack account/username. It must be provided, but it can also be sourced from the `OS_USERNAME` environment variable.
* `password` - (required) The OpenStack password. It must be provided, but it can also be sourced from the `OS_PASSWORD` environment variable.
* `auth_url` - (required) Then OpenStack auth endpoint to use. It can also be sourced from the `OS_AUTH_URL` environment variable.
* `tenant` (optional) - The name of Tenant to use. It can be sourced from the `OS_TENANT_NAME` environment variable and will default to default tenant of for the username if not specified.
2016-08-15 23:45:06 +00:00
* `max_parallel` (optional) - The maximum number of concurrent requests to Swift. Defaults to `"128"` .
2016-06-08 16:20:21 +00:00
2015-12-22 15:50:31 +00:00
#### Backend Reference: MySQL (Community-Supported)
2015-06-18 21:31:00 +00:00
The MySQL backend has the following options:
* `username` (required) - The MySQL username to connect with.
* `password` (required) - The MySQL password to connect with.
* `address` (optional) - The address of the MySQL host. Defaults to
"127.0.0.1:3306.
* `database` (optional) - The name of the database to use. Defaults to "vault".
* `table` (optional) - The name of the table to use. Defaults to "vault".
2015-08-04 05:05:27 +00:00
* `tls_ca_file` (optional) - The path to the CA certificate to connect using TLS
2016-01-20 00:00:09 +00:00
#### Backend Reference: PostgreSQL (Community-Supported)
The PostgreSQL backend has the following options:
* `connection_url` (required) - The connection string used to connect to PostgreSQL.
Examples:
2016-05-12 21:22:41 +00:00
* postgres://username:password@localhost:5432/database?sslmode=disable
2016-01-20 00:00:09 +00:00
* postgres://username:password@localhost:5432/database?sslmode=verify-full
A list of all supported parameters can be found in [the pq library documentation ](https://godoc.org/github.com/lib/pq#hdr-Connection_String_Parameters ).
2016-01-21 01:52:49 +00:00
* `table` (optional) - The name of the table to write vault data to. Defaults
2016-01-28 00:15:48 +00:00
to "vault_kv_store".
2016-01-21 01:52:49 +00:00
2016-01-29 20:47:10 +00:00
Add the following table and index to a new or existing PostgreSQL database:
2016-01-21 01:52:49 +00:00
```sql
2016-01-28 00:15:48 +00:00
CREATE TABLE vault_kv_store (
2016-01-29 20:47:10 +00:00
parent_path TEXT COLLATE "C" NOT NULL,
path TEXT COLLATE "C",
key TEXT COLLATE "C",
value BYTEA,
CONSTRAINT pkey PRIMARY KEY (path, key)
2016-01-21 01:52:49 +00:00
);
2016-01-29 20:47:10 +00:00
CREATE INDEX parent_path_idx ON vault_kv_store (parent_path);
2016-01-21 01:52:49 +00:00
```
2016-01-29 20:47:10 +00:00
If you're using a version of PostgreSQL prior to 9.5, create the following
function:
2016-01-23 00:15:10 +00:00
```sql
2016-01-29 20:47:10 +00:00
CREATE FUNCTION vault_kv_put(_parent_path TEXT, _path TEXT, _key TEXT, _value BYTEA) RETURNS VOID AS
2016-01-23 00:15:10 +00:00
$$
BEGIN
LOOP
-- first try to update the key
2016-01-29 20:47:10 +00:00
UPDATE vault_kv_store
SET (parent_path, path, key, value) = (_parent_path, _path, _key, _value)
WHERE _path = path AND key = _key;
2016-01-23 00:15:10 +00:00
IF found THEN
RETURN;
END IF;
-- not there, so try to insert the key
-- if someone else inserts the same key concurrently,
-- we could get a unique-key failure
BEGIN
2016-01-29 20:47:10 +00:00
INSERT INTO vault_kv_store (parent_path, path, key, value)
VALUES (_parent_path, _path, _key, _value);
2016-01-23 00:15:10 +00:00
RETURN;
EXCEPTION WHEN unique_violation THEN
-- Do nothing, and loop to try the UPDATE again.
END;
END LOOP;
END;
$$
LANGUAGE plpgsql;
```
More info can be found in the [PostgreSQL documentation ](http://www.postgresql.org/docs/9.4/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE ):
2015-04-17 19:01:20 +00:00
#### Backend Reference: Inmem
The in-memory backend has no configuration options.
#### Backend Reference: File
The file backend has the following options:
* `path` (required) - The path on disk to a directory where the
data will be stored.