2014-09-11 18:19:48 +00:00
|
|
|
---
|
|
|
|
layout: "docs"
|
2014-09-13 03:08:54 +00:00
|
|
|
page_title: "Commands: Keyring"
|
|
|
|
sidebar_current: "docs-commands-keyring"
|
2014-09-11 18:19:48 +00:00
|
|
|
---
|
|
|
|
|
2014-09-13 03:08:54 +00:00
|
|
|
# Consul Keyring
|
2014-09-11 18:19:48 +00:00
|
|
|
|
2014-09-13 03:08:54 +00:00
|
|
|
Command: `consul keyring`
|
2014-09-11 18:19:48 +00:00
|
|
|
|
2014-09-13 03:08:54 +00:00
|
|
|
The `keyring` command is used to examine and modify the encryption keys used in
|
2014-09-11 18:19:48 +00:00
|
|
|
Consul's [Gossip Pools](/docs/internals/gossip.html). It is capable of
|
2014-09-19 01:57:18 +00:00
|
|
|
distributing new encryption keys to the cluster, retiring old encryption keys,
|
|
|
|
and changing the keys used by the cluster to encrypt messages.
|
2014-09-11 18:19:48 +00:00
|
|
|
|
2014-09-13 03:08:54 +00:00
|
|
|
Because Consul utilizes multiple gossip pools, this command will only operate
|
2014-09-29 20:01:26 +00:00
|
|
|
against a server node for most operations.
|
2014-09-11 18:19:48 +00:00
|
|
|
|
|
|
|
Consul allows multiple encryption keys to be in use simultaneously. This is
|
|
|
|
intended to provide a transition state while the cluster converges. It is the
|
|
|
|
responsibility of the operator to ensure that only the required encryption keys
|
|
|
|
are installed on the cluster. You can ensure that a key is not installed using
|
|
|
|
the `-list` and `-remove` options.
|
|
|
|
|
2014-09-19 01:57:18 +00:00
|
|
|
All variations of the `keyring` command, unless otherwise specified below, will
|
|
|
|
return 0 if all nodes reply and there are no errors. If any node fails to reply
|
|
|
|
or reports failure, the exit code will be 1.
|
2014-09-11 18:19:48 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2014-09-13 03:08:54 +00:00
|
|
|
Usage: `consul keyring [options]`
|
2014-09-11 18:19:48 +00:00
|
|
|
|
2014-09-13 03:08:54 +00:00
|
|
|
Only one actionable argument may be specified per run, including `-init`,
|
2014-09-13 19:19:21 +00:00
|
|
|
`-list`, `-install`, `-remove`, and `-use`.
|
2014-09-11 18:19:48 +00:00
|
|
|
|
|
|
|
The list of available flags are:
|
|
|
|
|
2014-09-13 03:08:54 +00:00
|
|
|
* `-init` - Creates the keyring file(s). This is useful to configure initial
|
|
|
|
encryption keyrings, which can later be mutated using the other arguments in
|
|
|
|
this command. This argument accepts an ASCII key, which can be generated using
|
|
|
|
the [keygen command](/docs/commands/keygen.html).
|
|
|
|
|
|
|
|
This operation can be run on both client and server nodes and requires no
|
|
|
|
network connectivity.
|
|
|
|
|
2014-09-19 01:57:18 +00:00
|
|
|
Returns 0 if the key is successfully configured, or 1 if there were any
|
|
|
|
problems.
|
|
|
|
|
2014-09-11 18:19:48 +00:00
|
|
|
* `-install` - Install a new encryption key. This will broadcast the new key to
|
|
|
|
all members in the cluster.
|
|
|
|
|
|
|
|
* `-use` - Change the primary encryption key, which is used to encrypt messages.
|
|
|
|
The key must already be installed before this operation can succeed.
|
|
|
|
|
|
|
|
* `-remove` - Remove the given key from the cluster. This operation may only be
|
|
|
|
performed on keys which are not currently the primary key.
|
|
|
|
|
|
|
|
* `-list` - List all keys currently in use within the cluster.
|
|
|
|
|
2014-09-21 18:52:28 +00:00
|
|
|
* `-wan` - Operate on the WAN keyring instead of the LAN keyring (default)
|
|
|
|
|
2014-09-11 18:19:48 +00:00
|
|
|
* `-rpc-addr` - RPC address of the Consul agent.
|