hashicorp/consul — pull request #336 by ryanuber (2014-09-13 19:47:26+00:00)
Title: feature: gossip encryption key rotation

Since Serf supports symmetric key rotation for gossip messages, Consul can leverage this to allow key rotation for both the LAN and WAN gossip pools.

Because of the multiple gossip pools and a few other semantic differences between Serf and Consul, there are a few things to note about this implementation:

* The command is `consul keyring` to avoid confusion with TLS keys or KV keys.
* For operational simplicity, both LAN and WAN keyrings are modified / queried in the same command run for all keyring-related commands.
* Only server nodes are allowed to query or modify any keyrings. This avoids ambiguity in running `consul keyring` on a server vs. a client.
* Both LAN and WAN keyrings are persisted separately in consul's data-dir.
* At agent start, if keyring files exist in consul's data directory, they will be automatically loaded and updated if keys change.
* The `-encrypt` argument still works with unmodified behavior

Some examples of the feature in action in a cluster with one server and one client are in [this gist](https://gist.github.com/ryanuber/435f14e225be7cee12c7).

I've still got a few more tests and docs to write, but would like feedback on the overall flow of how this is working in its current form.

Related to #246